Version 1.0
Copyright © 2022 Lowell D. Thomas
Python APG
 … an ABNF Parser Generator
Classes | Functions
apg_py.api.rule_attributes Namespace Reference

Classes

class  Attr
 Simple class for attribute data for each rule. More...
 

Functions

def rule_attributes (rules, rule_deps)
 Compute the recursive and non-recursive attributes for each rule. More...
 
def display_rule_attributes (attrs_arg, mode='index')
 Display all rule attributes. More...
 

Function Documentation

◆ display_rule_attributes()

def apg_py.api.rule_attributes.display_rule_attributes (   attrs_arg,
  mode = 'index' 
)

Display all rule attributes.

Parameters
attrs_argThe attributes to display.
modeThe display mode
  • 'index' Display attributes of rules in the order they appear in the grammar syntax.
  • 'type' Display attributes grouped by recursive type, listed alphabetically within each type.
  • 'alpha' Display attributes alphabetically by rule name.
Returns
Returns a string of the display.

Definition at line 408 of file rule_attributes.py.

◆ rule_attributes()

def apg_py.api.rule_attributes.rule_attributes (   rules,
  rule_deps 
)

Compute the recursive and non-recursive attributes for each rule.

Parameters
rulesThe list of rules.
rule_depsThe rule dependencies previously computed (see rule_dependencies.py)
Returns
Returns the rule attributes and any errors as a dictionary {'errors': errors, 'attributes': attrs}

Definition at line 86 of file rule_attributes.py.

Python APG, Version 1.0, is licensed under the 2-Clause BSD License,
an Open Source Initiative Approved License.