@designliquido/delegua 0.8.0 → 0.9.0-0
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/bin/package.json +10 -2
- package/fontes/avaliador-sintatico/avaliador-sintatico-base.d.ts +2 -1
- package/fontes/avaliador-sintatico/avaliador-sintatico-base.js +3 -0
- package/fontes/avaliador-sintatico/avaliador-sintatico-base.js.map +1 -1
- package/fontes/avaliador-sintatico/avaliador-sintatico.d.ts +7 -5
- package/fontes/avaliador-sintatico/avaliador-sintatico.js +16 -1
- package/fontes/avaliador-sintatico/avaliador-sintatico.js.map +1 -1
- package/fontes/avaliador-sintatico/dialetos/avaliador-sintatico-egua-classico.d.ts +5 -4
- package/fontes/avaliador-sintatico/dialetos/avaliador-sintatico-egua-classico.js +3 -0
- package/fontes/avaliador-sintatico/dialetos/avaliador-sintatico-egua-classico.js.map +1 -1
- package/fontes/avaliador-sintatico/dialetos/avaliador-sintatico-eguap.d.ts +10 -9
- package/fontes/avaliador-sintatico/dialetos/avaliador-sintatico-eguap.js +12 -0
- package/fontes/avaliador-sintatico/dialetos/avaliador-sintatico-eguap.js.map +1 -1
- package/fontes/avaliador-sintatico/dialetos/avaliador-sintatico-visualg.d.ts +2 -2
- package/fontes/avaliador-sintatico/dialetos/avaliador-sintatico-visualg.js +17 -11
- package/fontes/avaliador-sintatico/dialetos/avaliador-sintatico-visualg.js.map +1 -1
- package/fontes/avaliador-sintatico/erro-avaliador-sintatico.d.ts +1 -1
- package/fontes/avaliador-sintatico/retornos/index.d.ts +3 -0
- package/fontes/avaliador-sintatico/retornos/index.js +20 -0
- package/fontes/avaliador-sintatico/retornos/index.js.map +1 -0
- package/fontes/avaliador-sintatico/retornos/retorno-declaracao.d.ts +3 -0
- package/fontes/avaliador-sintatico/retornos/retorno-declaracao.js +3 -0
- package/fontes/avaliador-sintatico/retornos/retorno-declaracao.js.map +1 -0
- package/fontes/avaliador-sintatico/retornos/retorno-primario.d.ts +3 -0
- package/fontes/avaliador-sintatico/retornos/retorno-primario.js +3 -0
- package/fontes/avaliador-sintatico/retornos/retorno-primario.js.map +1 -0
- package/fontes/avaliador-sintatico/retornos/retorno-resolver-declaracao.d.ts +2 -0
- package/fontes/avaliador-sintatico/retornos/retorno-resolver-declaracao.js +3 -0
- package/fontes/avaliador-sintatico/retornos/retorno-resolver-declaracao.js.map +1 -0
- package/fontes/bibliotecas/biblioteca-global.d.ts +2 -2
- package/fontes/bibliotecas/biblioteca-global.js +363 -134
- package/fontes/bibliotecas/biblioteca-global.js.map +1 -1
- package/fontes/bibliotecas/importar-biblioteca.d.ts +1 -1
- package/fontes/bibliotecas/importar-biblioteca.js +13 -14
- package/fontes/bibliotecas/importar-biblioteca.js.map +1 -1
- package/fontes/bibliotecas/primitivas-texto.js +13 -7
- package/fontes/bibliotecas/primitivas-texto.js.map +1 -1
- package/fontes/bibliotecas/primitivas-vetor.js +25 -11
- package/fontes/bibliotecas/primitivas-vetor.js.map +1 -1
- package/fontes/construtos/acesso-indice-variavel.d.ts +3 -3
- package/fontes/construtos/acesso-indice-variavel.js +41 -1
- package/fontes/construtos/acesso-indice-variavel.js.map +1 -1
- package/fontes/construtos/acesso-metodo.d.ts +3 -3
- package/fontes/construtos/acesso-metodo.js +41 -1
- package/fontes/construtos/acesso-metodo.js.map +1 -1
- package/fontes/construtos/agrupamento.d.ts +3 -3
- package/fontes/construtos/agrupamento.js +41 -1
- package/fontes/construtos/agrupamento.js.map +1 -1
- package/fontes/construtos/atribuicao-sobrescrita.d.ts +3 -2
- package/fontes/construtos/atribuicao-sobrescrita.js +41 -1
- package/fontes/construtos/atribuicao-sobrescrita.js.map +1 -1
- package/fontes/construtos/atribuir.d.ts +3 -3
- package/fontes/construtos/atribuir.js +41 -1
- package/fontes/construtos/atribuir.js.map +1 -1
- package/fontes/construtos/binario.d.ts +3 -3
- package/fontes/construtos/binario.js +41 -1
- package/fontes/construtos/binario.js.map +1 -1
- package/fontes/construtos/chamada.d.ts +3 -3
- package/fontes/construtos/chamada.js +41 -1
- package/fontes/construtos/chamada.js.map +1 -1
- package/fontes/construtos/conjunto.d.ts +3 -2
- package/fontes/construtos/conjunto.js +41 -1
- package/fontes/construtos/conjunto.js.map +1 -1
- package/fontes/construtos/construto.d.ts +1 -1
- package/fontes/construtos/dicionario.d.ts +3 -2
- package/fontes/construtos/dicionario.js +41 -1
- package/fontes/construtos/dicionario.js.map +1 -1
- package/fontes/construtos/funcao.d.ts +3 -3
- package/fontes/construtos/funcao.js +41 -1
- package/fontes/construtos/funcao.js.map +1 -1
- package/fontes/construtos/index.d.ts +18 -18
- package/fontes/construtos/isto.d.ts +3 -2
- package/fontes/construtos/isto.js +41 -1
- package/fontes/construtos/isto.js.map +1 -1
- package/fontes/construtos/literal.d.ts +4 -3
- package/fontes/construtos/literal.js +41 -1
- package/fontes/construtos/literal.js.map +1 -1
- package/fontes/construtos/logico.d.ts +3 -2
- package/fontes/construtos/logico.js +41 -1
- package/fontes/construtos/logico.js.map +1 -1
- package/fontes/construtos/super.d.ts +2 -2
- package/fontes/construtos/super.js +41 -1
- package/fontes/construtos/super.js.map +1 -1
- package/fontes/construtos/unario.d.ts +3 -2
- package/fontes/construtos/unario.js +41 -1
- package/fontes/construtos/unario.js.map +1 -1
- package/fontes/construtos/variavel.d.ts +3 -3
- package/fontes/construtos/variavel.js +41 -1
- package/fontes/construtos/variavel.js.map +1 -1
- package/fontes/construtos/vetor.d.ts +2 -1
- package/fontes/construtos/vetor.js +41 -1
- package/fontes/construtos/vetor.js.map +1 -1
- package/fontes/declaracoes/bloco.d.ts +3 -3
- package/fontes/declaracoes/bloco.js +41 -1
- package/fontes/declaracoes/bloco.js.map +1 -1
- package/fontes/declaracoes/classe.d.ts +3 -3
- package/fontes/declaracoes/classe.js +41 -1
- package/fontes/declaracoes/classe.js.map +1 -1
- package/fontes/declaracoes/continua.d.ts +3 -3
- package/fontes/declaracoes/continua.js +41 -1
- package/fontes/declaracoes/continua.js.map +1 -1
- package/fontes/declaracoes/declaracao.d.ts +2 -1
- package/fontes/declaracoes/declaracao.js +43 -3
- package/fontes/declaracoes/declaracao.js.map +1 -1
- package/fontes/declaracoes/enquanto.d.ts +4 -3
- package/fontes/declaracoes/enquanto.js +41 -1
- package/fontes/declaracoes/enquanto.js.map +1 -1
- package/fontes/declaracoes/escolha.d.ts +4 -3
- package/fontes/declaracoes/escolha.js +41 -1
- package/fontes/declaracoes/escolha.js.map +1 -1
- package/fontes/declaracoes/escreva.d.ts +1 -1
- package/fontes/declaracoes/escreva.js +41 -1
- package/fontes/declaracoes/escreva.js.map +1 -1
- package/fontes/declaracoes/expressao.d.ts +4 -4
- package/fontes/declaracoes/expressao.js +41 -1
- package/fontes/declaracoes/expressao.js.map +1 -1
- package/fontes/declaracoes/fazer.d.ts +3 -2
- package/fontes/declaracoes/fazer.js +41 -1
- package/fontes/declaracoes/fazer.js.map +1 -1
- package/fontes/declaracoes/funcao.d.ts +3 -3
- package/fontes/declaracoes/funcao.js +41 -1
- package/fontes/declaracoes/funcao.js.map +1 -1
- package/fontes/declaracoes/importar.d.ts +4 -3
- package/fontes/declaracoes/importar.js +41 -1
- package/fontes/declaracoes/importar.js.map +1 -1
- package/fontes/declaracoes/leia.d.ts +4 -4
- package/fontes/declaracoes/leia.js +44 -1
- package/fontes/declaracoes/leia.js.map +1 -1
- package/fontes/declaracoes/para.d.ts +3 -2
- package/fontes/declaracoes/para.js +41 -1
- package/fontes/declaracoes/para.js.map +1 -1
- package/fontes/declaracoes/retorna.d.ts +3 -3
- package/fontes/declaracoes/retorna.js +41 -1
- package/fontes/declaracoes/retorna.js.map +1 -1
- package/fontes/declaracoes/se.d.ts +3 -3
- package/fontes/declaracoes/se.js +41 -1
- package/fontes/declaracoes/se.js.map +1 -1
- package/fontes/declaracoes/sustar.d.ts +3 -3
- package/fontes/declaracoes/sustar.js +41 -1
- package/fontes/declaracoes/sustar.js.map +1 -1
- package/fontes/declaracoes/tente.d.ts +3 -3
- package/fontes/declaracoes/tente.js +41 -1
- package/fontes/declaracoes/tente.js.map +1 -1
- package/fontes/declaracoes/var.d.ts +4 -4
- package/fontes/declaracoes/var.js +41 -1
- package/fontes/declaracoes/var.js.map +1 -1
- package/fontes/delegua.d.ts +4 -4
- package/fontes/delegua.js +138 -63
- package/fontes/delegua.js.map +1 -1
- package/fontes/depuracao/cyrb53.js +6 -3
- package/fontes/depuracao/cyrb53.js.map +1 -1
- package/fontes/depuracao/servidor-depuracao.d.ts +4 -4
- package/fontes/depuracao/servidor-depuracao.js +199 -87
- package/fontes/depuracao/servidor-depuracao.js.map +1 -1
- package/fontes/espaco-variaveis.d.ts +1 -1
- package/fontes/espaco-variaveis.js +0 -1
- package/fontes/espaco-variaveis.js.map +1 -1
- package/fontes/estruturas/chamavel.js +1 -1
- package/fontes/estruturas/classe-padrao.d.ts +1 -1
- package/fontes/estruturas/classe-padrao.js.map +1 -1
- package/fontes/estruturas/delegua-classe.d.ts +4 -4
- package/fontes/estruturas/delegua-classe.js +5 -3
- package/fontes/estruturas/delegua-classe.js.map +1 -1
- package/fontes/estruturas/funcao-padrao.d.ts +2 -2
- package/fontes/estruturas/funcao-padrao.js +47 -3
- package/fontes/estruturas/funcao-padrao.js.map +1 -1
- package/fontes/estruturas/funcao.d.ts +5 -5
- package/fontes/estruturas/funcao.js +75 -24
- package/fontes/estruturas/funcao.js.map +1 -1
- package/fontes/estruturas/index.d.ts +9 -9
- package/fontes/estruturas/metodo-primitiva.d.ts +1 -1
- package/fontes/estruturas/modulo.d.ts +1 -1
- package/fontes/estruturas/modulo.js +1 -1
- package/fontes/estruturas/objeto-delegua-classe.d.ts +2 -2
- package/fontes/estruturas/objeto-delegua-classe.js +2 -2
- package/fontes/estruturas/objeto-delegua-classe.js.map +1 -1
- package/fontes/estruturas/objeto-padrao.js.map +1 -1
- package/fontes/excecoes/erro-em-tempo-de-execucao.d.ts +1 -1
- package/fontes/excecoes/erro-em-tempo-de-execucao.js.map +1 -1
- package/fontes/excecoes/index.d.ts +1 -1
- package/fontes/importador/importador.d.ts +1 -1
- package/fontes/importador/importador.js +3 -2
- package/fontes/importador/importador.js.map +1 -1
- package/fontes/importador/retorno-importador.d.ts +2 -2
- package/fontes/interfaces/avaliador-sintatico-interface.d.ts +5 -4
- package/fontes/interfaces/delegua-interface.d.ts +4 -4
- package/fontes/interfaces/escopo-execucao.d.ts +2 -2
- package/fontes/interfaces/importador-interface.d.ts +1 -1
- package/fontes/interfaces/interpretador-com-depuracao-interface.d.ts +6 -7
- package/fontes/interfaces/interpretador-interface.d.ts +6 -5
- package/fontes/interfaces/lexador-interface.d.ts +2 -2
- package/fontes/interfaces/parametro-interface.d.ts +1 -1
- package/fontes/interfaces/pilha-escopos-execucao-interface.d.ts +5 -5
- package/fontes/interfaces/resolvedor-interface.d.ts +5 -5
- package/fontes/interfaces/retornos/retorno-avaliador-sintatico.d.ts +2 -2
- package/fontes/interfaces/retornos/retorno-execucao-interface.d.ts +1 -1
- package/fontes/interfaces/retornos/retorno-interpretador.d.ts +1 -1
- package/fontes/interfaces/retornos/retorno-lexador.d.ts +3 -3
- package/fontes/interfaces/variavel-interface.d.ts +1 -1
- package/fontes/interpretador/dialetos/egua-classico.d.ts +31 -30
- package/fontes/interpretador/dialetos/egua-classico.js +922 -461
- package/fontes/interpretador/dialetos/egua-classico.js.map +1 -1
- package/fontes/interpretador/dialetos/index.js.map +1 -1
- package/fontes/interpretador/erro-interpretador.d.ts +1 -1
- package/fontes/interpretador/inferenciador.js.map +1 -1
- package/fontes/interpretador/interpretador-com-depuracao.d.ts +6 -6
- package/fontes/interpretador/interpretador-com-depuracao.js +280 -153
- package/fontes/interpretador/interpretador-com-depuracao.js.map +1 -1
- package/fontes/interpretador/interpretador.d.ts +44 -35
- package/fontes/interpretador/interpretador.js +1047 -535
- package/fontes/interpretador/interpretador.js.map +1 -1
- package/fontes/interpretador/pilha-escopos-execucao.js +16 -5
- package/fontes/interpretador/pilha-escopos-execucao.js.map +1 -1
- package/fontes/lexador/dialetos/index.js.map +1 -1
- package/fontes/lexador/dialetos/lexador-birl.d.ts +25 -0
- package/fontes/lexador/dialetos/lexador-birl.js +75 -0
- package/fontes/lexador/dialetos/lexador-birl.js.map +1 -0
- package/fontes/lexador/dialetos/lexador-egua-classico.js +3 -3
- package/fontes/lexador/dialetos/lexador-egua-classico.js.map +1 -1
- package/fontes/lexador/dialetos/lexador-eguap.d.ts +4 -4
- package/fontes/lexador/dialetos/lexador-eguap.js +15 -9
- package/fontes/lexador/dialetos/lexador-eguap.js.map +1 -1
- package/fontes/lexador/dialetos/lexador-visualg.d.ts +2 -2
- package/fontes/lexador/dialetos/lexador-visualg.js +6 -4
- package/fontes/lexador/dialetos/lexador-visualg.js.map +1 -1
- package/fontes/lexador/dialetos/palavras-reservadas/birl.d.ts +2 -0
- package/fontes/lexador/dialetos/palavras-reservadas/birl.js +4 -0
- package/fontes/lexador/dialetos/palavras-reservadas/birl.js.map +1 -0
- package/fontes/lexador/dialetos/palavras-reservadas/visualg.js +1 -1
- package/fontes/lexador/dialetos/palavras-reservadas/visualg.js.map +1 -1
- package/fontes/lexador/lexador-base-linha-unica.d.ts +3 -3
- package/fontes/lexador/lexador-base-linha-unica.js.map +1 -1
- package/fontes/lexador/lexador.js +2 -2
- package/fontes/lexador/lexador.js.map +1 -1
- package/fontes/lexador/palavras-reservadas.d.ts +22 -21
- package/fontes/lexador/palavras-reservadas.js +22 -21
- package/fontes/lexador/palavras-reservadas.js.map +1 -1
- package/fontes/lexador/simbolo.d.ts +1 -1
- package/fontes/lexador/simbolo.js +1 -1
- package/fontes/lexador/simbolo.js.map +1 -1
- package/fontes/quebras/index.js.map +1 -1
- package/fontes/resolvedor/dialetos/egua-classico.d.ts +25 -3
- package/fontes/resolvedor/dialetos/egua-classico.js +41 -1
- package/fontes/resolvedor/dialetos/egua-classico.js.map +1 -1
- package/fontes/resolvedor/dialetos/index.js.map +1 -1
- package/fontes/resolvedor/erro-resolvedor.d.ts +1 -1
- package/fontes/resolvedor/pilha-escopos.d.ts +1 -1
- package/fontes/resolvedor/pilha-escopos.js +2 -2
- package/fontes/resolvedor/pilha-escopos.js.map +1 -1
- package/fontes/resolvedor/retorno-resolvedor.d.ts +2 -2
- package/fontes/tipos-de-simbolos/birl.d.ts +18 -0
- package/fontes/tipos-de-simbolos/birl.js +21 -0
- package/fontes/tipos-de-simbolos/birl.js.map +1 -0
- package/fontes/tipos-de-simbolos/comum.js +15 -15
- package/fontes/tipos-de-simbolos/comum.js.map +1 -1
- package/fontes/tipos-de-simbolos/delegua.d.ts +2 -1
- package/fontes/tipos-de-simbolos/delegua.js +74 -73
- package/fontes/tipos-de-simbolos/delegua.js.map +1 -1
- package/fontes/tipos-de-simbolos/eguap.d.ts +1 -0
- package/fontes/tipos-de-simbolos/eguap.js +70 -69
- package/fontes/tipos-de-simbolos/eguap.js.map +1 -1
- package/fontes/tipos-de-simbolos/visualg.js +44 -44
- package/fontes/tipos-de-simbolos/visualg.js.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/jest.config.js +2 -2
- package/jest.config.js.map +1 -1
- package/package.json +10 -2
- package/testes/avaliador-sintatico.test.js +5 -5
- package/testes/avaliador-sintatico.test.js.map +1 -1
- package/testes/biblioteca-global.test.js +424 -181
- package/testes/biblioteca-global.test.js.map +1 -1
- package/testes/egua-classico/delegua.test.js.map +1 -1
- package/testes/egua-classico/interpretador.test.js +379 -163
- package/testes/egua-classico/interpretador.test.js.map +1 -1
- package/testes/egua-classico/resolvedor.test.js.map +1 -1
- package/testes/eguap/avaliador-sintatico.test.js +1 -5
- package/testes/eguap/avaliador-sintatico.test.js.map +1 -1
- package/testes/eguap/interpretador.test.js +388 -172
- package/testes/eguap/interpretador.test.js.map +1 -1
- package/testes/eguap/lexador.test.js +1 -1
- package/testes/eguap/lexador.test.js.map +1 -1
- package/testes/interpretador.test.js +876 -351
- package/testes/interpretador.test.js.map +1 -1
- package/fontes/tipos/avaliador-sintatico-egua-e-eguap-classico-returno-tipo.d.ts +0 -5
- package/fontes/tipos/avaliador-sintatico-egua-e-eguap-classico-returno-tipo.js +0 -3
- package/fontes/tipos/avaliador-sintatico-egua-e-eguap-classico-returno-tipo.js.map +0 -1
|
@@ -14,6 +14,42 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (_) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
17
53
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
54
|
exports.FuncaoPadrao = void 0;
|
|
19
55
|
var chamavel_1 = require("./chamavel");
|
|
@@ -29,11 +65,19 @@ var FuncaoPadrao = /** @class */ (function (_super) {
|
|
|
29
65
|
return _this;
|
|
30
66
|
}
|
|
31
67
|
FuncaoPadrao.prototype.chamar = function (argumentos, simbolo) {
|
|
32
|
-
this
|
|
33
|
-
|
|
68
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
69
|
+
return __generator(this, function (_a) {
|
|
70
|
+
switch (_a.label) {
|
|
71
|
+
case 0:
|
|
72
|
+
this.simbolo = simbolo;
|
|
73
|
+
return [4 /*yield*/, this.funcao.apply(this, argumentos)];
|
|
74
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
});
|
|
34
78
|
};
|
|
35
79
|
FuncaoPadrao.prototype.paraTexto = function () {
|
|
36
|
-
return
|
|
80
|
+
return '<função>';
|
|
37
81
|
};
|
|
38
82
|
return FuncaoPadrao;
|
|
39
83
|
}(chamavel_1.Chamavel));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"funcao-padrao.js","sourceRoot":"","sources":["../../../fontes/estruturas/funcao-padrao.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"funcao-padrao.js","sourceRoot":"","sources":["../../../fontes/estruturas/funcao-padrao.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAsC;AAEtC;;GAEG;AACH;IAAkC,gCAAQ;IAKtC,sBAAY,YAAoB,EAAE,MAAgB;QAAlD,YACI,iBAAO,SAGV;QAFG,KAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC;;IACzB,CAAC;IAEK,6BAAM,GAAZ,UAAa,UAAiB,EAAE,OAAY;;;;;wBACxC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;wBAChB,qBAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,EAAA;4BAAhD,sBAAO,SAAyC,EAAC;;;;KACpD;IAED,gCAAS,GAAT;QACI,OAAO,UAAU,CAAC;IACtB,CAAC;IACL,mBAAC;AAAD,CAAC,AAnBD,CAAkC,mBAAQ,GAmBzC;AAnBY,oCAAY"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Chamavel } from
|
|
2
|
-
import { InterpretadorInterface } from
|
|
3
|
-
import { ObjetoDeleguaClasse } from
|
|
4
|
-
import { Funcao } from
|
|
1
|
+
import { Chamavel } from './chamavel';
|
|
2
|
+
import { InterpretadorInterface } from '../interfaces';
|
|
3
|
+
import { ObjetoDeleguaClasse } from './objeto-delegua-classe';
|
|
4
|
+
import { Funcao } from '../construtos';
|
|
5
5
|
export declare class DeleguaFuncao extends Chamavel {
|
|
6
6
|
nome: string;
|
|
7
7
|
declaracao: Funcao;
|
|
@@ -10,6 +10,6 @@ export declare class DeleguaFuncao extends Chamavel {
|
|
|
10
10
|
constructor(nome: string, declaracao: Funcao, instancia?: ObjetoDeleguaClasse, eInicializador?: boolean);
|
|
11
11
|
aridade(): number;
|
|
12
12
|
paraTexto(): string;
|
|
13
|
-
chamar(interpretador: InterpretadorInterface, argumentos: any): any
|
|
13
|
+
chamar(interpretador: InterpretadorInterface, argumentos: any): Promise<any>;
|
|
14
14
|
definirInstancia(instancia: ObjetoDeleguaClasse): DeleguaFuncao;
|
|
15
15
|
}
|
|
@@ -14,6 +14,42 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (_) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
17
53
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
54
|
exports.DeleguaFuncao = void 0;
|
|
19
55
|
var chamavel_1 = require("./chamavel");
|
|
@@ -37,34 +73,49 @@ var DeleguaFuncao = /** @class */ (function (_super) {
|
|
|
37
73
|
};
|
|
38
74
|
DeleguaFuncao.prototype.paraTexto = function () {
|
|
39
75
|
if (this.nome === null)
|
|
40
|
-
return
|
|
76
|
+
return '<função>';
|
|
41
77
|
return "<fun\u00E7\u00E3o ".concat(this.nome, ">");
|
|
42
78
|
};
|
|
43
79
|
DeleguaFuncao.prototype.chamar = function (interpretador, argumentos) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
80
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
81
|
+
var ambiente, parametros, i, parametro, nome, valor, retornoBloco;
|
|
82
|
+
return __generator(this, function (_a) {
|
|
83
|
+
switch (_a.label) {
|
|
84
|
+
case 0:
|
|
85
|
+
ambiente = new espaco_variaveis_1.EspacoVariaveis();
|
|
86
|
+
parametros = this.declaracao.parametros;
|
|
87
|
+
if (parametros && parametros.length) {
|
|
88
|
+
for (i = 0; i < parametros.length; i++) {
|
|
89
|
+
parametro = parametros[i];
|
|
90
|
+
nome = parametro['nome'].lexema;
|
|
91
|
+
valor = argumentos[i];
|
|
92
|
+
if (argumentos[i] === null) {
|
|
93
|
+
valor = parametro['padrao']
|
|
94
|
+
? parametro['padrao'].valor
|
|
95
|
+
: null;
|
|
96
|
+
}
|
|
97
|
+
ambiente.valores[nome] = valor;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (this.instancia !== undefined) {
|
|
101
|
+
ambiente.valores['isto'] = {
|
|
102
|
+
valor: this.instancia,
|
|
103
|
+
tipo: 'objeto',
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
return [4 /*yield*/, interpretador.executarBloco(this.declaracao.corpo, ambiente)];
|
|
107
|
+
case 1:
|
|
108
|
+
retornoBloco = _a.sent();
|
|
109
|
+
if (retornoBloco instanceof quebras_1.RetornoQuebra) {
|
|
110
|
+
return [2 /*return*/, retornoBloco.valor];
|
|
111
|
+
}
|
|
112
|
+
if (this.eInicializador) {
|
|
113
|
+
return [2 /*return*/, this.instancia];
|
|
114
|
+
}
|
|
115
|
+
return [2 /*return*/, retornoBloco];
|
|
53
116
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
if (this.instancia !== undefined) {
|
|
58
|
-
ambiente.valores['isto'] = { valor: this.instancia, tipo: "objeto" };
|
|
59
|
-
}
|
|
60
|
-
var retornoBloco = interpretador.executarBloco(this.declaracao.corpo, ambiente);
|
|
61
|
-
if (retornoBloco instanceof quebras_1.RetornoQuebra) {
|
|
62
|
-
return retornoBloco.valor;
|
|
63
|
-
}
|
|
64
|
-
if (this.eInicializador) {
|
|
65
|
-
return this.instancia;
|
|
66
|
-
}
|
|
67
|
-
return retornoBloco;
|
|
117
|
+
});
|
|
118
|
+
});
|
|
68
119
|
};
|
|
69
120
|
DeleguaFuncao.prototype.definirInstancia = function (instancia) {
|
|
70
121
|
return new DeleguaFuncao(this.nome, this.declaracao, instancia, this.eInicializador);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"funcao.js","sourceRoot":"","sources":["../../../fontes/estruturas/funcao.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"funcao.js","sourceRoot":"","sources":["../../../fontes/estruturas/funcao.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAsC;AACtC,wDAAsD;AAGtD,sCAA2C;AAI3C;IAAmC,iCAAQ;IAMvC,uBACI,IAAY,EACZ,UAAkB,EAClB,SAA0C,EAC1C,cAAsB;QADtB,0BAAA,EAAA,qBAA0C;QAC1C,+BAAA,EAAA,sBAAsB;QAJ1B,YAMI,iBAAO,SAKV;QAJG,KAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,KAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,KAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,KAAI,CAAC,cAAc,GAAG,cAAc,CAAC;;IACzC,CAAC;IAED,+BAAO,GAAP;;QACI,OAAO,CAAA,MAAA,MAAA,IAAI,CAAC,UAAU,0CAAE,UAAU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AI,YAAY,YAAY,uBAAa,EAAE;4BACvC,sBAAO,YAAY,CAAC,KAAK,EAAC;yBAC7B;wBAED,IAAI,IAAI,CAAC,cAAc,EAAE;4BACrB,sBAAO,IAAI,CAAC,SAAS,EAAC;yBACzB;wBAED,sBAAO,YAAY,EAAC;;;;KACvB;IAED,wCAAgB,GAAhB,UAAiB,SAA8B;QAC3C,OAAO,IAAI,aAAa,CACpB,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,UAAU,EACf,SAAS,EACT,IAAI,CAAC,cAAc,CACtB,CAAC;IACN,CAAC;IACL,oBAAC;AAAD,CAAC,AA9ED,CAAmC,mBAAQ,GA8E1C;AA9EY,sCAAa"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
1
|
+
export * from './chamavel';
|
|
2
|
+
export * from './classe-padrao';
|
|
3
|
+
export * from './delegua-classe';
|
|
4
|
+
export * from './funcao-padrao';
|
|
5
|
+
export * from './funcao';
|
|
6
|
+
export * from './metodo-primitiva';
|
|
7
|
+
export * from './modulo';
|
|
8
|
+
export * from './objeto-delegua-classe';
|
|
9
|
+
export * from './objeto-padrao';
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DeleguaModulo = void 0;
|
|
4
4
|
var DeleguaModulo = /** @class */ (function () {
|
|
5
5
|
function DeleguaModulo(nome) {
|
|
6
|
-
this.nome = nome ||
|
|
6
|
+
this.nome = nome || '';
|
|
7
7
|
this.componentes = {};
|
|
8
8
|
}
|
|
9
9
|
DeleguaModulo.prototype.toString = function () {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SimboloInterface } from
|
|
2
|
-
import { DeleguaClasse } from
|
|
1
|
+
import { SimboloInterface } from '../interfaces';
|
|
2
|
+
import { DeleguaClasse } from './delegua-classe';
|
|
3
3
|
export declare class ObjetoDeleguaClasse {
|
|
4
4
|
classe: DeleguaClasse;
|
|
5
5
|
campos: any;
|
|
@@ -14,13 +14,13 @@ var ObjetoDeleguaClasse = /** @class */ (function () {
|
|
|
14
14
|
var metodo = this.classe.encontrarMetodo(simbolo.lexema);
|
|
15
15
|
if (metodo)
|
|
16
16
|
return metodo.definirInstancia(this);
|
|
17
|
-
throw new excecoes_1.ErroEmTempoDeExecucao(simbolo,
|
|
17
|
+
throw new excecoes_1.ErroEmTempoDeExecucao(simbolo, 'Método indefinido não recuperado.');
|
|
18
18
|
};
|
|
19
19
|
ObjetoDeleguaClasse.prototype.set = function (simbolo, valor) {
|
|
20
20
|
this.campos[simbolo.lexema] = valor;
|
|
21
21
|
};
|
|
22
22
|
ObjetoDeleguaClasse.prototype.toString = function () {
|
|
23
|
-
return
|
|
23
|
+
return '<Objeto ' + this.classe.nome + '>';
|
|
24
24
|
};
|
|
25
25
|
return ObjetoDeleguaClasse;
|
|
26
26
|
}());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objeto-delegua-classe.js","sourceRoot":"","sources":["../../../fontes/estruturas/objeto-delegua-classe.ts"],"names":[],"mappings":";;;AAAA,wCAAoD;AAIpD;IAII,6BAAY,WAAgB;QACxB,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;IACrB,CAAC;IAED,iCAAG,GAAH,UAAI,OAAyB;QACzB,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC5C,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;SACtC;QAED,
|
|
1
|
+
{"version":3,"file":"objeto-delegua-classe.js","sourceRoot":"","sources":["../../../fontes/estruturas/objeto-delegua-classe.ts"],"names":[],"mappings":";;;AAAA,wC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E;YAAvC,IAAA,WAAa,EAAZ,IAAI,QAAA,EAAE,KAAK,QAAA;YACnB,YAAY,IAAI,gBAAS,IAAI,eAAK,KAAK,OAAI,
|
|
1
|
+
{"version":3,"file":"objeto-padrao.js","sourceRoot":"","sources":["../../../fontes/estruturas/objeto-padrao.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH;IAGI,sBAAY,YAAoB;QAC5B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACrC,CAAC;IAED,gCAAS,GAAT;QACI,IAAI,YAAY,GAAG,wCAA4B,IAAI,CAAC,YAAY,QAAK,CAAC;QACtE,KAA4B,UAAoB,EAApB,KAAA,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAApB,cAAoB,EAApB,IAAoB,EAAE;YAAvC,IAAA,WAAa,EAAZ,IAAI,QAAA,EAAE,KAAK,QAAA;YACnB,YAAY,IAAI,gBAAS,IAAI,eAAK,KAAK,OAAI,CAAC;SAC/C;QACD,YAAY,IAAI,uBAAkB,CAAC;QACnC,OAAO,YAAY,CAAC;IACxB,CAAC;IACL,mBAAC;AAAD,CAAC,AAfD,IAeC;AAfY,oCAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"erro-em-tempo-de-execucao.js","sourceRoot":"","sources":["../../../fontes/excecoes/erro-em-tempo-de-execucao.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAEA;IAA2C,yCAAK;
|
|
1
|
+
{"version":3,"file":"erro-em-tempo-de-execucao.js","sourceRoot":"","sources":["../../../fontes/excecoes/erro-em-tempo-de-execucao.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAEA;IAA2C,yCAAK;IAK5C,+BAAY,OAA0B,EAAE,QAAiB,EAAE,KAAc;QAAzE,YACI,kBAAM,QAAQ,CAAC,SAKlB;QAJG,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,KAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;;IACjE,CAAC;IACL,4BAAC;AAAD,CAAC,AAZD,CAA2C,KAAK,GAY/C;AAZY,sDAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './erro-em-tempo-de-execucao';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AvaliadorSintaticoInterface, LexadorInterface } from '../interfaces';
|
|
2
|
-
import { ImportadorInterface } from
|
|
2
|
+
import { ImportadorInterface } from '../interfaces/importador-interface';
|
|
3
3
|
import { RetornoImportador } from './retorno-importador';
|
|
4
4
|
/**
|
|
5
5
|
* O Importador é responsável por manusear arquivos. Coordena as fases de lexação, avaliação sintática,
|
|
@@ -60,7 +60,8 @@ var Importador = /** @class */ (function () {
|
|
|
60
60
|
var dadosDoArquivo = fs.readFileSync(caminhoRelativoArquivo);
|
|
61
61
|
var conteudoDoArquivo = dadosDoArquivo
|
|
62
62
|
.toString()
|
|
63
|
-
.
|
|
63
|
+
.replace(sistemaOperacional.EOL, '\n')
|
|
64
|
+
.split('\n');
|
|
64
65
|
for (var linha = 0; linha < conteudoDoArquivo.length; linha++) {
|
|
65
66
|
conteudoDoArquivo[linha] += '\0';
|
|
66
67
|
}
|
|
@@ -74,7 +75,7 @@ var Importador = /** @class */ (function () {
|
|
|
74
75
|
nomeArquivo: nomeArquivo,
|
|
75
76
|
hashArquivo: hashArquivo,
|
|
76
77
|
retornoLexador: retornoLexador,
|
|
77
|
-
retornoAvaliadorSintatico: retornoAvaliadorSintatico
|
|
78
|
+
retornoAvaliadorSintatico: retornoAvaliadorSintatico,
|
|
78
79
|
};
|
|
79
80
|
};
|
|
80
81
|
return Importador;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"importador.js","sourceRoot":"","sources":["../../../fontes/importador/importador.ts"],"names":[],"mappings":";;;;;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AC,uBAAuB,CAAC,WAAW,CAAC,GAAG,iBAAiB,CAAC;SACjE;QAED,OAAO;YACH,WAAW,aAAA;YACX,WAAW,aAAA;YACX,cAAc,gBAAA;YACd,yBAAyB,2BAAA;SACP,CAAC;IAC3B,CAAC;IACL,iBAAC;AAAD,CAAC,AApED,IAoEC;AApEY,gCAAU"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RetornoAvaliadorSintatico } from
|
|
2
|
-
import { RetornoLexador } from
|
|
1
|
+
import { RetornoAvaliadorSintatico } from '../interfaces/retornos/retorno-avaliador-sintatico';
|
|
2
|
+
import { RetornoLexador } from '../interfaces/retornos/retorno-lexador';
|
|
3
3
|
export interface RetornoImportador {
|
|
4
4
|
nomeArquivo: string;
|
|
5
5
|
hashArquivo: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ErroAvaliadorSintatico } from '../avaliador-sintatico/erro-avaliador-sintatico';
|
|
2
2
|
import { RetornoAvaliadorSintatico } from './retornos/retorno-avaliador-sintatico';
|
|
3
3
|
import { Construto, Funcao } from '../construtos';
|
|
4
|
-
import { Classe, Continua, Enquanto, Escolha, Escreva, Expressao, Fazer, Funcao as FuncaoDeclaracao, Importar, Para, Retorna, Se, Sustar, Tente, Var } from '../declaracoes';
|
|
4
|
+
import { Classe, Continua, Enquanto, Escolha, Escreva, Expressao, Fazer, Funcao as FuncaoDeclaracao, Importar, Leia, Para, Retorna, Se, Sustar, Tente, Var } from '../declaracoes';
|
|
5
5
|
import { RetornoLexador } from './retornos/retorno-lexador';
|
|
6
6
|
import { SimboloInterface } from './simbolo-interface';
|
|
7
7
|
export interface AvaliadorSintaticoInterface {
|
|
@@ -32,13 +32,14 @@ export interface AvaliadorSintaticoInterface {
|
|
|
32
32
|
e(): Construto;
|
|
33
33
|
ou(): Construto;
|
|
34
34
|
atribuir(): Construto;
|
|
35
|
+
blocoEscopo(): any[];
|
|
35
36
|
expressao(): Construto;
|
|
37
|
+
declaracaoEnquanto(): Enquanto;
|
|
36
38
|
declaracaoEscreva(): Escreva;
|
|
37
39
|
declaracaoExpressao(): Expressao;
|
|
38
|
-
|
|
39
|
-
declaracaoSe(): Se;
|
|
40
|
-
declaracaoEnquanto(): Enquanto;
|
|
40
|
+
declaracaoLeia(): Leia;
|
|
41
41
|
declaracaoPara(): Para;
|
|
42
|
+
declaracaoSe(): Se;
|
|
42
43
|
declaracaoSustar(): Sustar;
|
|
43
44
|
declaracaoContinua(): Continua;
|
|
44
45
|
declaracaoRetorna(): Retorna;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RetornoImportador } from
|
|
2
|
-
import { AvaliadorSintaticoInterface, ImportadorInterface, InterpretadorComDepuracaoInterface, InterpretadorInterface, LexadorInterface, RetornoExecucaoInterface, SimboloInterface } from
|
|
1
|
+
import { RetornoImportador } from '../importador';
|
|
2
|
+
import { AvaliadorSintaticoInterface, ImportadorInterface, InterpretadorComDepuracaoInterface, InterpretadorInterface, LexadorInterface, RetornoExecucaoInterface, SimboloInterface } from '../interfaces';
|
|
3
3
|
export interface DeleguaInterface {
|
|
4
4
|
dialeto: string;
|
|
5
5
|
arquivosAbertos: {
|
|
@@ -15,8 +15,8 @@ export interface DeleguaInterface {
|
|
|
15
15
|
importador: ImportadorInterface;
|
|
16
16
|
versao(): string;
|
|
17
17
|
carregarArquivo(caminhoRelativoArquivo: string): void;
|
|
18
|
-
executar(retornoImportador: RetornoImportador): RetornoExecucaoInterface
|
|
19
|
-
executarUmaLinha(linha: string): RetornoExecucaoInterface
|
|
18
|
+
executar(retornoImportador: RetornoImportador): Promise<RetornoExecucaoInterface>;
|
|
19
|
+
executarUmaLinha(linha: string): Promise<RetornoExecucaoInterface>;
|
|
20
20
|
reportar(linha: number, onde: any, mensagem: string): void;
|
|
21
21
|
erro(simbolo: SimboloInterface, mensagemDeErro: string): void;
|
|
22
22
|
erroEmTempoDeExecucao(erro: any): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EspacoVariaveis } from
|
|
2
|
-
import { Declaracao } from
|
|
1
|
+
import { EspacoVariaveis } from '../espaco-variaveis';
|
|
2
|
+
import { Declaracao } from '../declaracoes';
|
|
3
3
|
export interface EscopoExecucao {
|
|
4
4
|
declaracoes: Declaracao[];
|
|
5
5
|
declaracaoAtual: number;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { Declaracao } from
|
|
2
|
-
import { PontoParada } from
|
|
3
|
-
import { InterpretadorInterface } from
|
|
1
|
+
import { Declaracao } from '../declaracoes';
|
|
2
|
+
import { PontoParada } from '../depuracao';
|
|
3
|
+
import { InterpretadorInterface } from './interpretador-interface';
|
|
4
4
|
export interface InterpretadorComDepuracaoInterface extends InterpretadorInterface {
|
|
5
5
|
comandoAdentrarEscopo: boolean;
|
|
6
6
|
comandoProximo: boolean;
|
|
7
7
|
pontoDeParadaAtivo: boolean;
|
|
8
8
|
pontosParada: PontoParada[];
|
|
9
|
-
interpretacaoApenasUmaInstrucao():
|
|
10
|
-
continuarInterpretacao():
|
|
11
|
-
|
|
12
|
-
proximoESair(): void;
|
|
9
|
+
interpretacaoApenasUmaInstrucao(): Promise<any>;
|
|
10
|
+
continuarInterpretacao(): Promise<any>;
|
|
11
|
+
proximoESair(): Promise<any>;
|
|
13
12
|
prepararParaDepuracao(declaracoes: Declaracao[]): void;
|
|
14
13
|
}
|
|
@@ -33,12 +33,12 @@ export interface InterpretadorInterface {
|
|
|
33
33
|
visitarExpressaoEnquanto(declaracao: Enquanto): any;
|
|
34
34
|
visitarExpressaoImportar(declaracao: Importar): any;
|
|
35
35
|
visitarExpressaoEscreva(declaracao: Escreva): any;
|
|
36
|
-
executarBloco(declaracoes: Declaracao[], ambiente?: EspacoVariaveis):
|
|
37
|
-
visitarExpressaoBloco(declaracao: Bloco):
|
|
38
|
-
visitarExpressaoVar(declaracao: Var):
|
|
36
|
+
executarBloco(declaracoes: Declaracao[], ambiente?: EspacoVariaveis): Promise<any>;
|
|
37
|
+
visitarExpressaoBloco(declaracao: Bloco): Promise<any>;
|
|
38
|
+
visitarExpressaoVar(declaracao: Var): Promise<any>;
|
|
39
39
|
visitarExpressaoContinua(declaracao?: Continua): ContinuarQuebra;
|
|
40
40
|
visitarExpressaoSustar(declaracao?: Sustar): SustarQuebra;
|
|
41
|
-
visitarExpressaoRetornar(declaracao: Retorna): RetornoQuebra
|
|
41
|
+
visitarExpressaoRetornar(declaracao: Retorna): Promise<RetornoQuebra>;
|
|
42
42
|
visitarExpressaoDeleguaFuncao(expressao: any): any;
|
|
43
43
|
visitarExpressaoAtribuicaoSobrescrita(expressao: any): void;
|
|
44
44
|
visitarExpressaoAcessoIndiceVariavel(expressao: any): any;
|
|
@@ -52,5 +52,6 @@ export interface InterpretadorInterface {
|
|
|
52
52
|
visitarExpressaoSuper(expressao: Super): any;
|
|
53
53
|
paraTexto(objeto: any): any;
|
|
54
54
|
executar(declaracao: Declaracao, mostrarResultado: boolean): any;
|
|
55
|
-
interpretar(declaracoes: Declaracao[], manterAmbiente?: boolean): RetornoInterpretador
|
|
55
|
+
interpretar(declaracoes: Declaracao[], manterAmbiente?: boolean): Promise<RetornoInterpretador>;
|
|
56
|
+
finalizacao(): void;
|
|
56
57
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RetornoLexador } from
|
|
2
|
-
import { SimboloInterface } from
|
|
1
|
+
import { RetornoLexador } from './retornos/retorno-lexador';
|
|
2
|
+
import { SimboloInterface } from './simbolo-interface';
|
|
3
3
|
export interface LexadorInterface {
|
|
4
4
|
simbolos: SimboloInterface[];
|
|
5
5
|
codigo: string | string[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DeleguaFuncao } from
|
|
2
|
-
import { EscopoExecucao } from
|
|
3
|
-
import { PilhaInterface } from
|
|
4
|
-
import { SimboloInterface } from
|
|
5
|
-
import { VariavelInterface } from
|
|
1
|
+
import { DeleguaFuncao } from '../estruturas';
|
|
2
|
+
import { EscopoExecucao } from './escopo-execucao';
|
|
3
|
+
import { PilhaInterface } from './pilha-interface';
|
|
4
|
+
import { SimboloInterface } from './simbolo-interface';
|
|
5
|
+
import { VariavelInterface } from './variavel-interface';
|
|
6
6
|
export interface PilhaEscoposExecucaoInterface extends PilhaInterface<EscopoExecucao> {
|
|
7
7
|
atribuirVariavel(simbolo: SimboloInterface, valor: any): void;
|
|
8
8
|
atribuirVariavelEm(distancia: number, simbolo: SimboloInterface, valor: any): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Construto } from
|
|
2
|
-
import { ErroResolvedor } from
|
|
3
|
-
import { PilhaEscopos } from
|
|
4
|
-
import { RetornoResolvedor } from
|
|
5
|
-
import { SimboloInterface } from
|
|
1
|
+
import { Construto } from '../construtos';
|
|
2
|
+
import { ErroResolvedor } from '../resolvedor/erro-resolvedor';
|
|
3
|
+
import { PilhaEscopos } from '../resolvedor/pilha-escopos';
|
|
4
|
+
import { RetornoResolvedor } from '../resolvedor/retorno-resolvedor';
|
|
5
|
+
import { SimboloInterface } from './simbolo-interface';
|
|
6
6
|
export interface ResolvedorInterface {
|
|
7
7
|
erros: ErroResolvedor[];
|
|
8
8
|
escopos: PilhaEscopos;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Declaracao } from
|
|
2
|
-
import { ErroAvaliadorSintatico } from
|
|
1
|
+
import { Declaracao } from '../../declaracoes';
|
|
2
|
+
import { ErroAvaliadorSintatico } from '../../avaliador-sintatico/erro-avaliador-sintatico';
|
|
3
3
|
export interface RetornoAvaliadorSintatico {
|
|
4
4
|
declaracoes: Declaracao[];
|
|
5
5
|
erros: ErroAvaliadorSintatico[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SimboloInterface } from
|
|
2
|
-
import { Pragma } from
|
|
3
|
-
import { ErroLexador } from
|
|
1
|
+
import { SimboloInterface } from '..';
|
|
2
|
+
import { Pragma } from '../../lexador/dialetos/pragma';
|
|
3
|
+
import { ErroLexador } from '../../lexador/erro-lexador';
|
|
4
4
|
export interface RetornoLexador {
|
|
5
5
|
simbolos: SimboloInterface[];
|
|
6
6
|
erros: ErroLexador[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export interface VariavelInterface {
|
|
2
2
|
valor: any;
|
|
3
|
-
tipo: 'texto' | 'número' |
|
|
3
|
+
tipo: 'texto' | 'número' | 'longo' | 'vetor' | 'dicionário' | 'nulo' | 'lógico' | 'função' | 'símbolo' | 'objeto';
|
|
4
4
|
}
|