grammar Example_4_15_solution; /* eliminate left-recursivity when finished, check the grammar Grammar -> Check Grammar (CTRL+r) */ options { k=1; } init : expr '\n'; expr : multExpr plusOper expr | multExpr ; plusOper : '+' | '-' ; multExpr : atom multOper multExpr | atom ; multOper : '*' | '/' ; atom : INT | '(' expr ')' ; INT : ('-')? ('0'..'9')+ ;