@designliquido/lincones-sqlite 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/execucao.d.ts +1 -1
- package/execucao.js +52 -52
- package/execucao.js.map +1 -1
- package/fontes/avaliador-sintatico/avaliador-sintatico.d.ts +6 -15
- package/fontes/avaliador-sintatico/avaliador-sintatico.js +42 -261
- package/fontes/avaliador-sintatico/avaliador-sintatico.js.map +1 -1
- package/fontes/avaliador-sintatico/index.d.ts +1 -2
- package/fontes/avaliador-sintatico/index.js +5 -20
- package/fontes/avaliador-sintatico/index.js.map +1 -1
- package/fontes/comum/fontes/avaliador-sintatico/avaliador-sintatico-base.d.ts +36 -0
- package/{comum/fontes/avaliador-sintatico/avaliador-sintatico.js → fontes/comum/fontes/avaliador-sintatico/avaliador-sintatico-base.js} +444 -353
- package/fontes/comum/fontes/avaliador-sintatico/avaliador-sintatico-base.js.map +1 -0
- package/fontes/comum/fontes/avaliador-sintatico/avaliador-sintatico.d.ts +7 -0
- package/fontes/comum/fontes/avaliador-sintatico/avaliador-sintatico.js +12 -0
- package/fontes/comum/fontes/avaliador-sintatico/avaliador-sintatico.js.map +1 -0
- package/{comum → fontes/comum}/fontes/avaliador-sintatico/erro-avaliador-sintatico.d.ts +5 -5
- package/{comum → fontes/comum}/fontes/avaliador-sintatico/erro-avaliador-sintatico.js +11 -11
- package/fontes/comum/fontes/avaliador-sintatico/erro-avaliador-sintatico.js.map +1 -0
- package/fontes/comum/fontes/avaliador-sintatico/index.d.ts +3 -0
- package/{comum → fontes/comum}/fontes/avaliador-sintatico/index.js +19 -22
- package/fontes/comum/fontes/avaliador-sintatico/index.js.map +1 -0
- package/fontes/comum/fontes/comandos/alterar.d.ts +8 -0
- package/fontes/comum/fontes/comandos/alterar.js +14 -0
- package/fontes/comum/fontes/comandos/alterar.js.map +1 -0
- package/{comum → fontes/comum}/fontes/comandos/atualizar.d.ts +14 -14
- package/{comum → fontes/comum}/fontes/comandos/atualizar.js +13 -13
- package/fontes/comum/fontes/comandos/atualizar.js.map +1 -0
- package/{comum → fontes/comum}/fontes/comandos/comando.d.ts +6 -6
- package/{comum → fontes/comum}/fontes/comandos/comando.js +13 -13
- package/fontes/comum/fontes/comandos/comando.js.map +1 -0
- package/fontes/comum/fontes/comandos/criar.d.ts +8 -0
- package/{comum → fontes/comum}/fontes/comandos/criar.js +12 -12
- package/fontes/comum/fontes/comandos/criar.js.map +1 -0
- package/fontes/comum/fontes/comandos/excluir-entidade.d.ts +6 -0
- package/fontes/comum/fontes/comandos/excluir-entidade.js +13 -0
- package/fontes/comum/fontes/comandos/excluir-entidade.js.map +1 -0
- package/{comum → fontes/comum}/fontes/comandos/excluir.d.ts +6 -6
- package/{comum → fontes/comum}/fontes/comandos/excluir.js +12 -12
- package/fontes/comum/fontes/comandos/excluir.js.map +1 -0
- package/{comum → fontes/comum}/fontes/comandos/index.d.ts +8 -7
- package/{comum → fontes/comum}/fontes/comandos/index.js +24 -23
- package/fontes/comum/fontes/comandos/index.js.map +1 -0
- package/{comum → fontes/comum}/fontes/comandos/inserir.d.ts +8 -8
- package/{comum → fontes/comum}/fontes/comandos/inserir.js +13 -13
- package/fontes/comum/fontes/comandos/inserir.js.map +1 -0
- package/{comum → fontes/comum}/fontes/comandos/selecionar.d.ts +9 -9
- package/{comum → fontes/comum}/fontes/comandos/selecionar.js +14 -14
- package/fontes/comum/fontes/comandos/selecionar.js.map +1 -0
- package/{comum → fontes/comum}/fontes/construtos/coluna.d.ts +11 -11
- package/{comum → fontes/comum}/fontes/construtos/coluna.js +19 -15
- package/fontes/comum/fontes/construtos/coluna.js.map +1 -0
- package/{comum → fontes/comum}/fontes/construtos/condicao.d.ts +6 -6
- package/{comum → fontes/comum}/fontes/construtos/condicao.js +11 -11
- package/fontes/comum/fontes/construtos/condicao.js.map +1 -0
- package/{comum → fontes/comum}/fontes/construtos/index.d.ts +2 -1
- package/{comum → fontes/comum}/fontes/construtos/index.js +18 -17
- package/fontes/comum/fontes/construtos/index.js.map +1 -0
- package/fontes/comum/fontes/construtos/operacao-alteracao-tabela.d.ts +7 -0
- package/fontes/comum/fontes/construtos/operacao-alteracao-tabela.js +15 -0
- package/fontes/comum/fontes/construtos/operacao-alteracao-tabela.js.map +1 -0
- package/fontes/comum/fontes/construtos/restricao.d.ts +13 -0
- package/fontes/comum/fontes/construtos/restricao.js +19 -0
- package/fontes/comum/fontes/construtos/restricao.js.map +1 -0
- package/{comum → fontes/comum}/fontes/interfaces/avaliador-sintatico-interface.d.ts +14 -14
- package/{comum → fontes/comum}/fontes/interfaces/avaliador-sintatico-interface.js +2 -2
- package/fontes/comum/fontes/interfaces/avaliador-sintatico-interface.js.map +1 -0
- package/fontes/comum/fontes/interfaces/index.d.ts +3 -0
- package/fontes/comum/fontes/interfaces/index.js +20 -0
- package/fontes/comum/fontes/interfaces/index.js.map +1 -0
- package/fontes/comum/fontes/interfaces/lincones-interface.d.ts +3 -0
- package/{comum → fontes/comum}/fontes/interfaces/lincones-interface.js +2 -2
- package/fontes/comum/fontes/interfaces/lincones-interface.js.map +1 -0
- package/{comum → fontes/comum}/fontes/interfaces/retornos/index.d.ts +16 -16
- package/{comum → fontes/comum}/fontes/interfaces/retornos/index.js +2 -2
- package/fontes/comum/fontes/interfaces/retornos/index.js.map +1 -0
- package/{comum → fontes/comum}/fontes/interfaces/simbolo-interface.d.ts +6 -6
- package/{comum → fontes/comum}/fontes/interfaces/simbolo-interface.js +2 -2
- package/fontes/comum/fontes/interfaces/simbolo-interface.js.map +1 -0
- package/fontes/comum/fontes/lexador/index.d.ts +1 -0
- package/{comum/fontes/interfaces → fontes/comum/fontes/lexador}/index.js +17 -17
- package/fontes/comum/fontes/lexador/index.js.map +1 -0
- package/{comum/fontes/lexador/index.d.ts → fontes/comum/fontes/lexador/lexador.d.ts} +26 -26
- package/{comum/fontes/lexador/index.js → fontes/comum/fontes/lexador/lexador.js} +220 -220
- package/fontes/comum/fontes/lexador/lexador.js.map +1 -0
- package/{comum → fontes/comum}/fontes/lexador/simbolo.d.ts +9 -9
- package/{comum → fontes/comum}/fontes/lexador/simbolo.js +15 -15
- package/fontes/comum/fontes/lexador/simbolo.js.map +1 -0
- package/{comum → fontes/comum}/fontes/palavras-reservadas.d.ts +51 -40
- package/{comum → fontes/comum}/fontes/palavras-reservadas.js +56 -45
- package/fontes/comum/fontes/palavras-reservadas.js.map +1 -0
- package/{comum → fontes/comum}/fontes/tipos-de-simbolos.d.ts +57 -52
- package/{comum → fontes/comum}/fontes/tipos-de-simbolos.js +58 -53
- package/fontes/comum/fontes/tipos-de-simbolos.js.map +1 -0
- package/fontes/comum/fontes/tradutor/index.d.ts +32 -0
- package/{comum → fontes/comum}/fontes/tradutor/index.js +238 -183
- package/fontes/comum/fontes/tradutor/index.js.map +1 -0
- package/fontes/comum/index.d.ts +8 -0
- package/fontes/comum/index.js +25 -0
- package/fontes/comum/index.js.map +1 -0
- package/{comum → fontes/comum}/jest.config.d.ts +3 -3
- package/{comum → fontes/comum}/jest.config.js +11 -11
- package/fontes/comum/jest.config.js.map +1 -0
- package/{comum/execucao.d.ts → fontes/comum/testes/avaliador-sintatico.test.d.ts} +1 -1
- package/fontes/comum/testes/avaliador-sintatico.test.js +86 -0
- package/fontes/comum/testes/avaliador-sintatico.test.js.map +1 -0
- package/fontes/comum/testes/lexador.test.d.ts +1 -0
- package/fontes/comum/testes/lexador.test.js +83 -0
- package/fontes/comum/testes/lexador.test.js.map +1 -0
- package/fontes/comum/testes/tradutor.test.d.ts +1 -0
- package/fontes/comum/testes/tradutor.test.js +133 -0
- package/fontes/comum/testes/tradutor.test.js.map +1 -0
- package/fontes/infraestrutura/cliente-sqlite.d.ts +10 -10
- package/fontes/infraestrutura/cliente-sqlite.js +71 -71
- package/fontes/infraestrutura/cliente-sqlite.js.map +1 -1
- package/fontes/infraestrutura/index.d.ts +2 -2
- package/fontes/infraestrutura/index.js +18 -18
- package/fontes/infraestrutura/retorno-comando.d.ts +8 -8
- package/fontes/infraestrutura/retorno-comando.js +28 -28
- package/fontes/infraestrutura/retorno-comando.js.map +1 -1
- package/fontes/lincones-sqlite.d.ts +13 -13
- package/fontes/lincones-sqlite.js +28 -28
- package/fontes/lincones-sqlite.js.map +1 -1
- package/fontes/palavras-reservadas.d.ts +26 -26
- package/fontes/palavras-reservadas.js +31 -31
- package/fontes/palavras-reservadas.js.map +1 -1
- package/fontes/tradutor/index.d.ts +21 -19
- package/fontes/tradutor/index.js +152 -149
- package/fontes/tradutor/index.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +17 -17
- package/package.json +12 -12
- package/comum/execucao.js +0 -40
- package/comum/execucao.js.map +0 -1
- package/comum/fontes/avaliador-sintatico/avaliador-sintatico-base.d.ts +0 -15
- package/comum/fontes/avaliador-sintatico/avaliador-sintatico-base.js +0 -46
- package/comum/fontes/avaliador-sintatico/avaliador-sintatico-base.js.map +0 -1
- package/comum/fontes/avaliador-sintatico/avaliador-sintatico.d.ts +0 -16
- package/comum/fontes/avaliador-sintatico/avaliador-sintatico.js.map +0 -1
- package/comum/fontes/avaliador-sintatico/erro-avaliador-sintatico.js.map +0 -1
- package/comum/fontes/avaliador-sintatico/index.d.ts +0 -3
- package/comum/fontes/avaliador-sintatico/index.js.map +0 -1
- package/comum/fontes/comandos/alterar.d.ts +0 -13
- package/comum/fontes/comandos/alterar.js +0 -19
- package/comum/fontes/comandos/alterar.js.map +0 -1
- package/comum/fontes/comandos/atualizar.js.map +0 -1
- package/comum/fontes/comandos/comando.js.map +0 -1
- package/comum/fontes/comandos/criar.d.ts +0 -7
- package/comum/fontes/comandos/criar.js.map +0 -1
- package/comum/fontes/comandos/excluir.js.map +0 -1
- package/comum/fontes/comandos/index.js.map +0 -1
- package/comum/fontes/comandos/inserir.js.map +0 -1
- package/comum/fontes/comandos/selecionar.js.map +0 -1
- package/comum/fontes/construtos/coluna.js.map +0 -1
- package/comum/fontes/construtos/condicao.js.map +0 -1
- package/comum/fontes/construtos/index.js.map +0 -1
- package/comum/fontes/interfaces/avaliador-sintatico-interface.js.map +0 -1
- package/comum/fontes/interfaces/index.d.ts +0 -3
- package/comum/fontes/interfaces/index.js.map +0 -1
- package/comum/fontes/interfaces/lincones-interface.d.ts +0 -3
- package/comum/fontes/interfaces/lincones-interface.js.map +0 -1
- package/comum/fontes/interfaces/retornos/index.js.map +0 -1
- package/comum/fontes/interfaces/simbolo-interface.js.map +0 -1
- package/comum/fontes/lexador/index.js.map +0 -1
- package/comum/fontes/lexador/simbolo.js.map +0 -1
- package/comum/fontes/lincones.d.ts +0 -10
- package/comum/fontes/lincones.js +0 -21
- package/comum/fontes/lincones.js.map +0 -1
- package/comum/fontes/palavras-reservadas.js.map +0 -1
- package/comum/fontes/tipos-de-simbolos.js.map +0 -1
- package/comum/fontes/tradutor/index.d.ts +0 -20
- package/comum/fontes/tradutor/index.js.map +0 -1
- package/comum/index.d.ts +0 -1
- package/comum/index.js +0 -6
- package/comum/index.js.map +0 -1
- package/comum/jest.config.js.map +0 -1
- package/fontes/lexador/index.d.ts +0 -26
- package/fontes/lexador/index.js +0 -220
- package/fontes/lexador/index.js.map +0 -1
|
@@ -1,220 +1,220 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Lexador = void 0;
|
|
7
|
-
const simbolo_1 = require("./simbolo");
|
|
8
|
-
const palavras_reservadas_1 = __importDefault(require("../palavras-reservadas"));
|
|
9
|
-
const tipos_de_simbolos_1 = __importDefault(require("../tipos-de-simbolos"));
|
|
10
|
-
class Lexador {
|
|
11
|
-
eDigito(caractere) {
|
|
12
|
-
return caractere >= '0' && caractere <= '9';
|
|
13
|
-
}
|
|
14
|
-
eAlfabeto(caractere) {
|
|
15
|
-
const acentuacoes = [
|
|
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
|
-
return ((caractere >= 'a' && caractere <= 'z') ||
|
|
43
|
-
(caractere >= 'A' && caractere <= 'Z') ||
|
|
44
|
-
acentuacoes.includes(caractere));
|
|
45
|
-
}
|
|
46
|
-
eAlfabetoOuDigito(caractere) {
|
|
47
|
-
return this.eDigito(caractere) || this.eAlfabeto(caractere);
|
|
48
|
-
}
|
|
49
|
-
eFinalDoCodigo() {
|
|
50
|
-
return (this.eUltimaLinha() &&
|
|
51
|
-
this.codigo[this.codigo.length - 1].length <= this.atual);
|
|
52
|
-
}
|
|
53
|
-
eUltimaLinha() {
|
|
54
|
-
return this.linha >= this.codigo.length - 1;
|
|
55
|
-
}
|
|
56
|
-
eFinalDaLinha() {
|
|
57
|
-
if (this.codigo.length === this.linha) {
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
return this.atual >= this.codigo[this.linha].length;
|
|
61
|
-
}
|
|
62
|
-
simboloAtual() {
|
|
63
|
-
if (this.eFinalDaLinha())
|
|
64
|
-
return '\0';
|
|
65
|
-
return this.codigo[this.linha].charAt(this.atual);
|
|
66
|
-
}
|
|
67
|
-
avancar() {
|
|
68
|
-
this.atual += 1;
|
|
69
|
-
if (this.eFinalDaLinha() && !this.eUltimaLinha()) {
|
|
70
|
-
this.linha++;
|
|
71
|
-
this.atual = 0;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
proximoSimbolo() {
|
|
75
|
-
return this.codigo[this.linha].charAt(this.atual + 1);
|
|
76
|
-
}
|
|
77
|
-
simboloAnterior() {
|
|
78
|
-
return this.codigo[this.linha].charAt(this.atual - 1);
|
|
79
|
-
}
|
|
80
|
-
analisarNumero() {
|
|
81
|
-
while (this.eDigito(this.simboloAtual())) {
|
|
82
|
-
this.avancar();
|
|
83
|
-
}
|
|
84
|
-
if (this.simboloAtual() == '.' && this.eDigito(this.proximoSimbolo())) {
|
|
85
|
-
this.avancar();
|
|
86
|
-
while (this.eDigito(this.simboloAtual())) {
|
|
87
|
-
this.avancar();
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
const numeroCompleto = this.codigo[this.linha].substring(this.inicioSimbolo, this.atual);
|
|
91
|
-
this.adicionarSimbolo(tipos_de_simbolos_1.default.NUMERO, parseFloat(numeroCompleto));
|
|
92
|
-
}
|
|
93
|
-
analisarTexto(delimitador = '"') {
|
|
94
|
-
while (this.simboloAtual() !== delimitador && !this.eFinalDoCodigo()) {
|
|
95
|
-
this.avancar();
|
|
96
|
-
}
|
|
97
|
-
if (this.eFinalDoCodigo()) {
|
|
98
|
-
this.erros.push({
|
|
99
|
-
linha: this.linha + 1,
|
|
100
|
-
caractere: this.simboloAnterior(),
|
|
101
|
-
mensagem: 'Texto não finalizado.'
|
|
102
|
-
});
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
const valor = this.codigo[this.linha].substring(this.inicioSimbolo + 1, this.atual);
|
|
106
|
-
this.adicionarSimbolo(tipos_de_simbolos_1.default.TEXTO, valor);
|
|
107
|
-
}
|
|
108
|
-
adicionarSimbolo(tipo, literal = null) {
|
|
109
|
-
const texto = this.codigo[this.linha].substring(this.inicioSimbolo, this.atual);
|
|
110
|
-
this.simbolos.push(new simbolo_1.Simbolo(tipo, literal || texto, literal, this.linha + 1));
|
|
111
|
-
}
|
|
112
|
-
identificarPalavraChave() {
|
|
113
|
-
while (this.eAlfabetoOuDigito(this.simboloAtual())) {
|
|
114
|
-
this.avancar();
|
|
115
|
-
}
|
|
116
|
-
const codigo = this.codigo[this.linha].substring(this.inicioSimbolo, this.atual).toLowerCase();
|
|
117
|
-
const tipo = codigo in palavras_reservadas_1.default
|
|
118
|
-
? palavras_reservadas_1.default[codigo]
|
|
119
|
-
: tipos_de_simbolos_1.default.IDENTIFICADOR;
|
|
120
|
-
this.adicionarSimbolo(tipo);
|
|
121
|
-
}
|
|
122
|
-
analisarToken() {
|
|
123
|
-
const caractere = this.simboloAtual();
|
|
124
|
-
switch (caractere) {
|
|
125
|
-
// Esta sessão ignora espaços em branco na tokenização.
|
|
126
|
-
case ' ':
|
|
127
|
-
case '\0':
|
|
128
|
-
case '\r':
|
|
129
|
-
case '\t':
|
|
130
|
-
this.avancar();
|
|
131
|
-
break;
|
|
132
|
-
case ';':
|
|
133
|
-
this.adicionarSimbolo(tipos_de_simbolos_1.default.PONTO_VIRGULA, ';');
|
|
134
|
-
//this.linha++;
|
|
135
|
-
this.avancar();
|
|
136
|
-
break;
|
|
137
|
-
case '"':
|
|
138
|
-
this.avancar();
|
|
139
|
-
this.analisarTexto('"');
|
|
140
|
-
this.avancar();
|
|
141
|
-
break;
|
|
142
|
-
case "'":
|
|
143
|
-
this.avancar();
|
|
144
|
-
this.analisarTexto("'");
|
|
145
|
-
this.avancar();
|
|
146
|
-
break;
|
|
147
|
-
case '(':
|
|
148
|
-
this.adicionarSimbolo(tipos_de_simbolos_1.default.PARENTESE_ESQUERDO, '(');
|
|
149
|
-
this.avancar();
|
|
150
|
-
break;
|
|
151
|
-
case ')':
|
|
152
|
-
this.adicionarSimbolo(tipos_de_simbolos_1.default.PARENTESE_DIREITO, ')');
|
|
153
|
-
this.avancar();
|
|
154
|
-
break;
|
|
155
|
-
case ',':
|
|
156
|
-
this.adicionarSimbolo(tipos_de_simbolos_1.default.VIRGULA, ',');
|
|
157
|
-
this.avancar();
|
|
158
|
-
break;
|
|
159
|
-
case '=':
|
|
160
|
-
this.adicionarSimbolo(tipos_de_simbolos_1.default.IGUAL, '=');
|
|
161
|
-
this.avancar();
|
|
162
|
-
break;
|
|
163
|
-
case '*':
|
|
164
|
-
this.adicionarSimbolo(tipos_de_simbolos_1.default.TUDO, '*');
|
|
165
|
-
this.avancar();
|
|
166
|
-
break;
|
|
167
|
-
case '<':
|
|
168
|
-
this.avancar();
|
|
169
|
-
if (this.simboloAtual() === '=') {
|
|
170
|
-
this.adicionarSimbolo(tipos_de_simbolos_1.default.MENOR_IGUAL);
|
|
171
|
-
this.avancar();
|
|
172
|
-
}
|
|
173
|
-
else {
|
|
174
|
-
this.adicionarSimbolo(tipos_de_simbolos_1.default.MENOR);
|
|
175
|
-
}
|
|
176
|
-
break;
|
|
177
|
-
case '>':
|
|
178
|
-
this.avancar();
|
|
179
|
-
if (this.simboloAtual() === '=') {
|
|
180
|
-
this.adicionarSimbolo(tipos_de_simbolos_1.default.MAIOR_IGUAL);
|
|
181
|
-
this.avancar();
|
|
182
|
-
}
|
|
183
|
-
else {
|
|
184
|
-
this.adicionarSimbolo(tipos_de_simbolos_1.default.MAIOR);
|
|
185
|
-
}
|
|
186
|
-
break;
|
|
187
|
-
default:
|
|
188
|
-
if (this.eDigito(caractere))
|
|
189
|
-
this.analisarNumero();
|
|
190
|
-
else if (this.eAlfabeto(caractere))
|
|
191
|
-
this.identificarPalavraChave();
|
|
192
|
-
else {
|
|
193
|
-
this.erros.push({
|
|
194
|
-
linha: this.linha + 1,
|
|
195
|
-
caractere: caractere,
|
|
196
|
-
mensagem: 'Caractere inesperado.'
|
|
197
|
-
});
|
|
198
|
-
this.avancar();
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
mapear(codigo) {
|
|
203
|
-
this.inicioSimbolo = 0;
|
|
204
|
-
this.atual = 0;
|
|
205
|
-
this.linha = 0;
|
|
206
|
-
this.codigo = codigo || [''];
|
|
207
|
-
this.simbolos = [];
|
|
208
|
-
this.erros = [];
|
|
209
|
-
while (!this.eFinalDoCodigo()) {
|
|
210
|
-
this.inicioSimbolo = this.atual;
|
|
211
|
-
this.analisarToken();
|
|
212
|
-
}
|
|
213
|
-
return {
|
|
214
|
-
simbolos: this.simbolos,
|
|
215
|
-
erros: this.erros
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
exports.Lexador = Lexador;
|
|
220
|
-
//# sourceMappingURL=
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Lexador = void 0;
|
|
7
|
+
const simbolo_1 = require("./simbolo");
|
|
8
|
+
const palavras_reservadas_1 = __importDefault(require("../palavras-reservadas"));
|
|
9
|
+
const tipos_de_simbolos_1 = __importDefault(require("../tipos-de-simbolos"));
|
|
10
|
+
class Lexador {
|
|
11
|
+
eDigito(caractere) {
|
|
12
|
+
return caractere >= '0' && caractere <= '9';
|
|
13
|
+
}
|
|
14
|
+
eAlfabeto(caractere) {
|
|
15
|
+
const acentuacoes = [
|
|
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
|
+
return ((caractere >= 'a' && caractere <= 'z') ||
|
|
43
|
+
(caractere >= 'A' && caractere <= 'Z') ||
|
|
44
|
+
acentuacoes.includes(caractere));
|
|
45
|
+
}
|
|
46
|
+
eAlfabetoOuDigito(caractere) {
|
|
47
|
+
return this.eDigito(caractere) || this.eAlfabeto(caractere);
|
|
48
|
+
}
|
|
49
|
+
eFinalDoCodigo() {
|
|
50
|
+
return (this.eUltimaLinha() &&
|
|
51
|
+
this.codigo[this.codigo.length - 1].length <= this.atual);
|
|
52
|
+
}
|
|
53
|
+
eUltimaLinha() {
|
|
54
|
+
return this.linha >= this.codigo.length - 1;
|
|
55
|
+
}
|
|
56
|
+
eFinalDaLinha() {
|
|
57
|
+
if (this.codigo.length === this.linha) {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
return this.atual >= this.codigo[this.linha].length;
|
|
61
|
+
}
|
|
62
|
+
simboloAtual() {
|
|
63
|
+
if (this.eFinalDaLinha())
|
|
64
|
+
return '\0';
|
|
65
|
+
return this.codigo[this.linha].charAt(this.atual);
|
|
66
|
+
}
|
|
67
|
+
avancar() {
|
|
68
|
+
this.atual += 1;
|
|
69
|
+
if (this.eFinalDaLinha() && !this.eUltimaLinha()) {
|
|
70
|
+
this.linha++;
|
|
71
|
+
this.atual = 0;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
proximoSimbolo() {
|
|
75
|
+
return this.codigo[this.linha].charAt(this.atual + 1);
|
|
76
|
+
}
|
|
77
|
+
simboloAnterior() {
|
|
78
|
+
return this.codigo[this.linha].charAt(this.atual - 1);
|
|
79
|
+
}
|
|
80
|
+
analisarNumero() {
|
|
81
|
+
while (this.eDigito(this.simboloAtual())) {
|
|
82
|
+
this.avancar();
|
|
83
|
+
}
|
|
84
|
+
if (this.simboloAtual() == '.' && this.eDigito(this.proximoSimbolo())) {
|
|
85
|
+
this.avancar();
|
|
86
|
+
while (this.eDigito(this.simboloAtual())) {
|
|
87
|
+
this.avancar();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const numeroCompleto = this.codigo[this.linha].substring(this.inicioSimbolo, this.atual);
|
|
91
|
+
this.adicionarSimbolo(tipos_de_simbolos_1.default.NUMERO, parseFloat(numeroCompleto));
|
|
92
|
+
}
|
|
93
|
+
analisarTexto(delimitador = '"') {
|
|
94
|
+
while (this.simboloAtual() !== delimitador && !this.eFinalDoCodigo()) {
|
|
95
|
+
this.avancar();
|
|
96
|
+
}
|
|
97
|
+
if (this.eFinalDoCodigo()) {
|
|
98
|
+
this.erros.push({
|
|
99
|
+
linha: this.linha + 1,
|
|
100
|
+
caractere: this.simboloAnterior(),
|
|
101
|
+
mensagem: 'Texto não finalizado.'
|
|
102
|
+
});
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const valor = this.codigo[this.linha].substring(this.inicioSimbolo + 1, this.atual);
|
|
106
|
+
this.adicionarSimbolo(tipos_de_simbolos_1.default.TEXTO, valor);
|
|
107
|
+
}
|
|
108
|
+
adicionarSimbolo(tipo, literal = null) {
|
|
109
|
+
const texto = this.codigo[this.linha].substring(this.inicioSimbolo, this.atual);
|
|
110
|
+
this.simbolos.push(new simbolo_1.Simbolo(tipo, literal || texto, literal, this.linha + 1));
|
|
111
|
+
}
|
|
112
|
+
identificarPalavraChave() {
|
|
113
|
+
while (this.eAlfabetoOuDigito(this.simboloAtual())) {
|
|
114
|
+
this.avancar();
|
|
115
|
+
}
|
|
116
|
+
const codigo = this.codigo[this.linha].substring(this.inicioSimbolo, this.atual).toLowerCase();
|
|
117
|
+
const tipo = codigo in palavras_reservadas_1.default
|
|
118
|
+
? palavras_reservadas_1.default[codigo]
|
|
119
|
+
: tipos_de_simbolos_1.default.IDENTIFICADOR;
|
|
120
|
+
this.adicionarSimbolo(tipo);
|
|
121
|
+
}
|
|
122
|
+
analisarToken() {
|
|
123
|
+
const caractere = this.simboloAtual();
|
|
124
|
+
switch (caractere) {
|
|
125
|
+
// Esta sessão ignora espaços em branco na tokenização.
|
|
126
|
+
case ' ':
|
|
127
|
+
case '\0':
|
|
128
|
+
case '\r':
|
|
129
|
+
case '\t':
|
|
130
|
+
this.avancar();
|
|
131
|
+
break;
|
|
132
|
+
case ';':
|
|
133
|
+
this.adicionarSimbolo(tipos_de_simbolos_1.default.PONTO_VIRGULA, ';');
|
|
134
|
+
//this.linha++;
|
|
135
|
+
this.avancar();
|
|
136
|
+
break;
|
|
137
|
+
case '"':
|
|
138
|
+
this.avancar();
|
|
139
|
+
this.analisarTexto('"');
|
|
140
|
+
this.avancar();
|
|
141
|
+
break;
|
|
142
|
+
case "'":
|
|
143
|
+
this.avancar();
|
|
144
|
+
this.analisarTexto("'");
|
|
145
|
+
this.avancar();
|
|
146
|
+
break;
|
|
147
|
+
case '(':
|
|
148
|
+
this.adicionarSimbolo(tipos_de_simbolos_1.default.PARENTESE_ESQUERDO, '(');
|
|
149
|
+
this.avancar();
|
|
150
|
+
break;
|
|
151
|
+
case ')':
|
|
152
|
+
this.adicionarSimbolo(tipos_de_simbolos_1.default.PARENTESE_DIREITO, ')');
|
|
153
|
+
this.avancar();
|
|
154
|
+
break;
|
|
155
|
+
case ',':
|
|
156
|
+
this.adicionarSimbolo(tipos_de_simbolos_1.default.VIRGULA, ',');
|
|
157
|
+
this.avancar();
|
|
158
|
+
break;
|
|
159
|
+
case '=':
|
|
160
|
+
this.adicionarSimbolo(tipos_de_simbolos_1.default.IGUAL, '=');
|
|
161
|
+
this.avancar();
|
|
162
|
+
break;
|
|
163
|
+
case '*':
|
|
164
|
+
this.adicionarSimbolo(tipos_de_simbolos_1.default.TUDO, '*');
|
|
165
|
+
this.avancar();
|
|
166
|
+
break;
|
|
167
|
+
case '<':
|
|
168
|
+
this.avancar();
|
|
169
|
+
if (this.simboloAtual() === '=') {
|
|
170
|
+
this.adicionarSimbolo(tipos_de_simbolos_1.default.MENOR_IGUAL);
|
|
171
|
+
this.avancar();
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
this.adicionarSimbolo(tipos_de_simbolos_1.default.MENOR);
|
|
175
|
+
}
|
|
176
|
+
break;
|
|
177
|
+
case '>':
|
|
178
|
+
this.avancar();
|
|
179
|
+
if (this.simboloAtual() === '=') {
|
|
180
|
+
this.adicionarSimbolo(tipos_de_simbolos_1.default.MAIOR_IGUAL);
|
|
181
|
+
this.avancar();
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
this.adicionarSimbolo(tipos_de_simbolos_1.default.MAIOR);
|
|
185
|
+
}
|
|
186
|
+
break;
|
|
187
|
+
default:
|
|
188
|
+
if (this.eDigito(caractere))
|
|
189
|
+
this.analisarNumero();
|
|
190
|
+
else if (this.eAlfabeto(caractere))
|
|
191
|
+
this.identificarPalavraChave();
|
|
192
|
+
else {
|
|
193
|
+
this.erros.push({
|
|
194
|
+
linha: this.linha + 1,
|
|
195
|
+
caractere: caractere,
|
|
196
|
+
mensagem: 'Caractere inesperado.'
|
|
197
|
+
});
|
|
198
|
+
this.avancar();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
mapear(codigo) {
|
|
203
|
+
this.inicioSimbolo = 0;
|
|
204
|
+
this.atual = 0;
|
|
205
|
+
this.linha = 0;
|
|
206
|
+
this.codigo = codigo || [''];
|
|
207
|
+
this.simbolos = [];
|
|
208
|
+
this.erros = [];
|
|
209
|
+
while (!this.eFinalDoCodigo()) {
|
|
210
|
+
this.inicioSimbolo = this.atual;
|
|
211
|
+
this.analisarToken();
|
|
212
|
+
}
|
|
213
|
+
return {
|
|
214
|
+
simbolos: this.simbolos,
|
|
215
|
+
erros: this.erros
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
exports.Lexador = Lexador;
|
|
220
|
+
//# sourceMappingURL=lexador.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lexador.js","sourceRoot":"","sources":["../../../../../fontes/comum/fontes/lex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ACxB,CAAC;CACJ;AArQD,0BAqQC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { SimboloInterface } from '../interfaces';
|
|
2
|
-
export declare class Simbolo implements SimboloInterface {
|
|
3
|
-
lexema: string;
|
|
4
|
-
tipo: string;
|
|
5
|
-
literal: any;
|
|
6
|
-
linha: number;
|
|
7
|
-
constructor(tipo: string, lexema: string, literal: any, linha: number);
|
|
8
|
-
paraTexto(): string;
|
|
9
|
-
}
|
|
1
|
+
import { SimboloInterface } from '../interfaces';
|
|
2
|
+
export declare class Simbolo implements SimboloInterface {
|
|
3
|
+
lexema: string;
|
|
4
|
+
tipo: string;
|
|
5
|
+
literal: any;
|
|
6
|
+
linha: number;
|
|
7
|
+
constructor(tipo: string, lexema: string, literal: any, linha: number);
|
|
8
|
+
paraTexto(): string;
|
|
9
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Simbolo = void 0;
|
|
4
|
-
class Simbolo {
|
|
5
|
-
constructor(tipo, lexema, literal, linha) {
|
|
6
|
-
this.tipo = tipo;
|
|
7
|
-
this.lexema = lexema;
|
|
8
|
-
this.literal = literal;
|
|
9
|
-
this.linha = linha;
|
|
10
|
-
}
|
|
11
|
-
paraTexto() {
|
|
12
|
-
return this.tipo + ' ' + this.lexema + ' ' + this.literal;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.Simbolo = Simbolo;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Simbolo = void 0;
|
|
4
|
+
class Simbolo {
|
|
5
|
+
constructor(tipo, lexema, literal, linha) {
|
|
6
|
+
this.tipo = tipo;
|
|
7
|
+
this.lexema = lexema;
|
|
8
|
+
this.literal = literal;
|
|
9
|
+
this.linha = linha;
|
|
10
|
+
}
|
|
11
|
+
paraTexto() {
|
|
12
|
+
return this.tipo + ' ' + this.lexema + ' ' + this.literal;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.Simbolo = Simbolo;
|
|
16
16
|
//# sourceMappingURL=simbolo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simbolo.js","sourceRoot":"","sources":["../../../../../fontes/comum/fontes/lexador/simbolo.ts"],"names":[],"mappings":";;;AAEA,MAAa,OAAO;IAMhB,YACI,IAAY,EACZ,MAAc,EACd,OAAY,EACZ,KAAa;QAEb,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,SAAS;QACL,OAAO,IAAI,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC;IAC9D,CAAC;CACJ;AArBD,0BAqBC"}
|
|
@@ -1,40 +1,51 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
adicionar: string;
|
|
3
|
-
agrupar: string;
|
|
4
|
-
alterar: string;
|
|
5
|
-
atualizar: string;
|
|
6
|
-
auto: string;
|
|
7
|
-
coluna: string;
|
|
8
|
-
chave: string;
|
|
9
|
-
criar: string;
|
|
10
|
-
de: string;
|
|
11
|
-
definir: string;
|
|
12
|
-
distinto: string;
|
|
13
|
-
e: string;
|
|
14
|
-
entre: string;
|
|
15
|
-
em: string;
|
|
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
|
-
|
|
1
|
+
declare const _default: {
|
|
2
|
+
adicionar: string;
|
|
3
|
+
agrupar: string;
|
|
4
|
+
alterar: string;
|
|
5
|
+
atualizar: string;
|
|
6
|
+
auto: string;
|
|
7
|
+
coluna: string;
|
|
8
|
+
chave: string;
|
|
9
|
+
criar: string;
|
|
10
|
+
de: string;
|
|
11
|
+
definir: string;
|
|
12
|
+
distinto: string;
|
|
13
|
+
e: string;
|
|
14
|
+
entre: string;
|
|
15
|
+
em: string;
|
|
16
|
+
estrangeira: string;
|
|
17
|
+
excluir: string;
|
|
18
|
+
falso: string;
|
|
19
|
+
identidade: string;
|
|
20
|
+
incremento: string;
|
|
21
|
+
inserir: string;
|
|
22
|
+
inteiro: string;
|
|
23
|
+
logico: string;
|
|
24
|
+
lógico: string;
|
|
25
|
+
media: string;
|
|
26
|
+
nao: string;
|
|
27
|
+
não: string;
|
|
28
|
+
nulo: string;
|
|
29
|
+
onde: string;
|
|
30
|
+
ordenar: string;
|
|
31
|
+
para: string;
|
|
32
|
+
por: string;
|
|
33
|
+
primaria: string;
|
|
34
|
+
primária: string;
|
|
35
|
+
referencia: string;
|
|
36
|
+
renomear: string;
|
|
37
|
+
remover: string;
|
|
38
|
+
restricao: string;
|
|
39
|
+
restrição: string;
|
|
40
|
+
se: string;
|
|
41
|
+
selecionar: string;
|
|
42
|
+
tabela: string;
|
|
43
|
+
texto: string;
|
|
44
|
+
unica: string;
|
|
45
|
+
única: string;
|
|
46
|
+
valores: string;
|
|
47
|
+
verdadeiro: string;
|
|
48
|
+
visao: string;
|
|
49
|
+
visão: string;
|
|
50
|
+
};
|
|
51
|
+
export default _default;
|