code: def parse(self, text):
          
          self.expr = text
          try:
              out = ast.parse(text)
          except SyntaxError:
              self.raise_exception(None, msg='Syntax Error', expr=text)
          except:
              self.raise_exception(None, msg='Runtime Error', expr=text)
  
          return out
docs: Parse statement/expression to Ast representation.