diff options
author | David Walter Seikel | 2012-01-06 16:27:25 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-06 16:27:25 +1000 |
commit | e85ff16e367aaf3b0e68e6a79615496d179f85ca (patch) | |
tree | 91f7df33ee3d0247c7098bc5d0971b95a05a9712 /LuaSL/src/LuaSL_yaccer.y | |
parent | Add more debugging stuff. (diff) | |
download | SledjHamr-e85ff16e367aaf3b0e68e6a79615496d179f85ca.zip SledjHamr-e85ff16e367aaf3b0e68e6a79615496d179f85ca.tar.gz SledjHamr-e85ff16e367aaf3b0e68e6a79615496d179f85ca.tar.bz2 SledjHamr-e85ff16e367aaf3b0e68e6a79615496d179f85ca.tar.xz |
Even more debugging stuff, and make it selectable if the parser uses #defines or enums for tokens.
NOTE - enum does not work anyway with btyacc.
Diffstat (limited to 'LuaSL/src/LuaSL_yaccer.y')
-rw-r--r-- | LuaSL/src/LuaSL_yaccer.y | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/LuaSL/src/LuaSL_yaccer.y b/LuaSL/src/LuaSL_yaccer.y index 897a83e..414b5e9 100644 --- a/LuaSL/src/LuaSL_yaccer.y +++ b/LuaSL/src/LuaSL_yaccer.y | |||
@@ -2,6 +2,9 @@ | |||
2 | 2 | ||
3 | #include "LuaSL_LSL_tree.h" | 3 | #include "LuaSL_LSL_tree.h" |
4 | 4 | ||
5 | //extern char *yytext; | ||
6 | //#define YYDEBUG_LEXER_TEXT yytext | ||
7 | |||
5 | %} | 8 | %} |
6 | 9 | ||
7 | %define api.pure | 10 | %define api.pure |
@@ -25,9 +28,9 @@ input: | |||
25 | ; | 28 | ; |
26 | 29 | ||
27 | expr: | 30 | expr: |
28 | expr LSL_ADD expr { $$ = addOperation( LSL_ADD, $1, $3 ); } | 31 | LSL_PARENTHESIS_OPEN expr LSL_PARENTHESIS_CLOSE { $$ = $2; } |
29 | | expr LSL_MULTIPLY expr { $$ = addOperation( LSL_MULTIPLY, $1, $3 ); } | 32 | | expr LSL_MULTIPLY expr { $$ = addOperation( LSL_MULTIPLY, $1, $3 ); } |
30 | | LSL_PARENTHESIS_OPEN expr LSL_PARENTHESIS_CLOSE { $$ = $2; } | 33 | | expr LSL_ADD expr { $$ = addOperation( LSL_ADD, $1, $3 ); } |
31 | | LSL_INTEGER { $$ = addInteger($1); } | 34 | | LSL_INTEGER { $$ = addInteger($1); } |
32 | ; | 35 | ; |
33 | 36 | ||