[antlr-interest] ANTLR3.0b5 - Embedding on parser within another one (Parser nesting)

Kay Roepke kroepke at classdump.org
Tue Nov 28 07:45:06 PST 2006


On 28. Nov 2006, at 16:17 , alexander.berger at finnova.ch wrote:

> but in the rewrite instruction '-> $x.expression' antlr complains  
> with the following error message:
>
> error(100): PLang.g3:111:19: syntax error: antlr: PLang.g3:111:19:  
> unexpected token: .
>
> In other words, in the rewrite instruction "x=subParser ->  
> $x.expression"
> antlr does not allow to use the return value as output Tree.

This is a bit obscure, I agree. Needs documentation.

Try using

start :
	x=subParser -> {$x}
	;

That should treat the return value of subParser as a tree.

HTH,

-k

-- 
Kay Röpke
http://classdump.org/






More information about the antlr-interest mailing list