From 8d61bcdc39c807f4238d24c10f54b56305365a8d Mon Sep 17 00:00:00 2001 From: Fabrice Salvaire Date: Tue, 25 Dec 2018 13:25:19 +0100 Subject: [PATCH] Parser: changed lextab parsetab name --- .gitignore | 2 ++ PythonicGcodeMachine/Gcode/Rs274/Lexer.py | 1 + PythonicGcodeMachine/Gcode/Rs274/Parser.py | 8 ++++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 4bafa79..910ab9f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ # Build files __pycache__ +_lextab.py +_parsetab.py lextab.py parser.out parsetab.py diff --git a/PythonicGcodeMachine/Gcode/Rs274/Lexer.py b/PythonicGcodeMachine/Gcode/Rs274/Lexer.py index 9d23f78..96778ca 100644 --- a/PythonicGcodeMachine/Gcode/Rs274/Lexer.py +++ b/PythonicGcodeMachine/Gcode/Rs274/Lexer.py @@ -222,6 +222,7 @@ class GcodeLexerMixin: module=self, reflags=int(re.VERBOSE + re.IGNORECASE), optimize=1, + lextab='_lextab', **kwargs, ) diff --git a/PythonicGcodeMachine/Gcode/Rs274/Parser.py b/PythonicGcodeMachine/Gcode/Rs274/Parser.py index f35b280..7db6675 100644 --- a/PythonicGcodeMachine/Gcode/Rs274/Parser.py +++ b/PythonicGcodeMachine/Gcode/Rs274/Parser.py @@ -54,6 +54,8 @@ __all__ = [ #################################################################################################### +from pathlib import Path + # https://rply.readthedocs.io/en/latest/ from ply import yacc @@ -367,8 +369,10 @@ class GcodeParserMixin: self.tokens = self._lexer.tokens self._parser = yacc.yacc( module=self, - # debug=True, - optimize=0, + debug=False, + optimize=1, + tabmodule='_parsetab', + # outputdir=Path(__file__).parent.joinpath('ply'), ) ############################################## -- GitLab