[antlr-interest] C++ Target - pANTLR3_BASE_TREE_ADAPTOR

Ivan Brezina ibre5041 at ibrezina.net
Sun Aug 19 06:05:38 PDT 2012


On 08/19/2012 02:13 PM, kjam wrote:
> Hi All,
>
> I'm reading The Definitive ANTLR Reference and I've tried to write
> AST-building parser as shown in Chapter 3.3. The grammar is here -
> http://pastebin.com/Hd5rtTZk. I'm using ANTLR from Uber Jar
> 'antlr-3.4-with-cpp.jar' posted by Gokulakannan Somasundaram.
>
> When ANTLR runs, it generates following error:
>
> But parser and lexer are generated.
>
> Parser header file contains these lines:
>
> When compiling generated files, C++ compiler issues a compilation error on
> those lines:
>
> Seems that those lines are legacy from the plain C target. Is there any
> solution to this problem? I'd like to use C++ target and avoid mixing C++
> and plain C code.
>
>
So far AST is not supported by Gokul's Cpp target.
You'll have to try the template output a generate the AST by your own.

Ivan



More information about the antlr-interest mailing list