class_docstr: Parser engine.
  
  A Parser instance contains state pertaining to the current token
  sequence, and should not be used concurrently by different threads
  to parse separate token sequences.
  
  See python/tokenize.py for how to get input tokens by a string.
  
  When a syntax error occurs, error_recovery() is called.
class_docstr_tok: ["Parser","engine",".","A","Parser","instance","contains","state","pertaining","to","the","current","token","sequence",",","and","should","not","be","used","concurrently","by","different","threads","to","parse","separate","token","sequences",".","See","python\/tokenize.py","for","how","to","get","input","tokens","by","a","string",".","When","a","syntax","error","occurs",",","error_recovery","(",")","is","called","."]
code: def parse(self, tokens):
      first_dfa = self._pgen_grammar.nonterminal_to_dfas[
          self._start_nonterminal
      ][0]
      self.stack = Stack([StackNode(first_dfa)])
  
      for token in tokens:
          self._add_token(token)
  
      while True:
          tos = self.stack[-1]
          if not tos.dfa.is_final:
              # We never broke out -- EOF is too soon -- Unfinished statement.
              # However, the error recovery might have added the token again, if
              # the stack is empty, we're fine.
              raise InternalParseError(
                  "incomplete input",
                  token.type,
                  token.string,
                  token.start_pos,
              )
  
          if len(self.stack) > 1:
              self._pop()
          else:
              return self.convert_node(tos.nonterminal, tos.nodes)
  
imports: from typing import Dict, Type
  from parso import tree
  from parso.pgen2.generator import ReservedString
label_desc: Use image node_id 2 for calling the BaseParser obj's underlying member method code with example usage: obj.parse(tokens) and returns: self