-
Notifications
You must be signed in to change notification settings - Fork 0
/
astDefs.h
30 lines (27 loc) · 720 Bytes
/
astDefs.h
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
///////////////////////////////////////
// Author: Vishal Golcha
// Id: 2014B5A70717P
///////////////////////////////////////
#include <stdio.h>
#include <stdlib.h>
#include "parser.h"
#include "lexer.h"
typedef struct _ast_node ast_node;
struct _ast_node{
ast_node * child;
ast_node * sibling;
// link to sym table ??
int symb_no;
char * lexeme;
int line_num;
};
ast_node* makenode(tnode * x);
ast_node* make_ast(tnode *x);
int rem_redundant(int num);
int get_symb_no(char * x);
tnode * tree_pruner(tnode* x,int par);
void calculate_children(tnode* trv_node);
void ast_constructer(char *inp);
void inorder_final_ast(tnode* trv_node);
void ast_constructer_wo_print(char *inp);
extern int ast_count;