[antlr-interest] wildcard for tree node: x=EOA ?

Jean-Claude Durand Jean-Claude.Durand at imag.fr
Wed Feb 22 07:30:42 PST 2012


Hello,

Sam Harwell (26 novembre 2008) proposed the correction for the generic wildcard node:
1. Is it implemented in antlr 3.4 for C ?
2. Is EOA the generic type of a node ? 
3. Can I write:

// Impression XML:
// ***************
xml
@init{ int nond=0; }
	:
	appxml[1, &nond]
	;
	
appxml[int indent, int* pnond]:
	^( x=EOA
			{ imprimerNoeud2XML(indent, debut, $x, pnond); }
		appxml[indent+1, pnond]+
			{ imprimerNoeud2XML(indent, fin, $x, pnond); }
	)
	|
		y=EOA		
			{ imprimerNoeud2XML(indent, feuille, $y, pnond); }
	;


I am upgrading from antlr 3.1 to 3.4 and until now I used the dot as the generic node (  x=. and y=. in the above example ).
Now I get the error "Wildcard invalid as root; wildcard can itself be a tree".

Thanks a lot in advance

Jean-Claude Durand

LIG, équipe GETALP
385, rue de la Bibliothèque
BP 53
38041 Grenoble cedex 9

Jean-Claude.Durand at imag.fr
tél: +33 (0)4 76 51 43 81
fax: +33 (0)4 76 63 56 86



More information about the antlr-interest mailing list