pyebnf/compiler.py
def rules(self):
    """The AST rules."""
    if self._rules is None:
      self._rules = []
      for child in self.grammar.children:
        if child.is_type(TokenType.rule):
          name, expression = child.children
          self._rules.append(Rule(name.value, self._expression_to_asn(expression), name.position, child.consumed))
    return self._rules
def rules(self):
    """The AST rules."""
    if self._rules is None:
      self._rules = []
      for child in self.grammar.children:
        if child.is_type(TokenType.rule):
          name, expression = child.children
          self._rules.append(Rule(name.value, self._expression_to_asn(expression), name.position, child.consumed))
    return self._rules
The AST rules.