Version 1.0
Copyright © 2022 Lowell D. Thomas
Python APG
 … an ABNF Parser Generator
Namespaces | Functions
semantic.py File Reference

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...
 

Detailed Description

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.

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