From 8b6c0f0960aaf4b886d0004105df886e3d3c22e7 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Fri, 6 Jan 2012 14:06:47 +1000 Subject: Use the LSL_ enums for parser tokens. Some clean up and debugging. OK, so the parsers prefer to make them defines instead of enums. sigh --- LuaSL/src/LuaSL_yaccer.y | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'LuaSL/src/LuaSL_yaccer.y') 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 @@ %define api.pure -%left '+' TOKEN_PLUS -%left '*' TOKEN_MULTIPLY +%left '+' LSL_ADD +%left '*' LSL_MULTIPLY -%token TOKEN_LPAREN -%token TOKEN_RPAREN -%token TOKEN_PLUS -%token TOKEN_MULTIPLY +%token LSL_PARENTHESIS_OPEN +%token LSL_PARENTHESIS_CLOSE +%token LSL_ADD +%token LSL_MULTIPLY -%token TOKEN_NUMBER +%token LSL_INTEGER %type expr @@ -25,10 +25,10 @@ input: ; expr: - expr TOKEN_PLUS expr { $$ = addOperation( LSL_ADD, $1, $3 ); } - | expr TOKEN_MULTIPLY expr { $$ = addOperation( LSL_MULTIPLY, $1, $3 ); } - | TOKEN_LPAREN expr TOKEN_RPAREN { $$ = $2; } - | TOKEN_NUMBER { $$ = addInteger($1); } + expr LSL_ADD expr { $$ = addOperation( LSL_ADD, $1, $3 ); } + | expr LSL_MULTIPLY expr { $$ = addOperation( LSL_MULTIPLY, $1, $3 ); } + | LSL_PARENTHESIS_OPEN expr LSL_PARENTHESIS_CLOSE { $$ = $2; } + | LSL_INTEGER { $$ = addInteger($1); } ; %% -- cgit v1.1