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.api.api.Api.NameList Class Reference

A helper class to keep track of rule and UDT names. More...

Public Member Functions

def __init__ (self)
 
def add (self, name)
 Add a name to the list. More...
 
def get (self, name)
 Retrieve a name from the list. More...
 

Public Attributes

 names
 

Detailed Description

A helper class to keep track of rule and UDT names.

Maintains a list of rule/UDT names, the lower case for easy comparisons and the rule/UDT index for the name.

Definition at line 66 of file api.py.

Constructor & Destructor Documentation

◆ __init__()

def apg_py.api.api.Api.NameList.__init__ (   self)

Definition at line 72 of file api.py.

Member Function Documentation

◆ add()

def apg_py.api.api.Api.NameList.add (   self,
  name 
)

Add a name to the list.

Parameters
nameThe name to add.
Returns
Returns the saved dictionary with the name, lower case name and the matching index. Returns -1 if the name already exists in the list.

Definition at line 75 of file api.py.

◆ get()

def apg_py.api.api.Api.NameList.get (   self,
  name 
)

Retrieve a name from the list.

Parameters
nameThe name to retrieve.
Returns
Returns the saved dictionary if the name is in the list. Returns -1 if the name does not exist in the list.

Definition at line 95 of file api.py.

Member Data Documentation

◆ names

apg_py.api.api.Api.NameList.names

Definition at line 73 of file api.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.