-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodigos.h
91 lines (72 loc) · 2.18 KB
/
codigos.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/***************************************************************************************
* Projeto: Compilador - Linguagem FOCA *
* Autores: Bernardo de Araujo Mesquita Chaves *
* Claudio Sergio Forain Junior *
* Roque Elias Assumpcao Pinel *
* Periodo: 2007-01 *
***************************************************************************************/
#ifndef CODIGOS_H
#define CODIGOS_H
#include <iostream>
#include <cstdio>
#include <string>
using namespace std;
#define TAM_VALOR 20
typedef struct _SIMBOLO {
string nome,
tipo,
lin,
col;
int array;
bool cons;
struct _SIMBOLO *ant;
} SIMBOLO;
typedef struct _FUNCAO {
string nome,
retorno,
parametros;
struct _FUNCAO *ant;
} FUNCAO;
typedef struct _LOOP {
string b,
c;
bool sw;
struct _LOOP *ant;
} LOOP;
typedef struct _VAR {
string nome,
tipo;
struct _VAR *ant;
} VAR;
string inserir_funcao (string, string, string);
FUNCAO *busca_funcao (string);
FUNCAO *funcao_atual (void);
string inserir_var_global (string, string, string, string, int, bool);
SIMBOLO *busca_var_global (string);
string inserir_var_local (string, string, string, string, int, bool);
SIMBOLO *busca_var_local (string);
void eliminar_var_local (void);
void muda_instancia (bool);
const bool retorna_instancia (void);
void add_instancia (string);
string rem_instancia (void);
string nome_instancia (void);
string int_to_str (const int);
string double_to_str (const double);
string gera_temp (string);
string gera_rotulo (void);
string declara_temp (void);
void inserir_loop (string, string, bool);
void deletar_loop (void);
LOOP *valores_loop (void);
void inserir_for (string);
VAR *busca_var_for_atual (string);
VAR *busca_var_for_decla (string);
string declara_var_for (void);
void deletar_for (void);
void inserir_switch (string, string);
VAR *pegar_switch (void);
void deletar_switch (void);
string debug (const int);
string imprimir_var (SIMBOLO *);
#endif /* CODIGOS_H */