diff --git a/PythonicGcodeMachine/Gcode/Rs274/Lexer.py b/PythonicGcodeMachine/Gcode/Rs274/Lexer.py index ab888cd5aa6378ebfe74fecdc17bec4c626547ab..a161d876d361b7c385d54562afcd757188c3d467 100644 --- a/PythonicGcodeMachine/Gcode/Rs274/Lexer.py +++ b/PythonicGcodeMachine/Gcode/Rs274/Lexer.py @@ -78,10 +78,12 @@ class GcodeLexer: 'TANGENT', 'TIMES', + # 'LETTER', 'A', 'B', 'C', 'D', - 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'P', 'Q', 'R', 'S', 'T', 'X', 'Y', 'Z', + 'N', 'POSITIVE_INTEGER', 'POSITIVE_REAL', @@ -121,6 +123,9 @@ class GcodeLexer: t_TANGENT = r'tan' t_TIMES = r'\*' + # clash with acos ... ??? + # t_LETTER = r'(' + '|'.join('abcd' + 'fghijklm' + 'pqrst' + 'xyz') + ')' + t_A = r'a' T_B = r'b' t_C = r'c' @@ -134,7 +139,6 @@ class GcodeLexer: t_K = r'k' t_L = r'l' t_M = r'm' - t_N = r'n' t_P = r'p' t_Q = r'q' @@ -146,6 +150,8 @@ class GcodeLexer: t_Y = r'y' t_Z = r'z' + t_N = r'n' + # def t_POSITIVE_INTEGER(self, t): # r'\d+' # t.value = int(t.value) diff --git a/PythonicGcodeMachine/Gcode/Rs274/Parser.py b/PythonicGcodeMachine/Gcode/Rs274/Parser.py index 2b4378e18bc41b3d9d93eedaf937fefda30a90b7..7d47cad21485daabdcd86595ce96f097620bdce9 100644 --- a/PythonicGcodeMachine/Gcode/Rs274/Parser.py +++ b/PythonicGcodeMachine/Gcode/Rs274/Parser.py @@ -174,6 +174,7 @@ class GcodeParser: p[0] = Ast.Word(p[1], p[2]) def p_mid_line_letter(self, p): + # LETTER '''mid_line_letter : A | B | C