1tree grammar Simplify;
2
3options {
4    tokenVocab=VecMath;
5    ASTLabelType=CommonTree;
6    output=AST;
7    language=CSharp3;
8    filter=true;
9    //rewrite=true;
10}
11
12@namespace{Antlr3.Runtime.Test.Composition}
13
14topdown
15    :   ^( MULT INT ^(VEC (e+=.)+) ) -> ^(VEC ^(MULT INT $e)+)
16    ;
17
18bottomup
19    :  ^(MULT a=. b=INT {$b.int==0}?) -> $b // x*0 -> 0
20    ;
21