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

Variables

string title
 
string L = 'L = "("\n'
 
string R = 'R = ")"\n'
 
string PM = 'P = L P R / L R\n'
 
string PG = 'match = %^ P %$\n'
 
string PT = 'match = %^ P %$\n'
 
string header = 'RESULT'
 
int testno = 0
 
 exp = ApgExp(PM)
 
string input = '((()))'
 
 result = exp.exec(input)
 

Variable Documentation

◆ exp

examples.exp.recursive.exp = ApgExp(PM)

Definition at line 40 of file recursive.py.

◆ header

string examples.exp.recursive.header = 'RESULT'

Definition at line 36 of file recursive.py.

◆ input

string examples.exp.recursive.input = '((()))'

Definition at line 42 of file recursive.py.

◆ L

string examples.exp.recursive.L = 'L = "("\n'

Definition at line 21 of file recursive.py.

◆ PG

string examples.exp.recursive.PG = 'match = %^ P %$\n'

Definition at line 27 of file recursive.py.

◆ PM

string examples.exp.recursive.PM = 'P = L P R / L R\n'

Definition at line 24 of file recursive.py.

◆ PT

string examples.exp.recursive.PT = 'match = %^ P %$\n'

Definition at line 31 of file recursive.py.

◆ R

string examples.exp.recursive.R = 'R = ")"\n'

Definition at line 22 of file recursive.py.

◆ result

examples.exp.recursive.result = exp.exec(input)

Definition at line 43 of file recursive.py.

◆ testno

int examples.exp.recursive.testno = 0

Definition at line 37 of file recursive.py.

◆ title

string examples.exp.recursive.title
Initial value:
1 = '''This example will demonstrate the use of
2 recursive grammar rules for matching nested pairs.
3 Note that the begin and end of string anchors,
4 %^ and %$, are used so that the pattern must
5 match the entire string or fail.
6 '''

Definition at line 12 of file recursive.py.

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