Mercurial > lcfOS
diff python/yacc.py @ 323:e9fe6988497c
Used burg for generating expressions
author | Windel Bouwman |
---|---|
date | Thu, 30 Jan 2014 19:03:24 +0100 |
parents | 44f336460c2a |
children | 6f4753202b9a |
line wrap: on
line diff
--- a/python/yacc.py Mon Jan 27 19:58:07 2014 +0100 +++ b/python/yacc.py Thu Jan 30 19:03:24 2014 +0100 @@ -41,6 +41,7 @@ import datetime import types import io +import logging from pyyacc import Grammar, print_grammar @@ -201,12 +202,13 @@ class XaccGenerator: """ Generator that writes generated parser to file """ def __init__(self): - pass + self.logger = logging.getLogger('yacc') def generate(self, grammar, headers, output_file): self.output_file = output_file self.grammar = grammar self.headers = headers + self.logger.info('Generating parser for grammar {}'.format(grammar)) self.action_table, self.goto_table = grammar.doGenerate() self.generate_python_script()