diff options
author | David Walter Seikel | 2012-01-06 04:51:33 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-06 04:51:33 +1000 |
commit | 14cfc7d0932dd67bfcd980776049e652fee4a5f4 (patch) | |
tree | 2503e81a8fef238f672249ab12e34edd8773644f /LuaSL/src/LuaSL_yaccer.y | |
parent | Update the not yet used real parser includes to. (diff) | |
download | SledjHamr-14cfc7d0932dd67bfcd980776049e652fee4a5f4.zip SledjHamr-14cfc7d0932dd67bfcd980776049e652fee4a5f4.tar.gz SledjHamr-14cfc7d0932dd67bfcd980776049e652fee4a5f4.tar.bz2 SledjHamr-14cfc7d0932dd67bfcd980776049e652fee4a5f4.tar.xz |
Add more LSL parsing structure.
Diffstat (limited to 'LuaSL/src/LuaSL_yaccer.y')
-rw-r--r-- | LuaSL/src/LuaSL_yaccer.y | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/LuaSL/src/LuaSL_yaccer.y b/LuaSL/src/LuaSL_yaccer.y index 19009bf..820f7da 100644 --- a/LuaSL/src/LuaSL_yaccer.y +++ b/LuaSL/src/LuaSL_yaccer.y | |||
@@ -14,21 +14,21 @@ | |||
14 | %token TOKEN_PLUS | 14 | %token TOKEN_PLUS |
15 | %token TOKEN_MULTIPLY | 15 | %token TOKEN_MULTIPLY |
16 | 16 | ||
17 | %token <value> TOKEN_NUMBER | 17 | %token <integerValue> TOKEN_NUMBER |
18 | 18 | ||
19 | %type <expression> expr | 19 | %type <expressionValue> expr |
20 | 20 | ||
21 | %% | 21 | %% |
22 | 22 | ||
23 | input: | 23 | input: |
24 | expr { ((SParserParam*)data)->expression = $1; } | 24 | expr { ((LuaSL_yyparseParam*)data)->expression = $1; } |
25 | ; | 25 | ; |
26 | 26 | ||
27 | expr: | 27 | expr: |
28 | expr TOKEN_PLUS expr { $$ = createOperation( ePLUS, $1, $3 ); } | 28 | expr TOKEN_PLUS expr { $$ = addOperation( LSL_ADD, $1, $3 ); } |
29 | | expr TOKEN_MULTIPLY expr { $$ = createOperation( eMULTIPLY, $1, $3 ); } | 29 | | expr TOKEN_MULTIPLY expr { $$ = addOperation( LSL_MULTIPLY, $1, $3 ); } |
30 | | TOKEN_LPAREN expr TOKEN_RPAREN { $$ = $2; } | 30 | | TOKEN_LPAREN expr TOKEN_RPAREN { $$ = $2; } |
31 | | TOKEN_NUMBER { $$ = createNumber($1); } | 31 | | TOKEN_NUMBER { $$ = addInteger($1); } |
32 | ; | 32 | ; |
33 | 33 | ||
34 | %% | 34 | %% |