Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 03a94d8f913fd31140f11f39714fa79d > files > 30

ant-antlr3-20110110-8.mga3.noarch.rpm

tree grammar PolyPrinter;
options {
	tokenVocab=Poly;
	ASTLabelType=CommonTree;
	output=template;
}

poly:	^('+'  a=poly b=poly)	-> template(a={$a.st},b={$b.st}) "<a>+<b>"
	|	^(MULT a=poly b=poly)	-> template(a={$a.st},b={$b.st}) "<a><b>"
	|	^('^'  a=poly b=poly)	-> template(a={$a.st},b={$b.st}) "<a>^<b>"
	|	INT						-> {%{$INT.text}}
	|	ID						-> {%{$ID.text}}
	;