[antlr-interest] Odd troubles with AST generation (C++)
Loring Craymer
Loring.G.Craymer at jpl.nasa.gov
Sat Jun 4 21:41:24 PDT 2005
Check the manual--Ric has a write up on ASTFactory initialization in the C++
runtime section.
--Loring
> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of leviathan at mchsi.com
> Sent: Saturday, June 04, 2005 9:32 PM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] Odd troubles with AST generation (C++)
>
> I must have missed something big in the ANTLR tutorial on AST generation.
> When
> I use the minip or tinyc code it will compile and work fine, but when I
> make
> any modifications it won't. I ended up reducing my huge grammar to just
> this:
>
> options {
> language="Cpp";
> }
>
> class TetraParser extends Parser;
>
> options {
> buildAST=true;
> importVocab=TETRA; // use vocab generated by lexer
> }
>
> program:
> ID
> ;
>
> to isolate the problem, but it still occurs and I have no clue why. The
> error
> stems from this line when I debug:
>
> tmp1_AST = astFactory->create(LT(1));
>
> in TetraParser::program().
>
> "Unhandled exception at 0x0046c741 in tc.exe: 0xC0000005: Access violation
> reading location 0x00000010."
>
> The complete grammar works without AST construction. Can someone help me?
> It's
> been driving me crazy, I feel like i've missed some insignifigant error.
More information about the antlr-interest
mailing list