docstr: Use the node-level invariant ones for basic parsing operations (push/pop/shift).
  These still will operate on the stack; but they won't create any new nodes, or
  modify the contents of any other existing nodes.
  
  This saves us a ton of time when we are backtracking, since we
  want to restore to the initial state as quick as possible, which
  can only be done by having as little mutatations as possible.
docstr_tok: ["Use","the","node-level","invariant","ones","for","basic","parsing","operations","(","push\/pop\/shift",")",".","These","still","will","operate","on","the","stack",";","but","they","wo","n't","create","any","new","nodes",",","or","modify","the","contents","of","any","other","existing","nodes",".","This","saves","us","a","ton","of","time","when","we","are","backtracking",",","since","we","want","to","restore","to","the","initial","state","as","quick","as","possible",",","which","can","only","be","done","by","having","as","little","mutatations","as","possible","."]
code: def backtrack(self) -> Iterator[None]:
      """
      Use the node-level invariant ones for basic parsing operations (push/pop/shift).
      These still will operate on the stack; but they won't create any new nodes, or
      modify the contents of any other existing nodes.
  
      This saves us a ton of time when we are backtracking, since we
      want to restore to the initial state as quick as possible, which
      can only be done by having as little mutatations as possible.
      """
      is_backtracking = self.parser.is_backtracking
      try:
          self.parser.is_backtracking = True
          yield
      finally:
          self.parser.is_backtracking = is_backtracking
  
imports: from contextlib import contextmanager
  from typing import TYPE_CHECKING, Any, Callable, Dict, Iterator, List, Optional, Set, Tuple, Union, cast
  from blib2to3.pgen2.grammar import Grammar
  from blib2to3.pytree import NL, Context, Leaf, Node, RawNode, convert
  from .None import grammar, token, tokenize
label_desc: Use image node_id 4 for calling the Recorder obj's underlying member method code with example usage: obj.backtrack() without return types