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

Variables

string title
 
string abnf_syntax = 'S = &(A !bb) 1*aa B !cc\n'
 
 api = Api()
 
 grammar = api.generate(abnf_syntax)
 
 parser = Parser(grammar)
 
string input_string = 'aaabbbccc'
 
 result = parser.parse(utils.string_to_tuple(input_string))
 

Variable Documentation

◆ abnf_syntax

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

Definition at line 32 of file look_ahead.py.

◆ api

examples.basics.look_ahead.api = Api()

Definition at line 40 of file look_ahead.py.

◆ grammar

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

Definition at line 41 of file look_ahead.py.

◆ input_string

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

Definition at line 50 of file look_ahead.py.

◆ parser

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

Definition at line 49 of file look_ahead.py.

◆ result

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

Definition at line 51 of file look_ahead.py.

◆ title

string examples.basics.look_ahead.title
Initial value:
1 = '''Demonstrate the use of the look ahead operators.
2 & - the positive look ahead operator
3  - succeeds on a specified phrase match
4 ! - the negative look ahead operator
5  - fails on a specified phrase match
6 '''

Definition at line 22 of file look_ahead.py.

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