As an example of what Justin said, recently I tried to write a simple little Perl
program to scour all the HTML, CFM (Cold Fusion), and JS files in a tree of
directories and make a diagram of which pages call which other pages. It was
complicated by the fact that a file's URL is not the same as it's file path, so I had
to treat "HREF"'s and "location=" differently than Cold Fusion "INCLUDE"s.
I was completely stumped, though, when it came to figuring out what page the following
Javascript would go to:
document.location.href = x;
Where the variable x was built up in a few expressions (x = "this" + myvar + "that" +
othervar )
In order to figure it out I would have to actually RUN the Javascript, which could
theoretically look at browser variables, etc.
BTW Justin Case? I know someone named Edward Zackery Lee (Ed Zack Lee).
At 08:44 AM 11/28/00 -0700, Justin Case wrote:
>Julian Monteiro wrote:
>> I'm trying do make a Robot which interpretate Javascript pages.
>
>HTML is a STRUCTURAL language. It describes the STRUCTURE of a document. A robot
>can analyze and validate the structure to see if it conforms to the rules of the
>language. It can also extract "meaning" (e.g. a link) from the document because
>the structure defines what the parts "mean".
>
>JavaScript (and Java) are PROCEDURAL languages. They can make branching
>decisions and execute loops. A robot could validate the syntax of the language,
>but to find out what it "means" (e.g. to extract links for a spider) the robot
>would have to execute or emulate the instructions. In other words, a badly coded
>web page could put your robot into an infinite loop.
>
>Also, for your robot to fully examine the "meaning" of the program, it would
>have to follow BOTH SIDES of each branch in the logic, to see where it leads.
>This quickly creates a nearly infinite group of permutations in all but the
>simplest programs.
>
>Anyone intending to develop (or ask someone else to develop) a JavaScript
>"interpretater" needs to consider these issues and realize that reliably
>extracting the "meaning" from program source code is a computationally
>prohibitive task.
>
>To put it another way, a compiler can identify syntax errors in a program. So
>could a robot. But to find logic errors (or the outcome of correct logic) you
>have to actually run the code.
>
>So what is it you want this "interpretater" to produce?
---------------------------------------------------------------------------
Peter Theobald, Chief Technology Officer
LiquidStreaming http://www.liquidstreaming.com
[EMAIL PROTECTED]
Phone 1.212.545.1232 x204 Fax 1.212.545.0938
To put this contact information into your Palm device, click here:
http://www.coola.com/cgi-bin/addinfo.cgi?pid=15803&rid=972879910&type=A