in reply to Re: A parser for a limited grammar
in thread A parser for a limited grammar

Hi Rhandom, thanks for your reply.
I'm the author of Template::Alloy which is Template engine that can do Template::Toolkit, HTML::Template, HTML::Template::Expr, and Text::TMPL. It has two methods which almost fit your job description.

Actually, the first places I looked were Template and Template::Alloy, but you know those I've-got-to-make-a-decision-now-and-not-spend-time- figuring-out-if-another-module-will-work moments? Also, I wanted to avoid using a full blown module, as this was intended to be light weight (the original specs were a lot simpler than what it grew into by the time I finished). For instance, using Template::Alloy uses an extra 2.5MB over my 400 lines of code. The obvious cost here is that I don't get all the bells and whistles that come with a proper parser.

The hash and array derefs didn't work because they are not currently supported by TT syntax - though I've been meaning to add support for that style of access for some time.

I actually started off going down the TT style of : hash.key1.key2, but then the problem of identifying what should be interpreted as a literal and what as a function etc overwhelmed me, and I fell back to Perl's standard style instead. As I said in my original post - insufficient planning on my part.

thanks again for your response

Clint