[antlr-interest] Quick tree parser question

Bill Andersen bill.andersen at mac.com
Thu Jan 27 19:17:52 PST 2011


Just to check my understanding...

If you have a non-terminal in a tree grammar, but you know that it resolves to a single token, e.g.

predicate
	: name
	| variable
	;

name
	: NAME
	;

variable
	: VARIABLE
	;

is this the best way to inspect the text associated with the non-terminal?

	$predicate.start.getText()

Thanks

	.bill


More information about the antlr-interest mailing list