diff options
Diffstat (limited to 'LuaSL/src')
-rw-r--r-- | LuaSL/src/LuaSL_lemon_yaccer.y | 7 |
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. |
34 | stateBlock ::= LSL_BLOCK_OPEN functionList LSL_BLOCK_CLOSE. | 34 | stateBlock(A) ::= LSL_BLOCK_OPEN functionList(B) LSL_BLOCK_CLOSE. { A = B; } |
35 | state(S) ::= LSL_DEFAULT(I) stateBlock(B). { S = addState(compiler, I, B); } | 35 | state(S) ::= LSL_DEFAULT(I) stateBlock(B). { S = addState(compiler, I, B); } |
36 | state(S) ::= LSL_STATE_CHANGE LSL_IDENTIFIER(I) stateBlock(B). { S = addState(compiler, I, B); } | 36 | state(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. |
41 | functionList ::= functionList functionBody. | 41 | functionList(A) ::= functionList(B) functionBody(C). { A = collectStatements(compiler, B, C); } |
42 | functionList ::= . | 42 | //functionList(A) ::= functionBody(C). { A = collectStatements(compiler, NULL, C); } |
43 | functionList(A) ::= . { A = collectStatements(compiler, NULL, NULL); } | ||
43 | 44 | ||
44 | functionBody(A) ::= function(B) funcBlock(C). { A = addFunctionBody(compiler, B, C); } | 45 | functionBody(A) ::= function(B) funcBlock(C). { A = addFunctionBody(compiler, B, C); } |
45 | 46 | ||