Hi, I'm using the Java1.5 parser + tree parser by Mike Studman.
My problem: I need to extract the line numbers from the parser.
Funny thing: in one part of the parser it works, but in the tree parser
it doesn't. In java15.g I added some printlns to print getLine() of
some nodes, and they printed the lines. The very same nodes are also
put into a tree structure to read by the java-tree parser (obviously).
Now for some reason the line information disappears while the tree is
being built. In java15.tree.g I can add printlns, but the line number
of the *same* node as in java15.g is suddenly 0, while it was, say 15,
only a second (and I assume a "return") before.
Why is this?
What can / do I have to do, to get the line numbers to the high level,
where I need it?
I also tried various ways of modifying the trees built, including
creating a custom tree (using #() instead of the ^ often used in
java15.g) with some nodes that only have line info. Every time the line
info seems to disappear.
Unfortunately Antlr do***entation isn't really helpful. It only
mentions that there *is* the newline() method and that getLine() can be
used, but it doesn't explain why between files the line information
disappears.
(or is this a bug?)
Best regards,
Ulrich


|