Script Analysis
Jan Schenkel
janschenkel at yahoo.com
Fri Nov 15 21:30:00 EST 2002
--- Richard Gaskin <ambassador at fourthworld.com> wrote:
> Jan Schenkel wrote:
>
> > I'm looking for a script analysis tool. I'm mainly
> > interested in being able
> > to choose an object and a message and view all
> > script that is executed in
> > response to that message.
> >
> > I guess this would involve firstly parsing the
> code
> > to find custom functions
> > and handlers then parsing the scripts down the
> > object heirarchy to find the
> > script they refer to. Then repeating the process
> > with those scripts until
> > there are no more scripts to parse. It would need
> to
> > handle frontscripts,
> > backscripts, libraries, setprops, getprops and
> sent
> > messages also.
> >
> > Anyone interested in working on it with me or have
> > anything to help me get
> > started?
>
> Here's a small part of it:
>
>
<http://www.RunRev.com/revolution/downloads/developerdownloads/4W_UmbrellaMa
> n.rev.zip>
>
>
> --
> Richard Gaskin
Hi RIchard,
It's nice to see my name used in these listson a
regular basis, but it was Monte Goulding who came up
with the original question :-)
4W_UmbrellaMan can indeed prove very useful in
tracking down the flow of a script, but as I said, it
shows the flow in _one_ instance.
How would you do a 'cold' check of the following
script-snippet and tell what is going to happen?
on myObfuscatedHandler pParam1, pParam2, pParam3
global gSomeGLobal,gOtherGlobal
switch pParam1
case "some"
put field gSomeGlobal into tTarget
put "someMessage" into tMessage
put "call" into tMethod
break
case "other"
put field (gOtherGlobal&pParam3) into \
tTarget
put "otherMessage" && pParam3 into tMessage
put "send" into tMethod
break
default
return "error: pFirstParam must be some or other"
break
end switch
do tMethod && tMessage && "to" && tTarget && \
"in" && pParam3 && "seconds"
end myObfuscatedHandler
Have fun writing an analyser for that ; only debugging
this step by step can assure you of its correctness,
and even then only in your test-cases.
What would be kind of nice in that department is a
system that keeps track of which pieces of code have
not run yet.
Jan Schenkel.
=====
"As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld)
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com
More information about the use-livecode
mailing list