Home | History | Annotate | Download | only in ply

Lines Matching full:prod

287         prod    = self.productions       # Local reference to production list (to avoid lookup on self.)
378 p = prod[-t]
602 prod = self.productions # Local reference to production list (to avoid lookup on self.)
675 p = prod[-t]
874 prod = self.productions # Local reference to production list (to avoid lookup on self.)
947 p = prod[-t]
1139 # prod - A list of symbols on the right side ['expr','PLUS','term']
1154 def __init__(self,number,name,prod,precedence=('right',0),func=None,file='',line=0):
1156 self.prod = tuple(prod)
1166 self.len = len(self.prod) # Length of the production
1170 for s in self.prod:
1179 if self.prod:
1180 self.str = "%s -> %s" % (self.name," ".join(self.prod))
1191 return len(self.prod)
1197 return self.prod[index]
1201 if n > len(self.prod
1206 p.lr_after = Prodnames[p.prod[n+1]]
1210 p.lr_before = p.prod[n-1]
1257 # prod - A list of symbols on the right side ['expr','.', 'PLUS','term']
1262 # lr_index - LR item index (location of the ".") in the prod list.
1272 self.prod = list(p.prod)
1276 self.prod.insert(n,".")
1277 self.prod = tuple(self.prod)
1278 self.len = len(self.prod)
1282 if self.prod:
1283 s = "%s -> %s" % (self.name," ".join(self.prod))
1498 for r in p.prod:
1505 mark_reachable_from( self.Productions[0].prod[0] )
1540 for s in p.prod:
1580 # grammar rules. Returns a list of tuples (sym, prod) where sym in the symbol
1581 # and prod is the production where the symbol was used.
1588 for s in p.prod:
1702 for f in self._first(p.prod):
1740 for i in range(len(p.prod)):
1741 B = p.prod[i]
1744 fst = self._first(p.prod[i+1:])
1752 if hasempty or i == (len(p.prod)-1):
1789 lri.lr_after = self.Prodnames[lri.prod[i+1]]
1793 lri.lr_before = lri.prod[i-1]
2101 for t in p.prod:
2125 t = (state,p.prod[p.lr_index+1])
2148 a = p.prod[p.lr_index+1]
2153 if state == 0 and N == self.grammar.Productions[0].prod[0]:
2173 a = p.prod[p.lr_index + 1]
2231 t = p.prod[lr_index]
2241 if p.prod[li] in self.grammar.Terminals: break # No forget it
2242 if not p.prod[li] in nullable: break
2258 if r.prod[i] != p.prod[i+1]: break
2457 a = p.prod[i+1] # Get symbol right after the "."
3144 for sym, prod in undefined_symbols:
3145 errorlog.error("%s:%d: Symbol '%s' used, but not defined as a token or a rule",prod.file,prod.line,sym)
3167 for prod in unused_rules:
3168 errorlog.warning("%s:%d: Rule '%s' defined, but not used", prod.file, prod.line, prod.name)