start: expr NEWLINE? ENDMARKER { ast.Expression(expr, lineno=1, col_offset=0) }
expr: ( expr '+' term { ast.BinOp(expr, ast.Add(), term) }
      | expr '-' term { ast.BinOp(expr, ast.Sub(), term) }
      | term { term }
      )
term: ( l=term '*' r=factor { ast.BinOp(l, ast.Mult(), r) }
      | term '/' factor { ast.BinOp(term, ast.Div(), factor) }
      | factor { factor }
      )
factor: ('(' expr ')' { expr }
        | atom { atom }
        )
atom: ( NAME { ast.Name(id=name.string, ctx=ast.Load()) }
      | NUMBER { ast.Constant(value=ast.literal_eval(number.string)) }
      )
