Version 1.0
Copyright © 2022 Lowell D. Thomas
Python APG
 … an ABNF Parser Generator
Public Member Functions | Public Attributes | List of all members
apg_py.lib.trace.Trace Class Reference

Class for tracing and displaying the progress of the parser through the parse tree. More...

Public Member Functions

def __init__ (self, parser, fname=None, mode='dc', line_max=32)
 
def __del__ (self)
 Destructor for ensuring that the output file is closed, if any. More...
 
def finish (self)
 Guarantee that the output file is flushed. More...
 
def set_display_length (self, max_len)
 Set the maximum trace line display length in characters. More...
 
def indent (self, n)
 For internal use only. More...
 
def traceALT (self, op)
 For internal use only. More...
 
def traceCAT (self, op)
 For internal use only. More...
 
def traceREP (self, op)
 For internal use only. More...
 
def traceRNM (self, op)
 For internal use only. More...
 
def traceUDT (self, op)
 For internal use only. More...
 
def traceTLS (self, op)
 For internal use only. More...
 
def traceTBS (self, op)
 For internal use only. More...
 
def traceTRG (self, op)
 For internal use only. More...
 
def traceAND (self, op)
 For internal use only. More...
 
def traceNOT (self, op)
 For internal use only. More...
 
def traceBKR (self, op)
 For internal use only. More...
 
def traceBKA (self, op)
 For internal use only. More...
 
def traceBKN (self, op)
 For internal use only. More...
 
def traceABG (self, op)
 For internal use only. More...
 
def traceAEN (self, op)
 For internal use only. More...
 
def phrasex (self, phrase)
 For internal use only. More...
 
def phrasexc (self, phrase)
 For internal use only. More...
 
def phrased (self, phrase)
 For internal use only. More...
 
def phrasedc (self, phrase)
 For internal use only. More...
 
def down (self, op)
 For internal use only. More...
 
def up (self, op, begin_index)
 For internal use only. More...
 

Public Attributes

 file
 
 mode
 
 parser
 
 line_max
 
 selectOp
 
 select_mode
 

Detailed Description

Class for tracing and displaying the progress of the parser through the parse tree.

The Trace class has a copy of the Parser class and knows how to use it. Therefore, Trace and Parser need to remain in sync throughout development.

Definition at line 15 of file trace.py.

Constructor & Destructor Documentation

◆ __init__()

def apg_py.lib.trace.Trace.__init__ (   self,
  parser,
  fname = None,
  mode = 'dc',
  line_max = 32 
)
Parameters
parserThe parser to trace.
fnameIf present, the file name to write the trace to.
modeThe display mode.
  • 'x' Display characters as hexadecimal digits. e.g. x2e.
  • 'xc' Display all characters 32-127 as ASCII characters, otherwise use hexadecimal digit display.
  • 'd' Display characters as decimal digits. e.g. 32.
  • 'dc' (default) Display all characters 32-127 as ASCII characters, otherwise use decimal digit display.
line_maxThe maximum line length in characters for any trace line.

Definition at line 22 of file trace.py.

◆ __del__()

def apg_py.lib.trace.Trace.__del__ (   self)

Destructor for ensuring that the output file is closed, if any.

Definition at line 69 of file trace.py.

Member Function Documentation

◆ down()

def apg_py.lib.trace.Trace.down (   self,
  op 
)

For internal use only.

Definition at line 237 of file trace.py.

◆ finish()

def apg_py.lib.trace.Trace.finish (   self)

Guarantee that the output file is flushed.

Definition at line 76 of file trace.py.

◆ indent()

def apg_py.lib.trace.Trace.indent (   self,
  n 
)

For internal use only.

Definition at line 87 of file trace.py.

◆ phrased()

def apg_py.lib.trace.Trace.phrased (   self,
  phrase 
)

For internal use only.

Definition at line 207 of file trace.py.

◆ phrasedc()

def apg_py.lib.trace.Trace.phrasedc (   self,
  phrase 
)

For internal use only.

Definition at line 218 of file trace.py.

◆ phrasex()

def apg_py.lib.trace.Trace.phrasex (   self,
  phrase 
)

For internal use only.

Definition at line 177 of file trace.py.

◆ phrasexc()

def apg_py.lib.trace.Trace.phrasexc (   self,
  phrase 
)

For internal use only.

Definition at line 188 of file trace.py.

◆ set_display_length()

def apg_py.lib.trace.Trace.set_display_length (   self,
  max_len 
)

Set the maximum trace line display length in characters.

Parameters
max_lenThe maximum number of characters to display on a line.

Definition at line 81 of file trace.py.

◆ traceABG()

def apg_py.lib.trace.Trace.traceABG (   self,
  op 
)

For internal use only.

Definition at line 169 of file trace.py.

◆ traceAEN()

def apg_py.lib.trace.Trace.traceAEN (   self,
  op 
)

For internal use only.

Definition at line 173 of file trace.py.

◆ traceALT()

def apg_py.lib.trace.Trace.traceALT (   self,
  op 
)

For internal use only.

Definition at line 94 of file trace.py.

◆ traceAND()

def apg_py.lib.trace.Trace.traceAND (   self,
  op 
)

For internal use only.

Definition at line 143 of file trace.py.

◆ traceBKA()

def apg_py.lib.trace.Trace.traceBKA (   self,
  op 
)

For internal use only.

Definition at line 161 of file trace.py.

◆ traceBKN()

def apg_py.lib.trace.Trace.traceBKN (   self,
  op 
)

For internal use only.

Definition at line 165 of file trace.py.

◆ traceBKR()

def apg_py.lib.trace.Trace.traceBKR (   self,
  op 
)

For internal use only.

Definition at line 151 of file trace.py.

◆ traceCAT()

def apg_py.lib.trace.Trace.traceCAT (   self,
  op 
)

For internal use only.

Definition at line 98 of file trace.py.

◆ traceNOT()

def apg_py.lib.trace.Trace.traceNOT (   self,
  op 
)

For internal use only.

Definition at line 147 of file trace.py.

◆ traceREP()

def apg_py.lib.trace.Trace.traceREP (   self,
  op 
)

For internal use only.

Definition at line 102 of file trace.py.

◆ traceRNM()

def apg_py.lib.trace.Trace.traceRNM (   self,
  op 
)

For internal use only.

Definition at line 107 of file trace.py.

◆ traceTBS()

def apg_py.lib.trace.Trace.traceTBS (   self,
  op 
)

For internal use only.

Definition at line 128 of file trace.py.

◆ traceTLS()

def apg_py.lib.trace.Trace.traceTLS (   self,
  op 
)

For internal use only.

Definition at line 117 of file trace.py.

◆ traceTRG()

def apg_py.lib.trace.Trace.traceTRG (   self,
  op 
)

For internal use only.

Definition at line 139 of file trace.py.

◆ traceUDT()

def apg_py.lib.trace.Trace.traceUDT (   self,
  op 
)

For internal use only.

Definition at line 112 of file trace.py.

◆ up()

def apg_py.lib.trace.Trace.up (   self,
  op,
  begin_index 
)

For internal use only.

Definition at line 263 of file trace.py.

Member Data Documentation

◆ file

apg_py.lib.trace.Trace.file

Definition at line 36 of file trace.py.

◆ line_max

apg_py.lib.trace.Trace.line_max

Definition at line 44 of file trace.py.

◆ mode

apg_py.lib.trace.Trace.mode

Definition at line 39 of file trace.py.

◆ parser

apg_py.lib.trace.Trace.parser

Definition at line 40 of file trace.py.

◆ select_mode

apg_py.lib.trace.Trace.select_mode

Definition at line 62 of file trace.py.

◆ selectOp

apg_py.lib.trace.Trace.selectOp

Definition at line 45 of file trace.py.


The documentation for this class was generated from the following file:
Python APG, Version 1.0, is licensed under the 2-Clause BSD License,
an Open Source Initiative Approved License.