[antlr-interest] Grouping nodes in the AST

Christopher Hunt huntc at internode.on.net
Wed Dec 22 16:53:47 PST 2010


Hi Terence,

Thanks so much!

That did indeed work, but what threw me is that the AST output in ANTLRworks showed a nil element only (and nothing else!). However all appears well when I run my unit tests on the parser and tree walker.

FYI I also subsequently modified my tree grammar to read:

line
	: ruleLine* zoneLine* linkLine*
	;

Thanks again.

Kind regards,
Christopher

On 23/12/2010, at 11:00 AM, Terence Parr wrote:

> line
> 	: (r+=ruleLine | z+=zoneLine | l+=linkLine | NEWLINE!)* -> $r+ $z+ $l+
> 	;



More information about the antlr-interest mailing list