class_docstr: State recorded for an individual pyparsing Element
code: def __init__(
      self,
      element: pyparsing.ParserElement,
      converted: EditablePartial,
      parent: EditablePartial,
      number: int,
      name: str = None,
      parent_index: typing.Optional[int] = None,
  ):
      #: The pyparsing element that this represents
      self.element: pyparsing.ParserElement = element
      #: The name of the element
      self.name: typing.Optional[str] = name
      #: The output Railroad element in an unconverted state
      self.converted: EditablePartial = converted
      #: The parent Railroad element, which we store so that we can extract this if it's duplicated
      self.parent: EditablePartial = parent
      #: The order in which we found this element, used for sorting diagrams if this is extracted into a diagram
      self.number: int = number
      #: The index of this inside its parent
      self.parent_index: typing.Optional[int] = parent_index
      #: If true, we should extract this out into a subdiagram
      self.extract: bool = False
      #: If true, all of this element's children have been filled out
      self.complete: bool = False
  
imports: import railroad
  import pyparsing
  import typing
  from typing import List, NamedTuple, Generic, TypeVar, Dict, Callable, Set, Iterable
  from jinja2 import Template
  from io import StringIO
  import inspect
label_desc: Use image node_id 1 to create a new ElementState object  with example: obj = ElementState(element, converted, parent, number, name, parent_index)