aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-08 20:11:44 +1000
committerDavid Walter Seikel2012-01-08 20:11:44 +1000
commit75653b8e7eaa7e7489ec8f7c076eb27cdd42d793 (patch)
treea590750dd9e57646f8d380345ed80fe68921062f /LuaSL
parentUse character classes, some clean up. Tried to add space storing, but it did... (diff)
downloadSledjHamr-75653b8e7eaa7e7489ec8f7c076eb27cdd42d793.zip
SledjHamr-75653b8e7eaa7e7489ec8f7c076eb27cdd42d793.tar.gz
SledjHamr-75653b8e7eaa7e7489ec8f7c076eb27cdd42d793.tar.bz2
SledjHamr-75653b8e7eaa7e7489ec8f7c076eb27cdd42d793.tar.xz
Apparently order of these ALSO sets precedence. shrugs
Diffstat (limited to 'LuaSL')
-rw-r--r--LuaSL/src/LuaSL_yaccer.y20
1 files changed, 10 insertions, 10 deletions
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 :
40 | ignorable { ((LuaSL_yyparseParam*)data)->ast = addSpace($1, ((LuaSL_yyparseParam*)data)->ast); } 40 | ignorable { ((LuaSL_yyparseParam*)data)->ast = addSpace($1, ((LuaSL_yyparseParam*)data)->ast); }
41; 41;
42 42
43ignorable :
44 LSL_SPACE { $$ = strdup($1); }
45;
46
47statement :
48 expr LSL_STATEMENT { $$ = createStatement(LSL_EXPRESSION, $1); }
49;
50
51expr : 43expr :
52 LSL_INTEGER { $$ = addInteger($1); } 44 expr LSL_BOOL_AND expr { $$ = addOperation( LSL_BOOL_AND, $1, $3 ); }
53 | expr LSL_BOOL_AND expr { $$ = addOperation( LSL_BOOL_AND, $1, $3 ); }
54 | expr LSL_BOOL_OR expr { $$ = addOperation( LSL_BOOL_OR, $1, $3 ); } 45 | expr LSL_BOOL_OR expr { $$ = addOperation( LSL_BOOL_OR, $1, $3 ); }
55 | expr LSL_BIT_OR expr { $$ = addOperation( LSL_BIT_OR, $1, $3 ); } 46 | expr LSL_BIT_OR expr { $$ = addOperation( LSL_BIT_OR, $1, $3 ); }
56 | expr LSL_BIT_XOR expr { $$ = addOperation( LSL_BIT_XOR, $1, $3 ); } 47 | expr LSL_BIT_XOR expr { $$ = addOperation( LSL_BIT_XOR, $1, $3 ); }
@@ -72,6 +63,15 @@ expr :
72 | LSL_BOOL_NOT expr { $$ = addOperation( LSL_BOOL_NOT, NULL, $2 ); } 63 | LSL_BOOL_NOT expr { $$ = addOperation( LSL_BOOL_NOT, NULL, $2 ); }
73 | LSL_SUBTRACT expr { $$ = addOperation( LSL_NEGATION, NULL, $2 ); } %prec LSL_NEGATION 64 | LSL_SUBTRACT expr { $$ = addOperation( LSL_NEGATION, NULL, $2 ); } %prec LSL_NEGATION
74 | LSL_PARENTHESIS_OPEN expr LSL_PARENTHESIS_CLOSE { $$ = addParenthesis($2); } 65 | LSL_PARENTHESIS_OPEN expr LSL_PARENTHESIS_CLOSE { $$ = addParenthesis($2); }
66 | LSL_INTEGER { $$ = addInteger($1); }
67;
68
69statement :
70 expr LSL_STATEMENT { $$ = createStatement(LSL_EXPRESSION, $1); }
71;
72
73ignorable :
74 LSL_SPACE { $$ = strdup($1); }
75; 75;
76 76
77%% 77%%