diff options
author | David Walter Seikel | 2012-01-17 11:40:08 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-17 11:40:08 +1000 |
commit | e20bc3a36eb5df83b9531e5be2366870eed1b409 (patch) | |
tree | a9b9bb576ebead6172dea13b57a405f7bdef726a | |
parent | Identifiers. (diff) | |
download | SledjHamr-e20bc3a36eb5df83b9531e5be2366870eed1b409.zip SledjHamr-e20bc3a36eb5df83b9531e5be2366870eed1b409.tar.gz SledjHamr-e20bc3a36eb5df83b9531e5be2366870eed1b409.tar.bz2 SledjHamr-e20bc3a36eb5df83b9531e5be2366870eed1b409.tar.xz |
No need to pass param to these.
-rw-r--r-- | LuaSL/src/LuaSL_LSL_tree.c | 6 | ||||
-rw-r--r-- | LuaSL/src/LuaSL_LSL_tree.h | 6 | ||||
-rw-r--r-- | LuaSL/src/LuaSL_lemon_yaccer.y | 12 |
3 files changed, 12 insertions, 12 deletions
diff --git a/LuaSL/src/LuaSL_LSL_tree.c b/LuaSL/src/LuaSL_LSL_tree.c index 6a0988c..3d53ed7 100644 --- a/LuaSL/src/LuaSL_LSL_tree.c +++ b/LuaSL/src/LuaSL_LSL_tree.c | |||
@@ -291,7 +291,7 @@ LSL_Leaf *addOperation(LSL_Leaf *left, LSL_Leaf *lval, LSL_Leaf *right) | |||
291 | return lval; | 291 | return lval; |
292 | } | 292 | } |
293 | 293 | ||
294 | LSL_Leaf *addParameter(LuaSL_yyparseParam *param, LSL_Leaf *type, LSL_Leaf *identifier) | 294 | LSL_Leaf *addParameter(LSL_Leaf *type, LSL_Leaf *identifier) |
295 | { | 295 | { |
296 | LSL_Identifier *result = calloc(1, sizeof(LSL_Identifier)); | 296 | LSL_Identifier *result = calloc(1, sizeof(LSL_Identifier)); |
297 | 297 | ||
@@ -310,7 +310,7 @@ LSL_Leaf *addParameter(LuaSL_yyparseParam *param, LSL_Leaf *type, LSL_Leaf *iden | |||
310 | return identifier; | 310 | return identifier; |
311 | } | 311 | } |
312 | 312 | ||
313 | LSL_Leaf *collectParameters(LuaSL_yyparseParam *param, LSL_Leaf *list, LSL_Leaf *comma, LSL_Leaf *newParam) | 313 | LSL_Leaf *collectParameters(LSL_Leaf *list, LSL_Leaf *comma, LSL_Leaf *newParam) |
314 | { | 314 | { |
315 | LSL_Leaf *newList = newLeaf(LSL_PARAMETER_LIST, NULL, NULL); | 315 | LSL_Leaf *newList = newLeaf(LSL_PARAMETER_LIST, NULL, NULL); |
316 | 316 | ||
@@ -327,7 +327,7 @@ LSL_Leaf *collectParameters(LuaSL_yyparseParam *param, LSL_Leaf *list, LSL_Leaf | |||
327 | return newList; | 327 | return newList; |
328 | } | 328 | } |
329 | 329 | ||
330 | LSL_Leaf *addFunction(LuaSL_yyparseParam *param, LSL_Leaf *type, LSL_Leaf *identifier, LSL_Leaf *open, LSL_Leaf *params, LSL_Leaf *close, LSL_Leaf *block) | 330 | LSL_Leaf *addFunction(LSL_Leaf *type, LSL_Leaf *identifier, LSL_Leaf *open, LSL_Leaf *params, LSL_Leaf *close, LSL_Leaf *block) |
331 | { | 331 | { |
332 | LSL_Function *func = calloc(1, sizeof(LSL_Function)); | 332 | LSL_Function *func = calloc(1, sizeof(LSL_Function)); |
333 | 333 | ||
diff --git a/LuaSL/src/LuaSL_LSL_tree.h b/LuaSL/src/LuaSL_LSL_tree.h index 020a92e..c33d77d 100644 --- a/LuaSL/src/LuaSL_LSL_tree.h +++ b/LuaSL/src/LuaSL_LSL_tree.h | |||
@@ -296,9 +296,9 @@ typedef struct | |||
296 | 296 | ||
297 | 297 | ||
298 | void burnLeaf(LSL_Leaf *leaf); | 298 | void burnLeaf(LSL_Leaf *leaf); |
299 | LSL_Leaf *addFunction(LuaSL_yyparseParam *param, LSL_Leaf *type, LSL_Leaf *identifier, LSL_Leaf *open, LSL_Leaf *params, LSL_Leaf *close, LSL_Leaf *block); | 299 | LSL_Leaf *addFunction(LSL_Leaf *type, LSL_Leaf *identifier, LSL_Leaf *open, LSL_Leaf *params, LSL_Leaf *close, LSL_Leaf *block); |
300 | LSL_Leaf *addOperation(LSL_Leaf *left, LSL_Leaf *lval, LSL_Leaf *right); | 300 | LSL_Leaf *addOperation(LSL_Leaf *left, LSL_Leaf *lval, LSL_Leaf *right); |
301 | LSL_Leaf *addParameter(LuaSL_yyparseParam *param, LSL_Leaf *type, LSL_Leaf *newParam); | 301 | LSL_Leaf *addParameter(LSL_Leaf *type, LSL_Leaf *newParam); |
302 | LSL_Leaf *addParenthesis(LSL_Leaf *lval, LSL_Leaf *expr, LSL_Type type, LSL_Leaf *rval); | 302 | LSL_Leaf *addParenthesis(LSL_Leaf *lval, LSL_Leaf *expr, LSL_Type type, LSL_Leaf *rval); |
303 | LSL_Leaf *addState(LuaSL_yyparseParam *param, LSL_Leaf *identifier, LSL_Leaf *block); | 303 | LSL_Leaf *addState(LuaSL_yyparseParam *param, LSL_Leaf *identifier, LSL_Leaf *block); |
304 | LSL_Leaf *addStatement(LSL_Leaf *lval, LSL_Type type, LSL_Leaf *expr); | 304 | LSL_Leaf *addStatement(LSL_Leaf *lval, LSL_Type type, LSL_Leaf *expr); |
@@ -306,7 +306,7 @@ LSL_Leaf *addTypecast(LSL_Leaf *lval, LSL_Leaf *type, LSL_Leaf *rval, LSL_Leaf * | |||
306 | LSL_Leaf *addVariable(LuaSL_yyparseParam *param, LSL_Leaf *type, LSL_Leaf *identifier, LSL_Leaf *assignment, LSL_Leaf *expr); | 306 | LSL_Leaf *addVariable(LuaSL_yyparseParam *param, LSL_Leaf *type, LSL_Leaf *identifier, LSL_Leaf *assignment, LSL_Leaf *expr); |
307 | 307 | ||
308 | void beginBlock(LuaSL_yyparseParam *param, LSL_Leaf *block); | 308 | void beginBlock(LuaSL_yyparseParam *param, LSL_Leaf *block); |
309 | LSL_Leaf *collectParameters(LuaSL_yyparseParam *param, LSL_Leaf *list, LSL_Leaf *comma, LSL_Leaf *newParam); | 309 | LSL_Leaf *collectParameters(LSL_Leaf *list, LSL_Leaf *comma, LSL_Leaf *newParam); |
310 | void endBlock(LuaSL_yyparseParam *param, LSL_Leaf *block); | 310 | void endBlock(LuaSL_yyparseParam *param, LSL_Leaf *block); |
311 | 311 | ||
312 | void *ParseAlloc(void *(*mallocProc)(size_t)); | 312 | void *ParseAlloc(void *(*mallocProc)(size_t)); |
diff --git a/LuaSL/src/LuaSL_lemon_yaccer.y b/LuaSL/src/LuaSL_lemon_yaccer.y index 10e3a33..8fa54e2 100644 --- a/LuaSL/src/LuaSL_lemon_yaccer.y +++ b/LuaSL/src/LuaSL_lemon_yaccer.y | |||
@@ -40,13 +40,13 @@ state(S) ::= LSL_IDENTIFIER(I) stateBlock(B). { S = addState(param, I, B); } | |||
40 | functionList ::= functionList function. | 40 | functionList ::= functionList function. |
41 | functionList ::= . | 41 | functionList ::= . |
42 | 42 | ||
43 | parameterList(A) ::= parameterList(B) LSL_COMMA(C) parameter(D). { A = collectParameters(param, B, C, D); } | 43 | parameterList(A) ::= parameterList(B) LSL_COMMA(C) parameter(D). { A = collectParameters(B, C, D); } |
44 | parameterList(A) ::= parameter(D). { A = collectParameters(param, NULL, NULL, D); } | 44 | parameterList(A) ::= parameter(D). { A = collectParameters(NULL, NULL, D); } |
45 | parameterList(A) ::= . { A = collectParameters(param, NULL, NULL, NULL); } | 45 | parameterList(A) ::= . { A = collectParameters(NULL, NULL, NULL); } |
46 | parameter(A) ::= type(B) LSL_IDENTIFIER(C). { A = addParameter(param, B, C); } | 46 | parameter(A) ::= type(B) LSL_IDENTIFIER(C). { A = addParameter(B, C); } |
47 | // Causes a conflict when it's an empty parameterList with calling the same type of function. | 47 | // Causes a conflict when it's an empty parameterList with calling the same type of function. |
48 | function(A) ::= LSL_IDENTIFIER(C) LSL_PARENTHESIS_OPEN(D) parameterList(E) LSL_PARENTHESIS_CLOSE(F) funcBlock(G). { A = addFunction(param, NULL, C, D, E, F, G); } | 48 | function(A) ::= LSL_IDENTIFIER(C) LSL_PARENTHESIS_OPEN(D) parameterList(E) LSL_PARENTHESIS_CLOSE(F) funcBlock(G). { A = addFunction(NULL, C, D, E, F, G); } |
49 | function(A) ::= type(B) LSL_IDENTIFIER(C) LSL_PARENTHESIS_OPEN(D) parameterList(E) LSL_PARENTHESIS_CLOSE(F) funcBlock(G). { A = addFunction(param, B, C, D, E, F, G); } | 49 | function(A) ::= type(B) LSL_IDENTIFIER(C) LSL_PARENTHESIS_OPEN(D) parameterList(E) LSL_PARENTHESIS_CLOSE(F) funcBlock(G). { A = addFunction(B, C, D, E, F, G); } |
50 | 50 | ||
51 | // Blocks. | 51 | // Blocks. |
52 | 52 | ||