Mercurial > lcfOS
diff python/pyyacc.py @ 180:25a0753da4cf
Re-organized files
author | Windel Bouwman |
---|---|
date | Thu, 09 May 2013 17:35:19 +0200 |
parents | 0f3b1adfd416 |
children | 216da5e46efc |
line wrap: on
line diff
--- a/python/pyyacc.py Sat May 04 18:50:36 2013 +0200 +++ b/python/pyyacc.py Thu May 09 17:35:19 2013 +0200 @@ -13,6 +13,21 @@ @property def Symbols(self): return self.nonterminals + self.terminals + def calcFollow(self): + follow = {} + for nt in self.nonterminals: + follow[nt] = set() + while True: + change = False + # 1. + for p in self.productions: + pass + if not change: + break + return follow + def calcFirst(self): + first = {} + return first class Production: def __init__(self, name, symbols):