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

Variables

string title
 
string usyntax
 
string rsyntax
 
string rssyntax
 
 api = Api()
 
 grammar = api.generate(usyntax)
 
 parser = Parser(grammar)
 
string input = '<level1><level2><level3></level3></level3></level3>'
 
 result = parser.parse(utils.string_to_tuple(input))
 
 end
 

Variable Documentation

◆ api

examples.basics.back_reference.api = Api()

Definition at line 45 of file back_reference.py.

◆ end

examples.basics.back_reference.end

Definition at line 55 of file back_reference.py.

◆ grammar

examples.basics.back_reference.grammar = api.generate(usyntax)

Definition at line 46 of file back_reference.py.

◆ input

string examples.basics.back_reference.input = '<level1><level2><level3></level3></level3></level3>'

Definition at line 53 of file back_reference.py.

◆ parser

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

Definition at line 52 of file back_reference.py.

◆ result

examples.basics.back_reference.result = parser.parse(utils.string_to_tuple(input))

Definition at line 54 of file back_reference.py.

◆ rssyntax

string examples.basics.back_reference.rssyntax
Initial value:
1 = '''html = "<" tag-name ">" [html] "</" \\%s%rtag-name ">"
2 tag-name = alpha *(alphanum)
3 alpha = %d97-122 / %d65-90
4 alphanum = alpha / %d48-57
5 '''

Definition at line 38 of file back_reference.py.

◆ rsyntax

string examples.basics.back_reference.rsyntax
Initial value:
1 = '''html = "<" tag-name ">" [html] "</" \\%rtag-name ">"
2 tag-name = alpha *(alphanum)
3 alpha = %d97-122 / %d65-90
4 alphanum = alpha / %d48-57
5 '''

Definition at line 33 of file back_reference.py.

◆ title

string examples.basics.back_reference.title
Initial value:
1 = '''Demonstrates back referencing.
2 A "universal" mode back reference matches the last
3 of all previous matched phrases.
4 A "recursive" mode back reference matches the previously
5 matched phrase which has the same recursive rule parent node.
6 '''

Definition at line 19 of file back_reference.py.

◆ usyntax

string examples.basics.back_reference.usyntax
Initial value:
1 = '''html = "<" tag-name ">" [html] "</" \\tag-name ">"
2 tag-name = alpha *(alphanum)
3 alpha = %d97-122 / %d65-90
4 alphanum = alpha / %d48-57
5 '''

Definition at line 28 of file back_reference.py.

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