[antlr-interest] LineNumber of JavaSource
matthias.gutheil at informatik.uni-mannheim.de
Wed Jan 25 11:25:29 PST 2006
I am using the java15.g grammar from
I need the linenumbers for all TokenTypes in my AST. I extended the
AST-class and have linenumbers. But e.g. for CLASS_DEF or others there
are no line numbers generated.
I coded a bit in the Recognizer and there are lineNumers for these
Tokens, but then only
astFactory.create(CLASS_DEF, "CLASS_DEF")) is called, which constructs a
node without linenumber.
When I change the grammer, I get another Recognizer and it would work.
But I am not an expert in that (not yet), but I checked this for CLASS_DEF.
Is there another solution? The one with getting the linenumber from
childs is not 100% correct.
Matthias Gutheil, Dipl. Inform.
Lehrstuhl für Softwaretechnik
A5, 6, Gebäudeteil B
E-Mail: matthias.gutheil at informatik.uni-mannheim.de
Tel: (+49) 621 181 3913
More information about the antlr-interest