code: def arithm_expr_parse(line):
      
      vals = []
      ops = []
      for tok in line + [';']:
          if tok in priority:  # tok is an operator
              while (tok != '(' and ops and
                     priority[ops[-1]] >= priority[tok]):
                  right = vals.pop()
                  left = vals.pop()
                  vals.append((left, ops.pop(), right))
              if tok == ')':
                  ops.pop()    # this is the corresponding '('
              else:
                  ops.append(tok)
          elif tok.isdigit():  # tok is an integer
              vals.append(int(tok))
          else:                # tok is an identifier
              vals.append(tok)
      return vals.pop()
docs: Constructs an arithmetic expression tree
  
      :param line: list of token strings containing the expression
      :returns: expression tree
  
      :complexity:     linear