[antlr-interest] Line and Column information lost during AST creation

Christophe Boutter boutter at ps.uni-sb.de
Wed Jan 3 03:10:09 PST 2007


Hey folks,

I hope you can help me. This is my first message on the list, so I hope
I do not ask something asked a lot of times before.

My problem is that during the AST creation in the parser all information
about lines and columns of the lexer Token is lost. But I need this
informations badly. Why is that?

I use ANTLR 2.7.7 in conjunction with Java.

An example of a parser rule which I used to test this, is:
actionDeclaration
	: "action" idList SEMI
	| "patient" "action" idList SEMI
	| "impatient" "action" idList SEMI
	;

idList
	: ID (COMMA ID)*
	;

Nothing fancy as I see it. The AST is created just as expected, only the
line and column infos are lost.

I would be very thankful for any help.

Cheers Chris
-- 
Try not to become a man of success, but rather try to become a man of value.
-- Albert Einstein



More information about the antlr-interest mailing list