[antlr-interest] Antlr vs Spirit

Bryan Ewbank ewbank at gmail.com
Fri Feb 25 10:01:24 PST 2005


To expand on what Braden said:

C++ templates have been demonstrated to be a complete programming
language; the books he mentions show, for example, the idiom for
implementing control flow and looping.  It also shows how to use
templates to generate just the right asm() call to access a needed
opcode that is not available in the compiler that was being used (an
immediate of some type, I think?).  And, the templates all evaporate
at compile/link time, so in this case, the code produced using
templates was faster than that produced without them.

C++ templates also do a reasonably good job of enforcing model-view
separation, as was talked about in the context of StringTemplate.

No, I'm not suggesting them for Antlr 3.0 to replace StringTemplate :-)

On Fri, 25 Feb 2005 06:01:26 -0500, Braden McDaniel
<braden at endoframe.com> wrote:
> On Sun, 2005-02-20 at 11:36 +0100, Hrvoje Nezic wrote:
> > Actually I don't understand how complex algorithms that should analyze
> > complex grammars could be implemented with C++ templates, but that is
> > another question.
> 
> And one that can only be answered by furthering your understanding of
> C++ templates. Some books you may want to look at on the subject are
> "C++ Templates" by Vandevoorde and Josuttis, and "C++ Template
> Metaprogramming" by Abrahams and Gurtovoy.


More information about the antlr-interest mailing list