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

Variables

string title
 
string abnf_syntax = 'S = "a" S / "y"\n'
 
string input_string = '***aaay***'
 
int beg = 3
 
int len = 4
 
 end
 
 api = Api()
 
 grammar = api.generate(abnf_syntax)
 
 parser = Parser(grammar)
 
 result
 

Variable Documentation

◆ abnf_syntax

string examples.basics.substrings.abnf_syntax = 'S = "a" S / "y"\n'

Definition at line 23 of file substrings.py.

◆ api

examples.basics.substrings.api = Api()

Definition at line 36 of file substrings.py.

◆ beg

int examples.basics.substrings.beg = 3

Definition at line 26 of file substrings.py.

◆ end

examples.basics.substrings.end

Definition at line 28 of file substrings.py.

◆ grammar

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

Definition at line 37 of file substrings.py.

◆ input_string

string examples.basics.substrings.input_string = '***aaay***'

Definition at line 25 of file substrings.py.

◆ len

int examples.basics.substrings.len = 4

Definition at line 27 of file substrings.py.

◆ parser

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

Definition at line 45 of file substrings.py.

◆ result

examples.basics.substrings.result
Initial value:
1 = parser.parse(
2  utils.string_to_tuple(input_string),
3  sub_begin=beg,
4  sub_length=len)

Definition at line 46 of file substrings.py.

◆ title

string examples.basics.substrings.title
Initial value:
1 = '''Demonstrate the parsing of substrings of the full input string.
2 '''

Definition at line 18 of file substrings.py.

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