> > Speaking of that, how's TT3?   You should use the MJD 
> parser for that.

> The problem is that TT has some very demanding requirements 
> of a parser, and TT3 especially so. 
> A purely state-table-driven parser (as in TT2)
> isn't flexible enough for a language as flexible as TT.  

<skipped>

> It's a real bastard hybrid, quite probably unlike anything 
> currently known 
> to man.  But it should be fast, forgiving and extremely
flexible.

As I can see, current TT2 parser is not state-driven. The real
disadvnatage is that you cannot use things like this [% var = '%]'
%] in template.

But why don's use "multi-level" structure of parsers? First,
simple state-driven parser splits template into tokens (producing
array of tokens), then syntax analyzer performs context-dependent
analysis, giving us program tree (this step usually is split into
context-free and context-dependent phases). As the last step,
compiled template code is created. As far as I know, it is the
"classic" approach to design of compilers.


P.S. I have not reviewed TT3 parser, so maybe it is designed just
like I suggested. Sorry for idle talk in this case.

-- 
Sergey Martynoff


_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to