aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_lemon_yaccer.y
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-23 18:30:21 +1000
committerDavid Walter Seikel2012-01-23 18:30:21 +1000
commit45214c885b16a1d14ad8c468158e41a7be4a8050 (patch)
tree0208438b1a32191eae64769dd1dc033ed9d5da56 /LuaSL/src/LuaSL_lemon_yaccer.y
parentThat was just for debugging. Still chasing that bug. (diff)
downloadSledjHamr-45214c885b16a1d14ad8c468158e41a7be4a8050.zip
SledjHamr-45214c885b16a1d14ad8c468158e41a7be4a8050.tar.gz
SledjHamr-45214c885b16a1d14ad8c468158e41a7be4a8050.tar.bz2
SledjHamr-45214c885b16a1d14ad8c468158e41a7be4a8050.tar.xz
Fix variable reference being replaced by it's definition.
Diffstat (limited to '')
-rw-r--r--LuaSL/src/LuaSL_lemon_yaccer.y66
1 files changed, 1 insertions, 65 deletions
diff --git a/LuaSL/src/LuaSL_lemon_yaccer.y b/LuaSL/src/LuaSL_lemon_yaccer.y
index f67b9d1..38b9c36 100644
--- a/LuaSL/src/LuaSL_lemon_yaccer.y
+++ b/LuaSL/src/LuaSL_lemon_yaccer.y
@@ -159,70 +159,6 @@ expr(A) ::= LSL_IDENTIFIER(B) LSL_PARENTHESIS_OPEN(C) exprList(D) LSL_PARENTHESI
159 159
160expr(A) ::= identifier(B). { A = B; } 160expr(A) ::= identifier(B). { A = B; }
161 161
162/*
163--accepting rule at line 85 ("integer")
164LSL_lemon Input LSL_TYPE_INTEGER
165LSL_lemon Reduce [script ::=].
166LSL_lemon Shift 1
167LSL_lemon Stack: script
168LSL_lemon Shift 177
169LSL_lemon Stack: script LSL_TYPE_INTEGER
170--accepting rule at line 36 (" ")
171--accepting rule at line 104 ("Checking")
172LSL_lemon Input LSL_IDENTIFIER
173LSL_lemon Reduce [type ::= LSL_TYPE_INTEGER].
174LSL_lemon Shift 107
175LSL_lemon Stack: script type
176LSL_lemon Shift 97
177LSL_lemon Stack: script type LSL_IDENTIFIER
178--accepting rule at line 36 (" ")
179--accepting rule at line 71 ("=")
180LSL_lemon Input LSL_ASSIGNMENT_PLAIN
181LSL_lemon Shift 16
182LSL_lemon Stack: script type LSL_IDENTIFIER LSL_ASSIGNMENT_PLAIN
183--accepting rule at line 36 (" ")
184--accepting rule at line 104 ("FALSE")
185LSL_lemon Input LSL_IDENTIFIER
186LSL_lemon Shift 127
187LSL_lemon Stack: script type LSL_IDENTIFIER LSL_ASSIGNMENT_PLAIN LSL_IDENTIFIER
188--accepting rule at line 81 (";")
189LSL_lemon Input LSL_STATEMENT
190LSL_lemon Reduce [identifier ::= LSL_IDENTIFIER].
19122/01/2012 15:32:13 INF<15847>:LuaSL LuaSL_compile.c :305 checkVariable() Found FALSE!
192LSL_lemon Shift 94
193LSL_lemon Stack: script type LSL_IDENTIFIER LSL_ASSIGNMENT_PLAIN identifier
194LSL_lemon Reduce [expr ::= identifier].
195LSL_lemon Shift 67
196LSL_lemon Stack: script type LSL_IDENTIFIER LSL_ASSIGNMENT_PLAIN expr
197LSL_lemon Shift 142
198LSL_lemon Stack: script type LSL_IDENTIFIER LSL_ASSIGNMENT_PLAIN expr LSL_STATEMENT
199--accepting rule at line 36 (" ")
200--accepting rule at line 39 ("// whether doing consistency check")
201--accepting rule at line 36 ("
202
203")
204--accepting rule at line 85 ("integer")
205LSL_lemon Input LSL_TYPE_INTEGER
206LSL_lemon Reduce [statement ::= type LSL_IDENTIFIER LSL_ASSIGNMENT_PLAIN expr LSL_STATEMENT].
207LSL_lemon Shift 194
208LSL_lemon Stack: script statement
209LSL_lemon Reduce [script ::= script statement].
210LSL_lemon Shift 1
211LSL_lemon Stack: script
212
213
214Results in -
215integer Checking =
216integer FALSE = 0; // whether doing consistency check
217
218Instead of -
219integer Checking = FALSE; // whether doing consistency check
220
221Coz it replaces the variable with the definition of the variable.
222
223*/
224
225
226%right LSL_ASSIGNMENT_CONCATENATE LSL_ASSIGNMENT_ADD LSL_ASSIGNMENT_SUBTRACT LSL_ASSIGNMENT_MULTIPLY LSL_ASSIGNMENT_MODULO LSL_ASSIGNMENT_DIVIDE LSL_ASSIGNMENT_PLAIN. 162%right LSL_ASSIGNMENT_CONCATENATE LSL_ASSIGNMENT_ADD LSL_ASSIGNMENT_SUBTRACT LSL_ASSIGNMENT_MULTIPLY LSL_ASSIGNMENT_MODULO LSL_ASSIGNMENT_DIVIDE LSL_ASSIGNMENT_PLAIN.
227// Yes, these can be expressions, and can happen in if statements and such. 163// Yes, these can be expressions, and can happen in if statements and such.
228expr(A) ::= identifier LSL_ASSIGNMENT_CONCATENATE expr(B). { A = B; } 164expr(A) ::= identifier LSL_ASSIGNMENT_CONCATENATE expr(B). { A = B; }
@@ -240,7 +176,7 @@ statement(A) ::= type(B) LSL_IDENTIFIER(C) LSL_STATEMENT(F). { A = addStatem
240 176
241%right LSL_DOT LSL_IDENTIFIER LSL_FUNCTION_CALL. 177%right LSL_DOT LSL_IDENTIFIER LSL_FUNCTION_CALL.
242identifier ::= identifier LSL_DOT LSL_IDENTIFIER. 178identifier ::= identifier LSL_DOT LSL_IDENTIFIER.
243identifier(A) ::= LSL_IDENTIFIER(B). { A = checkVariable(compiler, B); } 179identifier(A) ::= LSL_IDENTIFIER(B). { A = checkVariable(compiler, B); }
244 180
245%right LSL_DECREMENT_PRE LSL_INCREMENT_PRE LSL_DECREMENT_POST LSL_INCREMENT_POST. 181%right LSL_DECREMENT_PRE LSL_INCREMENT_PRE LSL_DECREMENT_POST LSL_INCREMENT_POST.
246expr(A) ::= identifier(B) LSL_DECREMENT_PRE(C). { A = addCrement(compiler, B, C); } 182expr(A) ::= identifier(B) LSL_DECREMENT_PRE(C). { A = addCrement(compiler, B, C); }