aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-17 20:39:17 +1000
committerDavid Walter Seikel2012-01-17 20:39:17 +1000
commit25dd3027c55a1b4f30b77620309d74367b2bbf6f (patch)
treeca0f374a20bcc3abf5dbf95e6bbeb4007ed3eebc /LuaSL
parentMake sure all leaf's are created unbroken. (diff)
downloadSledjHamr-25dd3027c55a1b4f30b77620309d74367b2bbf6f.zip
SledjHamr-25dd3027c55a1b4f30b77620309d74367b2bbf6f.tar.gz
SledjHamr-25dd3027c55a1b4f30b77620309d74367b2bbf6f.tar.bz2
SledjHamr-25dd3027c55a1b4f30b77620309d74367b2bbf6f.tar.xz
Move some comments to be more useful.
Diffstat (limited to 'LuaSL')
-rw-r--r--LuaSL/src/LuaSL_LSL_tree.h29
-rw-r--r--LuaSL/src/LuaSL_compile.c71
2 files changed, 38 insertions, 62 deletions
diff --git a/LuaSL/src/LuaSL_LSL_tree.h b/LuaSL/src/LuaSL_LSL_tree.h
index c8d1cc6..1755e6c 100644
--- a/LuaSL/src/LuaSL_LSL_tree.h
+++ b/LuaSL/src/LuaSL_LSL_tree.h
@@ -109,35 +109,6 @@ typedef enum
109 OT_invalid 109 OT_invalid
110} opType; 110} opType;
111 111
112/*
113Each op is of a specific type -
114
115bool !
116int - ~
117float -
118
119bool bool && || == != =
120int int * / + - % == != < > <= >= = += -= *= /= %= & | ^ << >>
121int float cast to float float
122float int cast to float float
123float float * / + - == != < > <= >= = += -= *= /=
124
125key string cast to string string
126string key cast to string string
127string string + == != = +=
128
129list list + == != = +=
130list integer/float + < > <= >= = +=
131integer/float list + < > <= >=
132list other + = +=
133
134vector vector * / + - % == != = += -= *= /= %=
135vector float * /
136vector rotation * /
137
138rotation rotation * / + - == != = += -= *= /=
139*/
140
141typedef enum 112typedef enum
142{ 113{
143 ST_NONE = 0, 114 ST_NONE = 0,
diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c
index 56fd4f5..e1875c6 100644
--- a/LuaSL/src/LuaSL_compile.c
+++ b/LuaSL/src/LuaSL_compile.c
@@ -128,38 +128,44 @@ LSL_Token LSL_Tokens[] =
128 128
129allowedTypes allowed[] = 129allowedTypes allowed[] =
130{ 130{
131 {OT_nothing, "nothing", (ST_NONE)}, 131 {OT_nothing, "nothing", (ST_NONE)}, //
132 132
133 {OT_bool, "boolean", (ST_BOOL_NOT)}, 133 {OT_bool, "boolean", (ST_BOOL_NOT)}, // bool !
134 {OT_integer, "integer", (ST_BIT_NOT | ST_NEGATE)}, 134 {OT_integer, "integer", (ST_BIT_NOT | ST_NEGATE)}, // int - ~
135 {OT_float, "float", (ST_NONE)}, 135 {OT_float, "float", (ST_NONE)}, // float -
136 {OT_key, "key", (ST_NONE)}, 136 {OT_key, "key", (ST_NONE)}, //
137 {OT_list, "list", (ST_NONE)}, 137 {OT_list, "list", (ST_NONE)}, //
138 {OT_rotation, "rotation", (ST_NONE)}, 138 {OT_rotation, "rotation", (ST_NONE)}, //
139 {OT_string, "string", (ST_NONE)}, 139 {OT_string, "string", (ST_NONE)}, //
140 {OT_vector, "vector", (ST_NONE)}, 140 {OT_vector, "vector", (ST_NONE)}, //
141 {OT_other, "other", (ST_NONE)}, 141 {OT_other, "other", (ST_NONE)}, //
142 142
143 {OT_bool, "boolean", (ST_BOOLEAN | ST_EQUALITY)}, 143 {OT_bool, "boolean", (ST_BOOLEAN | ST_EQUALITY)}, // bool bool == != = && ||
144 {OT_integer, "integer", (ST_MULTIPLY | ST_ADD | ST_SUBTRACT | ST_EQUALITY | ST_COMPARISON | ST_CONCATENATION | ST_ASSIGNMENT | ST_MODULO | ST_BITWISE)}, 144
145 {OT_float, "float", (ST_MULTIPLY | ST_ADD | ST_SUBTRACT | ST_EQUALITY | ST_COMPARISON | ST_CONCATENATION | ST_ASSIGNMENT)}, 145 {OT_integer, "integer", (ST_MULTIPLY | ST_ADD | ST_SUBTRACT | ST_EQUALITY | ST_COMPARISON | ST_CONCATENATION | ST_ASSIGNMENT | ST_MODULO | ST_BITWISE)}, // int int * / + - % == != < > <= >= = += -= *= /= %= & | ^ << >>
146 {OT_float, "float", (ST_MULTIPLY | ST_ADD | ST_SUBTRACT | ST_EQUALITY | ST_COMPARISON | ST_CONCATENATION | ST_ASSIGNMENT)}, 146 {OT_float, "float", (ST_MULTIPLY | ST_ADD | ST_SUBTRACT | ST_EQUALITY | ST_COMPARISON | ST_CONCATENATION | ST_ASSIGNMENT)}, // int float cast to float float
147 {OT_float, "float", (ST_MULTIPLY | ST_ADD | ST_SUBTRACT | ST_EQUALITY | ST_COMPARISON | ST_CONCATENATION | ST_ASSIGNMENT)}, 147 {OT_float, "float", (ST_MULTIPLY | ST_ADD | ST_SUBTRACT | ST_EQUALITY | ST_COMPARISON | ST_CONCATENATION | ST_ASSIGNMENT)}, // float int cast to float float
148 {OT_string, "string", (ST_ADD | ST_EQUALITY | ST_CONCATENATION)}, 148 {OT_float, "float", (ST_MULTIPLY | ST_ADD | ST_SUBTRACT | ST_EQUALITY | ST_COMPARISON | ST_CONCATENATION | ST_ASSIGNMENT)}, // float float * / + - == != < > <= >= = += -= *= /=
149 {OT_string, "string", (ST_ADD | ST_EQUALITY | ST_CONCATENATION)}, 149
150 {OT_string, "string", (ST_ADD | ST_EQUALITY | ST_CONCATENATION)}, 150 {OT_string, "string", (ST_ADD | ST_EQUALITY | ST_CONCATENATION)}, // key string cast to string string
151 {OT_list, "list", (ST_ADD | ST_EQUALITY | ST_CONCATENATION)}, 151 {OT_string, "string", (ST_ADD | ST_EQUALITY | ST_CONCATENATION)}, // string key cast to string string
152 {OT_list, "list", (ST_ADD | ST_COMPARISON | ST_CONCATENATION)}, 152 {OT_string, "string", (ST_ADD | ST_EQUALITY | ST_CONCATENATION)}, // string string + == != = +=
153 {OT_list, "list", (ST_ADD | ST_COMPARISON | ST_CONCATENATION)}, 153
154 {OT_integer, "integer", (ST_ADD | ST_COMPARISON)}, 154 {OT_list, "list", (ST_ADD | ST_EQUALITY | ST_CONCATENATION)}, // list list + == != = +=
155 {OT_float, "float", (ST_ADD | ST_COMPARISON)}, 155 {OT_list, "list", (ST_ADD | ST_COMPARISON | ST_CONCATENATION)}, // list integer + < > <= >= = +=
156 {OT_list, "list", (ST_ADD | ST_CONCATENATION)}, 156 {OT_list, "list", (ST_ADD | ST_COMPARISON | ST_CONCATENATION)}, // list float + < > <= >= = +=
157 {OT_vector, "vector", (ST_MULTIPLY | ST_ADD | ST_SUBTRACT | ST_EQUALITY | ST_CONCATENATION | ST_ASSIGNMENT | ST_MODULO)}, 157 {OT_integer, "integer", (ST_ADD | ST_COMPARISON)}, // integer list + < > <= >=
158 {OT_vector, "vector", (ST_MULTIPLY)}, 158 {OT_float, "float", (ST_ADD | ST_COMPARISON)}, // float list + < > <= >=
159 {OT_vector, "vector", (ST_MULTIPLY)}, 159 {OT_list, "list", (ST_ADD | ST_CONCATENATION)}, // list other + = +=
160 {OT_rotation, "rotation", (ST_MULTIPLY | ST_ADD | ST_SUBTRACT | ST_EQUALITY | ST_CONCATENATION | ST_ASSIGNMENT)}, 160
161 {OT_other, "other", (ST_NONE)}, 161 {OT_vector, "vector", (ST_MULTIPLY | ST_ADD | ST_SUBTRACT | ST_EQUALITY | ST_CONCATENATION | ST_ASSIGNMENT | ST_MODULO)}, // vector vector * / + - % == != = += -= *= /= %=
162 {OT_invalid, "invalid", (ST_NONE)} 162 {OT_vector, "vector", (ST_MULTIPLY)}, // vector float * /
163 {OT_vector, "vector", (ST_MULTIPLY)}, // vector rotation * /
164
165 {OT_rotation, "rotation", (ST_MULTIPLY | ST_ADD | ST_SUBTRACT | ST_EQUALITY | ST_CONCATENATION | ST_ASSIGNMENT)}, // rotation rotation * / + - == != = += -= *= /=
166
167 {OT_other, "other", (ST_NONE)}, //
168 {OT_invalid, "invalid", (ST_NONE)} //
163}; 169};
164 170
165opType opExpr[][10] = 171opType opExpr[][10] =
@@ -174,7 +180,6 @@ opType opExpr[][10] =
174 {OT_string, OT_invalid, OT_invalid, OT_invalid, OT_stringKey, OT_invalid, OT_invalid, OT_stringString, OT_invalid, OT_invalid}, 180 {OT_string, OT_invalid, OT_invalid, OT_invalid, OT_stringKey, OT_invalid, OT_invalid, OT_stringString, OT_invalid, OT_invalid},
175 {OT_vector, OT_invalid, OT_invalid, OT_vectorFloat, OT_invalid, OT_invalid, OT_vectorRotation, OT_invalid, OT_vectorVector, OT_invalid}, 181 {OT_vector, OT_invalid, OT_invalid, OT_vectorFloat, OT_invalid, OT_invalid, OT_vectorRotation, OT_invalid, OT_vectorVector, OT_invalid},
176 {OT_other, OT_invalid, OT_invalid, OT_invalid, OT_invalid, OT_invalid, OT_invalid, OT_invalid, OT_invalid, OT_otherOther} 182 {OT_other, OT_invalid, OT_invalid, OT_invalid, OT_invalid, OT_invalid, OT_invalid, OT_invalid, OT_invalid, OT_otherOther}
177
178}; 183};
179 184
180 185