[antlr-interest] Antlr v4 - C++ target

Gokulakannan Somasundaram gokul007 at gmail.com
Tue Jan 24 04:06:19 PST 2012


>
> Hi,
> I've been using spirit for about a year. Both versions "1" and "2".
> During that time I reported two bugs in gcc and then finally I moved
> to ANTLR.
>
> Templates are nice, but on the other hand they must not be overused.
> Templates are "equal" or transformable onto recursively enumerable
> functions
> so theoretically you can perform any kind computation at compile time and
> then
> you can store the result in the "final" program. The efficiency of
> such a program
> is usually very poor. Every compiler has it's own limitations.
> For example when using MSVC you can have max. 2048 nested template
> specializations.
> This implies max. depth for the recursive function.
>
> When using spirit I ended up in a situation that my grammar could not
> be compiled at all
> using MSVC. While gcc had exponential memory requirements per
> grammar's rule length.
>
> The approach boots uses is not applicable for complex grammars. The
> rest of the boost
> library like functors, binds ... etc are very useful.
>
> Ivan
>
>
> Noted. Its the same reason, i moved to ANTLR. So as i have already said, i
will limit the usage of templates, so that the compile time doesn't suffer.
Moreover, we are using templates only with runtime not for the parser
generation. So we don't have the same challenge as Spirit author.

Gokul.


More information about the antlr-interest mailing list