expression: multiplicative ( '+' multiplicative | '-' multiplicative )* ; multiplicative: factor ( '*' factor | '/' factor )* ; factor: INT | '(' expression ')' ; scanner CalcS: INT: '0'-'9'+; PLUS: '+'; MINUS: '-'; STAR: '*'; SLASH: '/'; LP: '('; RP: ')'; See also LL recognizers ANTLR JavaCC Coco/R External links JetPAG Homepage JetPAG at SourceForge Parser generators