-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsymbolTable.h
More file actions
51 lines (39 loc) · 1.49 KB
/
Copy pathsymbolTable.h
File metadata and controls
51 lines (39 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
Group No: 26
Authors:
Nithin Benny Myppan - 2016A7PS0014P
Adhitya Mamallan - 2016A7PS0028P
Swarup N - 2016A7PS0080P
Naveen Unnikrishnan - 2016A7PS0111P
*/
#include <stdio.h>
#include <stdlib.h>
#include "astDef.h"
// #include "semanticAnalyzerDef.h"
STSymbolTable* newSTSymbolTable(int nSlots);
int getHash(char* key, int nSlots);
void addSTSymbol(STSymbolTable* table, char* key, STSymbol* symbol);
STSymbolNode* getSymbol(char* key, STSymbolTable* lTable);
STTree* newSTTree();
STTreeNode* makeSTTreeNode(STTreeNode* parent, char* fnscope);
STScopeNest* newScopeNest();
void addToSTScopeNest(STTreeNode* parent, STTreeNode* node);
void traverseASTPostorder(ASTNode* node, STTreeNode* currScope, int* num, STTree globalTree);
STTree makeSymbolTables(AST ast);
STSymbol* makeSTSymbol(ASTNode* node, int num);
STSymbolNode* getInfoFromAST(ASTNode* node);
void setParentFn(ASTNode* node);
bool checkRecursion(ASTNode* node);
void sortSymbols(STSlotsList* list);
void sortSymbolsR(STSymbolNode* node, int n);
void displaySTTree(STTree tree);
void displaySTTreeTraversal(STTreeNode* node);
recordDef* makeRecordDef(AST ast);
recordDef* getRecord(char* name, recordTable* rTable);
void addRecordDef(recordTable* table, recordDef* record);
void printGlobalVars(STTree tree);
void printGlobalVarsTraversal(STTreeNode* node);
void printFnMemories(STTree tree);
void printFnMemoriesTraversal(STTreeNode* node);
void printTypeExpressionGlobalRecord(STTree tree);
void printRecordDefs();