Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: A Tricky Problem with Context

by ilcylic (Scribe)
on Apr 08, 2002 at 02:42 UTC ( #157351=note: print w/replies, xml ) Need Help??


in reply to A Tricky Problem with Context

I'm not sure how well this would work, but it seems as though you could implement some sort of "multi-pass compiler" type solution.

By that I mean, have your script go through the VB script a couple of times. The first pass does what (I think) stephen is suggesting, having your script try and determine what each variable type is on any given line (or, per statement, really) and returning the reply in some sort of unique markup language that is internal to your compiler. The second pass goes through and compares the VBscript to your newly generated first pass document, and makes sure the actual sigils $, @, %, etc match what the vb script is actually doing at that point. (In fact, it might be a good idea to number each statement of the vb script as you go through it, and put the corresponding number at the beginning of the perl script line, to make sure that the compiler can determine which statements are supposed to correlate.) The third pass would go through the final perl script and clean up all of your internal stuff.

I'm certainly no expert on writing compilers/translators, so don't take my suggestion as gospel, but it sounds like it could work.

-il cylic

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://157351]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2021-10-26 16:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (90 votes). Check out past polls.

    Notices?