From e20bc3a36eb5df83b9531e5be2366870eed1b409 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Tue, 17 Jan 2012 11:40:08 +1000 Subject: No need to pass param to these. --- LuaSL/src/LuaSL_LSL_tree.c | 6 +++--- LuaSL/src/LuaSL_LSL_tree.h | 6 +++--- LuaSL/src/LuaSL_lemon_yaccer.y | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'LuaSL') 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) return lval; } -LSL_Leaf *addParameter(LuaSL_yyparseParam *param, LSL_Leaf *type, LSL_Leaf *identifier) +LSL_Leaf *addParameter(LSL_Leaf *type, LSL_Leaf *identifier) { LSL_Identifier *result = calloc(1, sizeof(LSL_Identifier)); @@ -310,7 +310,7 @@ LSL_Leaf *addParameter(LuaSL_yyparseParam *param, LSL_Leaf *type, LSL_Leaf *iden return identifier; } -LSL_Leaf *collectParameters(LuaSL_yyparseParam *param, LSL_Leaf *list, LSL_Leaf *comma, LSL_Leaf *newParam) +LSL_Leaf *collectParameters(LSL_Leaf *list, LSL_Leaf *comma, LSL_Leaf *newParam) { LSL_Leaf *newList = newLeaf(LSL_PARAMETER_LIST, NULL, NULL); @@ -327,7 +327,7 @@ LSL_Leaf *collectParameters(LuaSL_yyparseParam *param, LSL_Leaf *list, LSL_Leaf return newList; } -LSL_Leaf *addFunction(LuaSL_yyparseParam *param, LSL_Leaf *type, LSL_Leaf *identifier, LSL_Leaf *open, LSL_Leaf *params, LSL_Leaf *close, LSL_Leaf *block) +LSL_Leaf *addFunction(LSL_Leaf *type, LSL_Leaf *identifier, LSL_Leaf *open, LSL_Leaf *params, LSL_Leaf *close, LSL_Leaf *block) { LSL_Function *func = calloc(1, sizeof(LSL_Function)); 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 void burnLeaf(LSL_Leaf *leaf); -LSL_Leaf *addFunction(LuaSL_yyparseParam *param, LSL_Leaf *type, LSL_Leaf *identifier, LSL_Leaf *open, LSL_Leaf *params, LSL_Leaf *close, LSL_Leaf *block); +LSL_Leaf *addFunction(LSL_Leaf *type, LSL_Leaf *identifier, LSL_Leaf *open, LSL_Leaf *params, LSL_Leaf *close, LSL_Leaf *block); LSL_Leaf *addOperation(LSL_Leaf *left, LSL_Leaf *lval, LSL_Leaf *right); -LSL_Leaf *addParameter(LuaSL_yyparseParam *param, LSL_Leaf *type, LSL_Leaf *newParam); +LSL_Leaf *addParameter(LSL_Leaf *type, LSL_Leaf *newParam); LSL_Leaf *addParenthesis(LSL_Leaf *lval, LSL_Leaf *expr, LSL_Type type, LSL_Leaf *rval); LSL_Leaf *addState(LuaSL_yyparseParam *param, LSL_Leaf *identifier, LSL_Leaf *block); 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 * LSL_Leaf *addVariable(LuaSL_yyparseParam *param, LSL_Leaf *type, LSL_Leaf *identifier, LSL_Leaf *assignment, LSL_Leaf *expr); void beginBlock(LuaSL_yyparseParam *param, LSL_Leaf *block); -LSL_Leaf *collectParameters(LuaSL_yyparseParam *param, LSL_Leaf *list, LSL_Leaf *comma, LSL_Leaf *newParam); +LSL_Leaf *collectParameters(LSL_Leaf *list, LSL_Leaf *comma, LSL_Leaf *newParam); void endBlock(LuaSL_yyparseParam *param, LSL_Leaf *block); 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); } functionList ::= functionList function. functionList ::= . -parameterList(A) ::= parameterList(B) LSL_COMMA(C) parameter(D). { A = collectParameters(param, B, C, D); } -parameterList(A) ::= parameter(D). { A = collectParameters(param, NULL, NULL, D); } -parameterList(A) ::= . { A = collectParameters(param, NULL, NULL, NULL); } -parameter(A) ::= type(B) LSL_IDENTIFIER(C). { A = addParameter(param, B, C); } +parameterList(A) ::= parameterList(B) LSL_COMMA(C) parameter(D). { A = collectParameters(B, C, D); } +parameterList(A) ::= parameter(D). { A = collectParameters(NULL, NULL, D); } +parameterList(A) ::= . { A = collectParameters(NULL, NULL, NULL); } +parameter(A) ::= type(B) LSL_IDENTIFIER(C). { A = addParameter(B, C); } // Causes a conflict when it's an empty parameterList with calling the same type of function. -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); } -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); } +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); } +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); } // Blocks. -- cgit v1.1