Commit acd32316 authored by Fabrice Salvaire's avatar Fabrice Salvaire

cleanup

parent b35f27c1
...@@ -78,10 +78,12 @@ class GcodeLexer: ...@@ -78,10 +78,12 @@ class GcodeLexer:
'TANGENT', 'TANGENT',
'TIMES', 'TIMES',
# 'LETTER',
'A', 'B', 'C', 'D', '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', 'P', 'Q', 'R', 'S', 'T',
'X', 'Y', 'Z', 'X', 'Y', 'Z',
'N',
'POSITIVE_INTEGER', 'POSITIVE_INTEGER',
'POSITIVE_REAL', 'POSITIVE_REAL',
...@@ -121,6 +123,9 @@ class GcodeLexer: ...@@ -121,6 +123,9 @@ class GcodeLexer:
t_TANGENT = r'tan' t_TANGENT = r'tan'
t_TIMES = r'\*' t_TIMES = r'\*'
# clash with acos ... ???
# t_LETTER = r'(' + '|'.join('abcd' + 'fghijklm' + 'pqrst' + 'xyz') + ')'
t_A = r'a' t_A = r'a'
T_B = r'b' T_B = r'b'
t_C = r'c' t_C = r'c'
...@@ -134,7 +139,6 @@ class GcodeLexer: ...@@ -134,7 +139,6 @@ class GcodeLexer:
t_K = r'k' t_K = r'k'
t_L = r'l' t_L = r'l'
t_M = r'm' t_M = r'm'
t_N = r'n'
t_P = r'p' t_P = r'p'
t_Q = r'q' t_Q = r'q'
...@@ -146,6 +150,8 @@ class GcodeLexer: ...@@ -146,6 +150,8 @@ class GcodeLexer:
t_Y = r'y' t_Y = r'y'
t_Z = r'z' t_Z = r'z'
t_N = r'n'
# def t_POSITIVE_INTEGER(self, t): # def t_POSITIVE_INTEGER(self, t):
# r'\d+' # r'\d+'
# t.value = int(t.value) # t.value = int(t.value)
......
...@@ -174,6 +174,7 @@ class GcodeParser: ...@@ -174,6 +174,7 @@ class GcodeParser:
p[0] = Ast.Word(p[1], p[2]) p[0] = Ast.Word(p[1], p[2])
def p_mid_line_letter(self, p): def p_mid_line_letter(self, p):
# LETTER
'''mid_line_letter : A '''mid_line_letter : A
| B | B
| C | C
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment