Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Parser

by jepri (Parson)
on Jun 17, 2002 at 22:05 UTC ( [id://175205]=note: print w/replies, xml ) Need Help??


in reply to Parser
in thread Clunky parsing problem, looking for simple solution

Wow. If you put that much work in, you should make yourself an account so you can feel the goodness of peer appreciation. That and you can give clintp a name to hate, so he doesn't have to keep referring to an anonymous monk :)

____________________
Jeremy
I didn't believe in evil until I dated it.

Replies are listed 'Best First'.
Re: Re: Parser
by Anonymous Monk on Jun 17, 2002 at 23:04 UTC
    Yes well you see the problem is that I was feeling slightly guilty. When I read the article originally, i had no idea what Parrot was, so the term "Parrot Basic" suggested a version of basic called Parrot, not, as it turned out, a version of basic that was supposed to run on an alpha-version virtual machine.

    Thus, you can understand that in my view, the fact that the basic interpreter (which I figured to be in perl) could not handle nested ELSE suggested that its internals were designed incorrectly (since perl is more than capable of recursion with little effort), and therefore it was in the best interests of the questioning monk to re-write his code in a manner more suited to the problem. I have no problem being blunt about this if necessary.

    The issue of course, being that it was not just another basic interpreter, nor was it written in perl. Instead it was written by hand in a register/op-code language that wasn't close to finished. While I looked into it myself and determined that a recursive decent parser is practical on the VM as it stands, it is by no means as trivial as the perl variant.

    Thus, by way of apology, I wrote code that would parse the Basic language the proper way and then do the necessary transformations to output a simplified Basic that would be easier to write Parrot code for until such time as it becomes easy to write a grammar within Parrot.

      That was nice of you to write that code. You appear to be quite good at it. We're all practising writing parsers and compilers to get ready for the main event - Perl 6, which will also compile down to parrot assembler. Find out more at dev.perl.org. You seem to enjoy writing this kind of code, maybe writing the next perl would appeal?

      In any case join the community - you don't have to own up to this exchange unless you want to :)

      ____________________
      Jeremy
      I didn't believe in evil until I dated it.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (6)
As of 2024-03-28 20:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found