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

Demonstrates how to display a trace of the parser's path through the parse tree. More...

Go to the source code of this file.

Namespaces

 examples.basics.trace
 

Variables

string examples.basics.trace.title
 
string examples.basics.trace.float
 
string examples.basics.trace.bad_float
 
 examples.basics.trace.api = Api()
 
 examples.basics.trace.grammar = api.generate(float)
 
 examples.basics.trace.parser = Parser(grammar)
 
 examples.basics.trace.trace = Trace(parser, mode='dc')
 
string examples.basics.trace.input_string = '-123,456789E-10'
 
 examples.basics.trace.result = parser.parse(utils.string_to_tuple(input_string))
 
 examples.basics.trace.end
 

Detailed Description

Demonstrates how to display a trace of the parser's path through the parse tree.

Tracing my generate a lot of output. It may be advantagous to pipe stdout to an alternate location for more casual perusal. For example, if using linux:

python3 examples/basics/trace.py | less

or

python3 examples/basics/trace.py > /tmp/trace
vi /tmp/trace

Definition in file trace.py.

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