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.stats.Stats Class Reference

Public Member Functions

def __init__ (self, parser)
 Class constructor. More...
 
def clear (self)
 For internal use. More...
 
def total (self, stat)
 For internal use. More...
 
def collect (self, op)
 Called by the parser for each node to collect the hit count. More...
 
def display (self)
 Display the parse tree node hit statistics. More...
 

Public Attributes

 parser
 
 stats
 
 rule_stats
 
 names
 

Detailed Description

Definition at line 5 of file stats.py.

Constructor & Destructor Documentation

◆ __init__()

def apg_py.lib.stats.Stats.__init__ (   self,
  parser 
)

Class constructor.

Parameters
parserthe parser object to attach this Stats object to

Definition at line 6 of file stats.py.

Member Function Documentation

◆ clear()

def apg_py.lib.stats.Stats.clear (   self)

For internal use.

Called here and by the parser to initialize the hit counts.

Definition at line 20 of file stats.py.

◆ collect()

def apg_py.lib.stats.Stats.collect (   self,
  op 
)

Called by the parser for each node to collect the hit count.

Definition at line 46 of file stats.py.

◆ display()

def apg_py.lib.stats.Stats.display (   self)

Display the parse tree node hit statistics.

It will first display the node statistics for the various node operators. It then displays the rule name and UDT name statistics. Operators and rule/UDT names for which the hit count is 0 are not displayed.

Definition at line 57 of file stats.py.

◆ total()

def apg_py.lib.stats.Stats.total (   self,
  stat 
)

For internal use.

Computes the total number of hits.

Definition at line 42 of file stats.py.

Member Data Documentation

◆ names

apg_py.lib.stats.Stats.names

Definition at line 13 of file stats.py.

◆ parser

apg_py.lib.stats.Stats.parser

Definition at line 9 of file stats.py.

◆ rule_stats

apg_py.lib.stats.Stats.rule_stats

Definition at line 12 of file stats.py.

◆ stats

apg_py.lib.stats.Stats.stats

Definition at line 11 of file stats.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.