added more helper functions
This commit is contained in:
@ -145,7 +145,6 @@ int getNumArrDim(TableNode *definition) {
|
||||
printf("passed an NULL entry to getNumArrDim function. Invalid.\n");
|
||||
return -1;
|
||||
}
|
||||
if(
|
||||
if (strcmp(getType(definition), "array") != 0) {
|
||||
printf("not checking the dim of an array -- invalid op\n");
|
||||
return 0;
|
||||
@ -236,6 +235,15 @@ int getStartLine(TableNode *definition) {
|
||||
}
|
||||
return definition->additionalinfo->FunDecAdInfo->startlinenumber;
|
||||
}
|
||||
|
||||
TableNode* setStartLine(TableNode* tn, int start){
|
||||
if(tn == NULL){
|
||||
printf("passing in a NULL entry to setStartLine. invalid\n");
|
||||
return NULL;
|
||||
}
|
||||
tn->additionalinfo->FunDecAdInfo->startlinenumber = start;
|
||||
return tn;
|
||||
}
|
||||
// checks if "as" keyword was used for function definition. Either 0 or 1 for
|
||||
// not used or used.
|
||||
bool getAsKeyword(TableNode *definition) {
|
||||
@ -246,6 +254,16 @@ bool getAsKeyword(TableNode *definition) {
|
||||
}
|
||||
return definition->additionalinfo->FunDecAdInfo->regularoras;
|
||||
}
|
||||
|
||||
TableNode* setAsKeyword(TableNode* tn, bool as){
|
||||
if(tn == NULL){
|
||||
printf("passing in a NULL entry to setAsKeyword. invalid\n");
|
||||
return NULL;
|
||||
}
|
||||
tn->additionalinfo->FunDecAdInfo->regularoras = as;
|
||||
return tn;
|
||||
}
|
||||
|
||||
// stores the type of a function (parameter type and return type)
|
||||
AdInfo *CreateFunctionTypeInfo(TableNode *parameter, TableNode *returntype) {
|
||||
AdInfo *info = (AdInfo *)malloc(sizeof(AdInfo));
|
||||
|
Reference in New Issue
Block a user