Horizon
Loading...
Searching...
No Matches
pybis.Parse Class Reference
Inheritance diagram for pybis.Parse:
pybis.Bracket pybis.Header pybis.IBISCommon pybis.Param pybis.Comment pybis.End pybis.Keyword pybis.Section pybis.Text pybis.EBD pybis.IBS pybis.PKG pybis.DictParam pybis.RangeDictParam pybis.RangeParam

Public Member Functions

 __init__ (self, key, pyparser=None, default=None, initvalue=None, data_name=None, list_merge=False, asList=False, asDict=False, required=False)
 add (self, obj)
 __iadd__ (self, obj)
 get_globals (self)
 find_parser (self, text)
 can_parse (self, text)
 initial (self, text, comment)
 parse (self, node, text, comment)
 pyparse (self, text)
 fin (self, node)
 pop (self, new, name)
 flatten (self, new)
 merge (self, orig, new)

Public Attributes

 key = key
 flat_key = key.replace(' ', '_').lower()
 data_name = data_name
 default = default
 initvalue = initvalue
 pyparser = pyparser
 list_merge = list_merge
 asList = asList
 asDict = asDict
 children = OrderedDict()
 parent = None
 globals = None
 required = required

Detailed Description

Base pybis Parse object.

Constructor & Destructor Documentation

◆ __init__()

pybis.Parse.__init__ ( self,
key,
pyparser = None,
default = None,
initvalue = None,
data_name = None,
list_merge = False,
asList = False,
asDict = False,
required = False )
key:         Name of element.
   pyparser:    Parser to call with pyparse
   default:     Default value of object if not found
   initvalue:   Default value of object on first merge
   data_name:   Make the data of this node a child with name 'data_name'
   list_merge:  Merge multiple copies together as list
   asList:      Interpret pyparse results as a list
   asDict:      Interpret pyparse results as a dict
   required:    raise Exception if not found

Member Function Documentation

◆ can_parse()

pybis.Parse.can_parse ( self,
text )
True if we can parse 'text'.

Reimplemented in pybis.Bracket, and pybis.Param.

◆ fin()

◆ find_parser()

pybis.Parse.find_parser ( self,
text )
Find a child parser that can parse 'text'.

◆ flatten()

pybis.Parse.flatten ( self,
new )
Reformat pyparse results as what we'd expect.

Reimplemented in pybis.DictParam, pybis.RangeDictParam, pybis.RangeParam, pybis.RangeSection, pybis.Series_MOSFET, and pybis.Text.

◆ get_globals()

pybis.Parse.get_globals ( self)
Get the global parse object, for things that are parseable in all contexts.

◆ initial()

pybis.Parse.initial ( self,
text,
comment )
Parse the first line of text and return a Node object.

Reimplemented in pybis.Bracket, pybis.Comment, pybis.End, pybis.Keyword, pybis.Param, pybis.RangeSection, pybis.Section, pybis.TableSection, pybis.Text, and pybis.TokenizeSection.

◆ merge()

pybis.Parse.merge ( self,
orig,
new )
Merge two instances of the same parser under one parent.

Reimplemented in pybis.DictParam, pybis.RangeDictParam, pybis.RangeParam, and pybis.Text.

◆ parse()

pybis.Parse.parse ( self,
node,
text,
comment )
Parse a subsequent line of text, False means we can't.

Reimplemented in pybis.DictSection, pybis.ListSection, pybis.RangeSection, pybis.TableSection, pybis.Text, and pybis.TokenizeSection.

◆ pop()

pybis.Parse.pop ( self,
new,
name )
Remove 'name' from ParseResults 'new'.

◆ pyparse()

pybis.Parse.pyparse ( self,
text )
Use self.pyparser to parse 'text', returns parse tokens.
   Returns 'text' if there is no pyparser object.

The documentation for this class was generated from the following file: