-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsemantic.h
34 lines (27 loc) · 827 Bytes
/
semantic.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
/*
Etapa 4 do trabalho de Compiladores (2017/1)
Professor: Marcelo Johann
Grupo:
Delton Vaz (00229779) (nick: ~davaz)
Flávio Keglevich (00229724)
*/
#ifndef SEMANTIC_H_
#define SEMANTIC_H_
#include "ast.h"
#define SYMBOL_LIT_INT 1
#define SYMBOL_LIT_REAL 2
#define SYMBOL_LIT_CHAR 3
#define SYMBOL_LIT_STRING 4
#define SYMBOL_LIT_TRUE 5
#define SYMBOL_LIT_FALSE 6
#define SYMBOL_IDENTIFIER 7
void semanticError(const char * msg, int lineNumber);
void checkDeclr(AST_NODE *node);
int compareDataTypes(int a, int b, int lineNumber);
int getDataTypeFromVarType(AST_NODE *node);
void checkParamPair(AST_NODE *declared, AST_NODE *called, int funcLineNumber);
int getExpressionDataType(AST_NODE *node);
void checkIdentifier(HASH_NODE *node);
void checkChildren(AST_NODE *node);
void checkProgram(AST_NODE *node);
#endif