def METHOD_NAME(p, token, bp):
  # type: (tdop.Parser, tdop.Token, int) -> arith_expr_t
  if token.type == 'number':
    return arith_expr.Const(int(token.val))
  # We have to wrap a string in some kind of variant.
  if token.type == 'name':
    return arith_expr.Var(token.val)
  raise AssertionError(token.type)