Get a handler from a script
Martin Baxter
mb.ur at harbourhost.co.uk
Mon Mar 20 07:50:55 EST 2006
David Burgun wrote:
> Hi,
>
> Yes, this really is the problem. In order to parse and identify a
> function/handler 100% correctly you need to do most (if not all) of the
> work of the TranScript Parser in the Script Compiler. In the past I've
> written any number of language parsers and I know it is non-trivial to
> get it 100% right. The best solution IMO would be to add code to RunRev
> that allows the script to find out if a handler/function is defined or
> not. One way would be to add a function that checks for the existence of
> a hanlder/function (without looking at the text of the script), another
> would be to hold an array of functions/handlers as a property of the
> Object.
Back in my Hypercard days I had a large project that included a script
locator handler. I bypassed all of the issues of parsing for actual
handlers by adding metadata as comments in a consistent format at the
top of each handler. This was then very simple to extract.
Just food for thought.
Martin Baxter
More information about the use-livecode
mailing list