class_docstr: The base class for nodes and leaves.
docstr: Returns the next leaf in the parser tree.
  Returns None if this is the last element in the parser tree.
docstr_tok: ["Returns","the","next","leaf","in","the","parser","tree",".","Returns","None","if","this","is","the","last","element","in","the","parser","tree","."]
code: def get_next_leaf(self):
      """
      Returns the next leaf in the parser tree.
      Returns None if this is the last element in the parser tree.
      """
      if self.parent is None:
          return None
  
      node = self
      while True:
          c = node.parent.children
          i = c.index(node)
          if i == len(c) - 1:
              node = node.parent
              if node.parent is None:
                  return None
          else:
              node = c[i + 1]
              break
  
      while True:
          try:
              node = node.children[0]
          except AttributeError:  # A Leaf doesn't have children.
              return node
  
imports: import sys
  from abc import abstractmethod, abstractproperty
  from parso._compatibility import utf8_repr, encoding
  from parso.utils import split_lines
label_desc: Use image node_id 5 for calling the NodeOrLeaf obj's underlying member method code with example usage: obj.get_next_leaf() and returns: None, None, node