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

Functions

def anbncn (cb_data)
 

Variables

string title
 
string abnf_syntax = 'S = u_anbncn\n'
 
 api = Api()
 
 grammar = api.generate(abnf_syntax)
 
 parser = Parser(grammar)
 
string input_string = 'aaabbbccc'
 
 result = parser.parse(utils.string_to_tuple(input_string))
 

Function Documentation

◆ anbncn()

def examples.basics.udts.anbncn (   cb_data)

Definition at line 25 of file udts.py.

Variable Documentation

◆ abnf_syntax

string examples.basics.udts.abnf_syntax = 'S = u_anbncn\n'

Definition at line 67 of file udts.py.

◆ api

examples.basics.udts.api = Api()

Definition at line 70 of file udts.py.

◆ grammar

examples.basics.udts.grammar = api.generate(abnf_syntax)

Definition at line 71 of file udts.py.

◆ input_string

string examples.basics.udts.input_string = 'aaabbbccc'

Definition at line 80 of file udts.py.

◆ parser

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

Definition at line 78 of file udts.py.

◆ result

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

Definition at line 81 of file udts.py.

◆ title

string examples.basics.udts.title
Initial value:
1 = '''Demonstrate the use of User-Defined Terminals (UDTs).
2 These are handwritten code snippets for matching
3 difficult to express or non-context-free phrases.
4 '''

Definition at line 59 of file udts.py.

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