Version 1.0
Copyright © 2022 Lowell D. Thomas
Python APG
 … an ABNF Parser Generator
Variables
examples.ast.main Namespace Reference

Variables

string title
 
string abnf_syntax = 'S = alt1 / alt2\n'
 
 api = Api()
 
 grammar = api.generate(abnf_syntax)
 
 parser = Parser(grammar)
 
list data = []
 
string input_string = 'xyzbbb'
 
 result = parser.parse(utils.string_to_tuple(input_string), user_data=data)
 
 end
 
 ast = Ast(parser)
 

Variable Documentation

◆ abnf_syntax

string examples.ast.main.abnf_syntax = 'S = alt1 / alt2\n'

Definition at line 34 of file main.py.

◆ api

examples.ast.main.api = Api()

Definition at line 45 of file main.py.

◆ ast

examples.ast.main.ast = Ast(parser)

Definition at line 77 of file main.py.

◆ data

list examples.ast.main.data = []

Definition at line 60 of file main.py.

◆ end

examples.ast.main.end

Definition at line 66 of file main.py.

◆ grammar

examples.ast.main.grammar = api.generate(abnf_syntax)

Definition at line 46 of file main.py.

◆ input_string

string examples.ast.main.input_string = 'xyzbbb'

Definition at line 61 of file main.py.

◆ parser

examples.ast.main.parser = Parser(grammar)

Definition at line 53 of file main.py.

◆ result

examples.ast.main.result = parser.parse(utils.string_to_tuple(input_string), user_data=data)

Definition at line 62 of file main.py.

◆ title

string examples.ast.main.title
Initial value:
1 = '''Demonstrate the use of the Abstract Syntax Tree.
2 Demonstrates how to use the AST and why it is useful.
3 '''

Definition at line 28 of file main.py.

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