From 75653b8e7eaa7e7489ec8f7c076eb27cdd42d793 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 8 Jan 2012 20:11:44 +1000 Subject: Apparently order of these ALSO sets precedence. shrugs --- LuaSL/src/LuaSL_yaccer.y | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'LuaSL/src') diff --git a/LuaSL/src/LuaSL_yaccer.y b/LuaSL/src/LuaSL_yaccer.y index 57d3075..0b87df4 100644 --- a/LuaSL/src/LuaSL_yaccer.y +++ b/LuaSL/src/LuaSL_yaccer.y @@ -40,17 +40,8 @@ input : | ignorable { ((LuaSL_yyparseParam*)data)->ast = addSpace($1, ((LuaSL_yyparseParam*)data)->ast); } ; -ignorable : - LSL_SPACE { $$ = strdup($1); } -; - -statement : - expr LSL_STATEMENT { $$ = createStatement(LSL_EXPRESSION, $1); } -; - expr : - LSL_INTEGER { $$ = addInteger($1); } - | expr LSL_BOOL_AND expr { $$ = addOperation( LSL_BOOL_AND, $1, $3 ); } + expr LSL_BOOL_AND expr { $$ = addOperation( LSL_BOOL_AND, $1, $3 ); } | expr LSL_BOOL_OR expr { $$ = addOperation( LSL_BOOL_OR, $1, $3 ); } | expr LSL_BIT_OR expr { $$ = addOperation( LSL_BIT_OR, $1, $3 ); } | expr LSL_BIT_XOR expr { $$ = addOperation( LSL_BIT_XOR, $1, $3 ); } @@ -72,6 +63,15 @@ expr : | LSL_BOOL_NOT expr { $$ = addOperation( LSL_BOOL_NOT, NULL, $2 ); } | LSL_SUBTRACT expr { $$ = addOperation( LSL_NEGATION, NULL, $2 ); } %prec LSL_NEGATION | LSL_PARENTHESIS_OPEN expr LSL_PARENTHESIS_CLOSE { $$ = addParenthesis($2); } + | LSL_INTEGER { $$ = addInteger($1); } +; + +statement : + expr LSL_STATEMENT { $$ = createStatement(LSL_EXPRESSION, $1); } +; + +ignorable : + LSL_SPACE { $$ = strdup($1); } ; %% -- cgit v1.1