[antlr-interest] Access AST created by parser
a.k.n.s
angela.k.ns at gmail.com
Mon Aug 27 02:59:32 PDT 2007
I am very, very new to antlr, so perhaps I'm missing something simple - but
I seem to be unable to access the AST representation of my input file.
The basics of my grammar are as follows:
grammar Model;
options {
language=CSharp;
output=AST;
}
deck
: (statement)+
;
statement
: (welldef|modelSize)
;
welldef
: 'WELLDEF'^ declarator+ EOL
;
modelSize: 'MODELSIZE'^ xSize ySize zSize EOL
;
....
I use AntlrWorks to generate the Parser and Lexer.
My input file looks like this:
WELLDEF SS001
WELLDEF PN001 ERER001 P33001 AA001
MODELSIZE 53 79 67
WELLDEF PN0014444
I'm only able to access the tree of the first row (by calling parser.deck())
- is there a parser function I can call to get a tree representation of the
entire file? I would really appreciate it if someone could point me in the
right direction.
Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070827/52f1fdc0/attachment.html
More information about the antlr-interest
mailing list