Back to index

enigmail  1.4.3
Public Member Functions | Public Attributes | Static Public Attributes
ply.yacc.Production Class Reference

List of all members.

Public Member Functions

def __init__
def __str__
def __repr__
def __len__
def __nonzero__
def __getitem__
def lr_item
def bind

Public Attributes

 name
 prod
 number
 func
 callable
 file
 line
 prec
 len
 usyms
 lr_items
 lr_next
 str

Static Public Attributes

int reduced = 0

Detailed Description

Definition at line 1152 of file yacc.py.


Constructor & Destructor Documentation

def ply.yacc.Production.__init__ (   self,
  number,
  name,
  prod,
  precedence = ('right',0,
  func = None,
  file = '',
  line = 0 
)

Definition at line 1154 of file yacc.py.

01154 
01155     def __init__(self,number,name,prod,precedence=('right',0),func=None,file='',line=0):
01156         self.name     = name
01157         self.prod     = tuple(prod)
01158         self.number   = number
01159         self.func     = func
01160         self.callable = None
01161         self.file     = file
01162         self.line     = line
01163         self.prec     = precedence
01164 
01165         # Internal settings used during table construction
01166         
01167         self.len  = len(self.prod)   # Length of the production
01168 
01169         # Create a list of unique production symbols used in the production
01170         self.usyms = [ ]             
01171         for s in self.prod:
01172             if s not in self.usyms:
01173                 self.usyms.append(s)
01174 
01175         # List of all LR items for the production
01176         self.lr_items = []
01177         self.lr_next = None
01178 
01179         # Create a string representation
01180         if self.prod:
01181             self.str = "%s -> %s" % (self.name," ".join(self.prod))
01182         else:
01183             self.str = "%s -> <empty>" % self.name


Member Function Documentation

def ply.yacc.Production.__getitem__ (   self,
  index 
)

Definition at line 1196 of file yacc.py.

01196 
01197     def __getitem__(self,index):
01198         return self.prod[index]
            

Definition at line 1190 of file yacc.py.

01190 
01191     def __len__(self):
01192         return len(self.prod)

Definition at line 1193 of file yacc.py.

01193 
01194     def __nonzero__(self):
01195         return 1

Definition at line 1187 of file yacc.py.

01187 
01188     def __repr__(self):
01189         return "Production("+str(self)+")"

Definition at line 1184 of file yacc.py.

01184 
01185     def __str__(self):
01186         return self.str

def ply.yacc.Production.bind (   self,
  pdict 
)

Definition at line 1217 of file yacc.py.

01217 
01218     def bind(self,pdict):
01219         if self.func:
01220             self.callable = pdict[self.func]
01221 
01222 # This class serves as a minimal standin for Production objects when
01223 # reading table data from files.   It only contains information
01224 # actually used by the LR parsing engine, plus some additional
# debugging information.
def ply.yacc.Production.lr_item (   self,
  n 
)

Definition at line 1200 of file yacc.py.

01200 
01201     def lr_item(self,n):
01202         if n > len(self.prod): return None
01203         p = LRItem(self,n)
01204 
01205         # Precompute the list of productions immediately following.  Hack. Remove later
01206         try:
01207             p.lr_after = Prodnames[p.prod[n+1]]
01208         except (IndexError,KeyError):
01209             p.lr_after = []
01210         try:
01211             p.lr_before = p.prod[n-1]
01212         except IndexError:
01213             p.lr_before = None
01214 
01215         return p
    

Member Data Documentation

Definition at line 1159 of file yacc.py.

Definition at line 1160 of file yacc.py.

Definition at line 1158 of file yacc.py.

Definition at line 1166 of file yacc.py.

Definition at line 1161 of file yacc.py.

Definition at line 1175 of file yacc.py.

Definition at line 1176 of file yacc.py.

Definition at line 1155 of file yacc.py.

Definition at line 1157 of file yacc.py.

Definition at line 1162 of file yacc.py.

Definition at line 1156 of file yacc.py.

int ply.yacc.Production.reduced = 0 [static]

Definition at line 1153 of file yacc.py.

Definition at line 1180 of file yacc.py.

Definition at line 1169 of file yacc.py.


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