added reference to function scopes

This commit is contained in:
Partho
2025-05-03 14:16:31 -04:00
parent 5a47e40227
commit 6b239b0724
3 changed files with 86 additions and 12 deletions

View File

@ -20,6 +20,7 @@ extern FILE *ir_flag;
struct TableNode;
typedef struct TFList TFList;
typedef struct CGNode CGNode;
typedef struct SymbolTable SymbolTable;
typedef struct Constant_Stack {
struct TableNode *theType;
@ -47,6 +48,7 @@ typedef struct {
typedef struct {
int startlinenumber;
bool regularoras;
SymbolTable* scope;
} function_declaration_info;
typedef struct {
@ -120,7 +122,9 @@ int getRecLength(TableNode *definition);
SymbolTable *getRecList(TableNode *definition);
TableNode *setRecSize(TableNode *tn, int n);
int getRecSize(SymbolTable *tn);
AdInfo *CreateFunctionDeclarationInfo(int line, bool asorregular);
AdInfo *CreateFunctionDeclarationInfo(int line, bool asorregular,SymbolTable *scope);
TableNode *setFunScope(TableNode *tn, SymbolTable *scope);
SymbolTable *getFunScope(TableNode *definition);
int getStartLine(TableNode *definition);
TableNode *setStartLine(TableNode *tn, int start);
bool getAsKeyword(TableNode *definition);