[antlr-interest] ANTLR3C 3.4 Usage of Parser

A Z asicaddress at gmail.com
Mon Jul 16 08:21:10 PDT 2012


"So LT is undefined and redefined as makro LT(n) but not as constant value
18. This may be a bug but I just replaced every LT with constant value 18
and left the makro in the .c file and got everything to compile than"

This will break your parser. You probably have LT defined as a lexer rule.

On 7/16/12, Paxi <coder at paxi.at> wrote:
> I encountered this thread at Stackoverflow in the meanwhile that states the
> JS grammar I´m using does no create a correct AST.
> http://stackoverflow.com/questions/3801658/using-antlr-to-identify-global-variable-declarations-in-a-javascript-file
> I did the changes mentioned there already in my grammar file but i still
> cant walk the AST :/
> Starting at the "program" rule i always get a tree with no child elements
> pProgram prog = &(m_pParser->program(m_pParser));
> pANTLR3_BASE_TREE c1 = (pANTLR3_BASE_TREE) prog->tree->super;
> pANTLR3_BASE_TREE c1 = (pANTLR3_BASE_TREE) prog->tree;
> tried with using the super field and the tree directly but none works.
>
> Starting at the "statement" rule gives me at least a valid root node but
> furthermore the results are also not as expected (which would be clear if
> ANTLR3 only parses one statement and ends after it, but thats why i want to
> start at the program rule...)
>
> Please give me some hints, I really need some help on this since i should
> finish it next week and I already read a lot through several topics here and
> the docs.
>
> --
> View this message in context:
> http://antlr.1301665.n2.nabble.com/ANTLR3C-3-4-Usage-of-Parser-tp7578377p7578394.html
> Sent from the ANTLR mailing list archive at Nabble.com.
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>


More information about the antlr-interest mailing list