コード例 #1
0
ファイル: plyplus.py プロジェクト: SrikanthKrish/plyplus
    def visit(self, tree):
        CollectTokenDefs_Visitor(self.tokendefs).visit(tree)
        SVisitor.visit(self, tree)

        for tokendef in self.tokendefs.itervalues():
            self._simplify_token(tokendef)

        return self.tokendefs
コード例 #2
0
ファイル: plyplus.py プロジェクト: SrikanthKrish/plyplus
 def _visit(self, tree):
     "_visit simplifies the tree as much as possible"
     # visit until nothing left to change (not the most efficient, but good enough since it's only the grammar)
     while SVisitor._visit(self, tree):
         pass