aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_lemon_yaccer.y
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-22 14:37:35 +1000
committerDavid Walter Seikel2012-01-22 14:37:35 +1000
commitd954321c83ef81d32bb82d5280e39186620102d6 (patch)
tree2b3e1f1181e0f0b13fe0e7c92e196ceddd4b79d9 /LuaSL/src/LuaSL_lemon_yaccer.y
parentThis is why states where not printing properly. (diff)
downloadSledjHamr-d954321c83ef81d32bb82d5280e39186620102d6.zip
SledjHamr-d954321c83ef81d32bb82d5280e39186620102d6.tar.gz
SledjHamr-d954321c83ef81d32bb82d5280e39186620102d6.tar.bz2
SledjHamr-d954321c83ef81d32bb82d5280e39186620102d6.tar.xz
Collect function definitions, add them to state blocks.
Diffstat (limited to '')
-rw-r--r--LuaSL/src/LuaSL_lemon_yaccer.y7
1 files changed, 4 insertions, 3 deletions
diff --git a/LuaSL/src/LuaSL_lemon_yaccer.y b/LuaSL/src/LuaSL_lemon_yaccer.y
index e6c4bcd..239b598 100644
--- a/LuaSL/src/LuaSL_lemon_yaccer.y
+++ b/LuaSL/src/LuaSL_lemon_yaccer.y
@@ -31,15 +31,16 @@ script ::= .
31// State definitions. 31// State definitions.
32 32
33%nonassoc LSL_BLOCK_OPEN LSL_BLOCK_CLOSE LSL_STATE. 33%nonassoc LSL_BLOCK_OPEN LSL_BLOCK_CLOSE LSL_STATE.
34stateBlock ::= LSL_BLOCK_OPEN functionList LSL_BLOCK_CLOSE. 34stateBlock(A) ::= LSL_BLOCK_OPEN functionList(B) LSL_BLOCK_CLOSE. { A = B; }
35state(S) ::= LSL_DEFAULT(I) stateBlock(B). { S = addState(compiler, I, B); } 35state(S) ::= LSL_DEFAULT(I) stateBlock(B). { S = addState(compiler, I, B); }
36state(S) ::= LSL_STATE_CHANGE LSL_IDENTIFIER(I) stateBlock(B). { S = addState(compiler, I, B); } 36state(S) ::= LSL_STATE_CHANGE LSL_IDENTIFIER(I) stateBlock(B). { S = addState(compiler, I, B); }
37 37
38// Function definitions. 38// Function definitions.
39 39
40%nonassoc LSL_PARAMETER LSL_PARAMETER_LIST LSL_FUNCTION. 40%nonassoc LSL_PARAMETER LSL_PARAMETER_LIST LSL_FUNCTION.
41functionList ::= functionList functionBody. 41functionList(A) ::= functionList(B) functionBody(C). { A = collectStatements(compiler, B, C); }
42functionList ::= . 42//functionList(A) ::= functionBody(C). { A = collectStatements(compiler, NULL, C); }
43functionList(A) ::= . { A = collectStatements(compiler, NULL, NULL); }
43 44
44functionBody(A) ::= function(B) funcBlock(C). { A = addFunctionBody(compiler, B, C); } 45functionBody(A) ::= function(B) funcBlock(C). { A = addFunctionBody(compiler, B, C); }
45 46