Semantic translation of the SABNF AST. More...
Go to the source code of this file.
Namespaces | |
apg_py.api.semantic | |
Functions | |
def | apg_py.api.semantic.semantic (api) |
Translate the AST, generating a list of rule objects, and UDT objects, if any. More... | |
def | apg_py.api.semantic.remove_redundant_opcodes (rules) |
Opcodes ALT and CAT with only one child are redundant and can be removed. More... | |
def | apg_py.api.semantic.check_for_removal (i, opcodes) |
Scan all opcodes and check for ALT, CAT and REP that can be removed. More... | |
def | apg_py.api.semantic.adjust_children (j, opcodes) |
When an opcode is removed the indecies of the ALT and CAT children must be corrected for the removed opcodes. More... | |
Semantic translation of the SABNF AST.
The AST is computed in the syntax phase (syntax.py). The AST is translated to generate all rules, UDTs and opcodes.
Definition in file semantic.py.