diff options
Diffstat (limited to 'LuaSL/src/LuaSL_yaccer.y')
-rw-r--r-- | LuaSL/src/LuaSL_yaccer.y | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/LuaSL/src/LuaSL_yaccer.y b/LuaSL/src/LuaSL_yaccer.y index 820f7da..897a83e 100644 --- a/LuaSL/src/LuaSL_yaccer.y +++ b/LuaSL/src/LuaSL_yaccer.y | |||
@@ -6,15 +6,15 @@ | |||
6 | 6 | ||
7 | %define api.pure | 7 | %define api.pure |
8 | 8 | ||
9 | %left '+' TOKEN_PLUS | 9 | %left '+' LSL_ADD |
10 | %left '*' TOKEN_MULTIPLY | 10 | %left '*' LSL_MULTIPLY |
11 | 11 | ||
12 | %token TOKEN_LPAREN | 12 | %token LSL_PARENTHESIS_OPEN |
13 | %token TOKEN_RPAREN | 13 | %token LSL_PARENTHESIS_CLOSE |
14 | %token TOKEN_PLUS | 14 | %token LSL_ADD |
15 | %token TOKEN_MULTIPLY | 15 | %token LSL_MULTIPLY |
16 | 16 | ||
17 | %token <integerValue> TOKEN_NUMBER | 17 | %token <integerValue> LSL_INTEGER |
18 | 18 | ||
19 | %type <expressionValue> expr | 19 | %type <expressionValue> expr |
20 | 20 | ||
@@ -25,10 +25,10 @@ input: | |||
25 | ; | 25 | ; |
26 | 26 | ||
27 | expr: | 27 | expr: |
28 | expr TOKEN_PLUS expr { $$ = addOperation( LSL_ADD, $1, $3 ); } | 28 | expr LSL_ADD expr { $$ = addOperation( LSL_ADD, $1, $3 ); } |
29 | | expr TOKEN_MULTIPLY expr { $$ = addOperation( LSL_MULTIPLY, $1, $3 ); } | 29 | | expr LSL_MULTIPLY expr { $$ = addOperation( LSL_MULTIPLY, $1, $3 ); } |
30 | | TOKEN_LPAREN expr TOKEN_RPAREN { $$ = $2; } | 30 | | LSL_PARENTHESIS_OPEN expr LSL_PARENTHESIS_CLOSE { $$ = $2; } |
31 | | TOKEN_NUMBER { $$ = addInteger($1); } | 31 | | LSL_INTEGER { $$ = addInteger($1); } |
32 | ; | 32 | ; |
33 | 33 | ||
34 | %% | 34 | %% |