forked from coolsidd/Compiler-design
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassign_helpers.h
36 lines (27 loc) · 1.28 KB
/
assign_helpers.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
31
32
33
34
35
36
/*
Group 36
2017B4A70495P Manan Soni
2017B4A70549P Siddharth Singh
2017B4A70636P Nayan Khanna
2017B4A70740P Aditya Tulsyan
*/
#ifndef ASSIGN_HELPERS_H
#define ASSIGN_HELPERS_H
#include "type_exp_table.h"
#include "type_expression.h"
#include "parse_tree.h"
//Return type expression for fact non-terminal
type_expression *get_type_of_fact(type_exp_table *txp_table, Parse_tree_node *p);
//Return type expression for arithm-expr non-terminal
type_expression *get_type_of_arithm_expr(type_exp_table *txp_table, Parse_tree_node *p);
//Return type expression for term non-terminal
type_expression *get_type_of_term(type_exp_table *txp_table, Parse_tree_node *p);
type_expression *get_type_exp_of_expr(type_exp_table *txp_table, Parse_tree_node *p);
type_expression *get_type_of_var_lhs(type_exp_table *txp_table, Parse_tree_node *p);
//Checks dimensions for two rectangular arrays
bool check_rect_dimensions(rect_array_type r1, rect_array_type r2, Parse_tree_node *p,
char *t1, char *t2, char *operator, char *lexeme1, char *lexeme2);
//Checks dimensions for two jagged arrays
bool check_jagged_dimensions(jagged_array_type j1, jagged_array_type j2, Parse_tree_node *p,
char *t1, char *t2, char *operator, char *lexeme1, char *lexeme2);
#endif