[Petal] [HELP] Anybody has experience with parsing?

Jean-Michel Hiver jhiver at mkdoc.com
Tue Jun 10 18:26:16 BST 2003


Hi list,

I'm trying to build a better parser for Petal TALES expressions. The
major bug / limitation I'd like to overcome is the fact that you can't
write expressions such as:

  true: self/method ${self/other_method ${self/yet_other_method}}

I think that'd be a good feature. I had a look at Steve's modified
parser but it's just a simple re-write of something that already works
although cleaner (but slower :)).

I have played a bit with Parse::RecDescent with seems promissing but
it's quite slow and a bit crazy: you mix the tokenization, parsing and
tree-walking in one operation.

Anyone has already done some serious recursive parsing with Perl?  Have
you got any examples, commented if possible, that I could play with?

Ideally I'd like to be able to build a parsed-tree of objects and walk
the tree to resolve the expression, or even better turn the tree into
Perl code in order to speed things up.

Any ideas or examples? I'm a bit stuck :)
Cheers,
-- 
Building a better web - http://www.mkdoc.com/
---------------------------------------------
Jean-Michel Hiver
jhiver at mkdoc.com  - +44 (0)114 255 8097
Homepage: http://www.webmatrix.net/


More information about the Petal mailing list