Version 1.0
Copyright © 2022 Lowell D. Thomas
Python APG
 … an ABNF Parser Generator
Namespaces | Variables
parsing_basics.py File Reference

Simple construction of a grammar object and parser. More...

Go to the source code of this file.

Namespaces

 examples.basics.parsing_basics
 

Variables

string examples.basics.parsing_basics.title
 
string examples.basics.parsing_basics.abnf_syntax = 'S = "a" S / "y"\n'
 
string examples.basics.parsing_basics.abnf_syntax_strict = 'S = "a" S / "y"\r\n'
 
string examples.basics.parsing_basics.input_string = 'aaay'
 
 examples.basics.parsing_basics.api = Api()
 
 examples.basics.parsing_basics.grammar = api.generate(abnf_syntax)
 
 examples.basics.parsing_basics.parser = Parser(grammar)
 
 examples.basics.parsing_basics.result = parser.parse(utils.string_to_tuple(input_string))
 

Detailed Description

Simple construction of a grammar object and parser.

A simple demonstration of the basics. Generate a grammar object from an ABNF grammar syntax, then use that object to parse an input string that matches the grammar.

Definition in file parsing_basics.py.

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