PLUS -> "+" MULT -> "*" CB -> ")" OB -> "(" ## ID -> ([0 - 9])+ ## ## EOL -> \n|\r SPACE -> \s|\t ## start -> { global stack result;} E {print " = "+string(pop(result)); } E -> E T { result.push(pop(result)+pop(result)); } E -> T T -> T F { result.push(pop(result)*pop(result)); } T -> F F -> E F -> {print lexeme; result.push(int(lexeme));}