Functions | |
def | semantic (api) |
Translate the AST, generating a list of rule objects, and UDT objects, if any. More... | |
def | remove_redundant_opcodes (rules) |
Opcodes ALT and CAT with only one child are redundant and can be removed. More... | |
def | check_for_removal (i, opcodes) |
Scan all opcodes and check for ALT, CAT and REP that can be removed. More... | |
def | 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... | |
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.
j | The opcode index of reference. |
opcodes | The list of opcodes for a particular rule. |
Definition at line 64 of file semantic.py.
def apg_py.api.semantic.check_for_removal | ( | i, | |
opcodes | |||
) |
Scan all opcodes and check for ALT, CAT and REP that can be removed.
i | The opcode index of reference. |
opcodes | The list of opcodes for a given rule. |
Definition at line 46 of file semantic.py.
def apg_py.api.semantic.remove_redundant_opcodes | ( | rules | ) |
Opcodes ALT and CAT with only one child are redundant and can be removed.
Opcodes REP with min = max = 1 are redundant and can be removed.
rules | The grammar object rules. |
Definition at line 32 of file semantic.py.
def apg_py.api.semantic.semantic | ( | api | ) |
Translate the AST, generating a list of rule objects, and UDT objects, if any.
api | The api object for the grammar syntax (api.py) |
Definition at line 10 of file semantic.py.