Version 1.0
Copyright © 2022 Lowell D. Thomas
Python APG
 … an ABNF Parser Generator
Functions | Variables
examples.basics.stats Namespace Reference

Functions

def udt_sign (cbData)
 
def udt_integer (cbData)
 

Variables

string title
 
string float
 
string anbncn = 'S = &(A !bb) 1*aa B !cc\n'
 
 api = Api()
 
 grammar = api.generate(float)
 
 parser = Parser(grammar)
 
 stats = Stats(parser)
 
string input_string = '-123.456789E-10'
 
 result = parser.parse(utils.string_to_tuple(input_string))
 
 end
 

Function Documentation

◆ udt_integer()

def examples.basics.stats.udt_integer (   cbData)

Definition at line 43 of file stats.py.

◆ udt_sign()

def examples.basics.stats.udt_sign (   cbData)

Definition at line 32 of file stats.py.

Variable Documentation

◆ anbncn

string examples.basics.stats.anbncn = 'S = &(A !bb) 1*aa B !cc\n'

Definition at line 74 of file stats.py.

◆ api

examples.basics.stats.api = Api()

Definition at line 82 of file stats.py.

◆ end

examples.basics.stats.end

Definition at line 113 of file stats.py.

◆ float

string examples.basics.stats.float
Initial value:
1 = '''float = sign decimal exponent
2 sign = e_sign ;["+" / "-"]
3 decimal = integer [dot fraction]
4  / dot fraction
5 integer = u_integer; 1*%d48-57
6 dot = "."
7 fraction = *digit
8 exponent = ["e" esign exp]
9 esign = ["+" / "-"]
10 exp = 1*digit
11 digit = %d48-57
12 '''

Definition at line 62 of file stats.py.

◆ grammar

examples.basics.stats.grammar = api.generate(float)

Definition at line 83 of file stats.py.

◆ input_string

string examples.basics.stats.input_string = '-123.456789E-10'

Definition at line 94 of file stats.py.

◆ parser

examples.basics.stats.parser = Parser(grammar)

Definition at line 91 of file stats.py.

◆ result

examples.basics.stats.result = parser.parse(utils.string_to_tuple(input_string))

Definition at line 95 of file stats.py.

◆ stats

examples.basics.stats.stats = Stats(parser)

Definition at line 92 of file stats.py.

◆ title

string examples.basics.stats.title
Initial value:
1 = '''Demonstrate the display of the parser's statistics.
2 Displays a count of how many nodes of each kind were hit and how many times.
3 Also displays how many times each rule and UDT name is hit.
4 Note that operators and rule/UDT names that have
5 a 0(zero) hit count are not displayed.
6 '''

Definition at line 22 of file stats.py.

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