A hard challenge anyone?

David Bovill david at openpartnership.net
Sat Feb 3 15:11:50 EST 2007

On 03/02/07, Phil Davis <revdev at pdslabs.net> wrote:Hi David,

Your problem is more of a mind-bender

Sure is - but thanks for the pointer at using "token"

On 03/02/07, Jim Ault <JimAultWins at yahoo.com> wrote:

Quick question:
> Is the script code you are analyzing something you wrote or someone
> else's?

It is aimed at analyzing anyones code.

The first is a function, the second a handler call
> function textWithoutCommas pBlock
> --code lines
> return pBlock
> end textWithoutCommas
> on textWOCommasHander pBlock
> --code lines
> return pBlock
> end textWOCommasHander

Yes - I have separate handlers to deal with commands, messages and custom
property calls. They are not causing a problem (yet) - nested function calls
are - so i am only dealing with real user defined function calls. At the
moment I extract the function call and then filter out Rev, External and
user defined function calls. Once I've got the user defined function calls I
search the script hierarchy for the matching handler if it exists - the
final result is a graph.

The hard bit is to be able to match the function call - and extract whatever
is between the brackets - then I can recurse the bit between the brackets if
it in turn contains a (user defined) function call.

My guess is that this is something that a regexp could deal with or do I
have to go back to the techique of counting opening and closing brackets?

More information about the Use-livecode mailing list