@designliquido/delegua 0.2.10 → 0.3.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 +1 -1
- package/fontes/ambiente.d.ts +1 -14
- package/fontes/ambiente.js +1 -53
- package/fontes/ambiente.js.map +1 -1
- package/fontes/avaliador-sintatico/avaliador-sintatico.js +11 -11
- package/fontes/avaliador-sintatico/avaliador-sintatico.js.map +1 -1
- package/fontes/avaliador-sintatico/dialetos/avaliador-sintatico-egua-classico.js +7 -7
- package/fontes/avaliador-sintatico/dialetos/avaliador-sintatico-egua-classico.js.map +1 -1
- package/fontes/avaliador-sintatico/dialetos/avaliador-sintatico-eguap.js +8 -8
- package/fontes/avaliador-sintatico/dialetos/avaliador-sintatico-eguap.js.map +1 -1
- package/fontes/bibliotecas/biblioteca-global.d.ts +2 -2
- package/fontes/bibliotecas/biblioteca-global.js +15 -15
- package/fontes/bibliotecas/biblioteca-global.js.map +1 -1
- package/fontes/construtos/atribuir.d.ts +2 -2
- package/fontes/construtos/atribuir.js.map +1 -1
- package/fontes/construtos/chamada.d.ts +2 -1
- package/fontes/construtos/chamada.js.map +1 -1
- package/fontes/construtos/literal.d.ts +2 -1
- package/fontes/construtos/literal.js.map +1 -1
- package/fontes/construtos/variavel.d.ts +2 -2
- package/fontes/construtos/variavel.js.map +1 -1
- package/fontes/declaracoes/bloco.d.ts +2 -1
- package/fontes/declaracoes/bloco.js.map +1 -1
- package/fontes/declaracoes/escreva.d.ts +2 -1
- package/fontes/declaracoes/escreva.js.map +1 -1
- package/fontes/declaracoes/expressao.d.ts +2 -1
- package/fontes/declaracoes/expressao.js.map +1 -1
- package/fontes/declaracoes/funcao.d.ts +2 -2
- package/fontes/declaracoes/funcao.js.map +1 -1
- package/fontes/declaracoes/retorna.d.ts +2 -1
- package/fontes/declaracoes/retorna.js.map +1 -1
- package/fontes/declaracoes/se.d.ts +2 -1
- package/fontes/declaracoes/se.js.map +1 -1
- package/fontes/declaracoes/var.d.ts +2 -2
- package/fontes/declaracoes/var.js.map +1 -1
- package/fontes/delegua.d.ts +3 -2
- package/fontes/delegua.js +20 -8
- package/fontes/delegua.js.map +1 -1
- package/fontes/estruturas/delegua-classe.d.ts +14 -0
- package/fontes/estruturas/{classe.js → delegua-classe.js} +4 -4
- package/fontes/estruturas/delegua-classe.js.map +1 -0
- package/fontes/estruturas/funcao-padrao.d.ts +1 -1
- package/fontes/estruturas/funcao-padrao.js +1 -1
- package/fontes/estruturas/funcao-padrao.js.map +1 -1
- package/fontes/estruturas/funcao.d.ts +9 -7
- package/fontes/estruturas/funcao.js +20 -26
- package/fontes/estruturas/funcao.js.map +1 -1
- package/fontes/estruturas/index.d.ts +2 -2
- package/fontes/estruturas/index.js +2 -2
- package/fontes/estruturas/index.js.map +1 -1
- package/fontes/estruturas/{instancia.d.ts → objeto-delegua-classe.d.ts} +3 -2
- package/fontes/estruturas/objeto-delegua-classe.js +28 -0
- package/fontes/estruturas/objeto-delegua-classe.js.map +1 -0
- package/fontes/excecoes/index.d.ts +0 -3
- package/fontes/excecoes/index.js +0 -3
- package/fontes/excecoes/index.js.map +1 -1
- package/fontes/interfaces/delegua-interface.d.ts +2 -2
- package/fontes/interfaces/escopo-execucao.d.ts +7 -0
- package/fontes/interfaces/escopo-execucao.js +3 -0
- package/fontes/interfaces/escopo-execucao.js.map +1 -0
- package/fontes/interfaces/index.d.ts +1 -0
- package/fontes/interfaces/index.js +1 -0
- package/fontes/interfaces/index.js.map +1 -1
- package/fontes/interfaces/interpretador-interface.d.ts +6 -4
- package/fontes/interfaces/pilha-interface.d.ts +2 -2
- package/fontes/interfaces/retorno-execucao-interface.d.ts +11 -0
- package/fontes/interfaces/retorno-execucao-interface.js +3 -0
- package/fontes/interfaces/retorno-execucao-interface.js.map +1 -0
- package/fontes/interpretador/dialetos/egua-classico.d.ts +27 -19
- package/fontes/interpretador/dialetos/egua-classico.js +121 -139
- package/fontes/interpretador/dialetos/egua-classico.js.map +1 -1
- package/fontes/interpretador/interpretador.d.ts +38 -18
- package/fontes/interpretador/interpretador.js +146 -142
- package/fontes/interpretador/interpretador.js.map +1 -1
- package/fontes/interpretador/pilha-escopos-execucao.d.ts +20 -0
- package/fontes/interpretador/pilha-escopos-execucao.js +74 -0
- package/fontes/interpretador/pilha-escopos-execucao.js.map +1 -0
- package/fontes/lexador/dialetos/lexador-eguap.js +1 -1
- package/fontes/lexador/dialetos/lexador-eguap.js.map +1 -1
- package/fontes/lexador/lexador.js +1 -1
- package/fontes/lexador/lexador.js.map +1 -1
- package/fontes/quebras/index.d.ts +10 -0
- package/fontes/quebras/index.js +51 -0
- package/fontes/quebras/index.js.map +1 -0
- package/fontes/resolvedor/index.d.ts +4 -62
- package/fontes/resolvedor/index.js +18 -340
- package/fontes/resolvedor/index.js.map +1 -1
- package/fontes/resolvedor/resolvedor.d.ts +64 -0
- package/fontes/resolvedor/resolvedor.js +345 -0
- package/fontes/resolvedor/resolvedor.js.map +1 -0
- package/package.json +1 -1
- package/testes/biblioteca-global.test.js +15 -29
- package/testes/biblioteca-global.test.js.map +1 -1
- package/testes/egua-classico/interpretador.test.js +21 -41
- package/testes/egua-classico/interpretador.test.js.map +1 -1
- package/testes/interpretador.test.js +21 -41
- package/testes/interpretador.test.js.map +1 -1
- package/fontes/estruturas/classe.d.ts +0 -11
- package/fontes/estruturas/classe.js.map +0 -1
- package/fontes/estruturas/instancia.js +0 -28
- package/fontes/estruturas/instancia.js.map +0 -1
- package/fontes/excecoes/excecao-continuar.d.ts +0 -2
- package/fontes/excecoes/excecao-continuar.js +0 -27
- package/fontes/excecoes/excecao-continuar.js.map +0 -1
- package/fontes/excecoes/excecao-retornar.d.ts +0 -4
- package/fontes/excecoes/excecao-retornar.js +0 -30
- package/fontes/excecoes/excecao-retornar.js.map +0 -1
- package/fontes/excecoes/excecao-sustar.d.ts +0 -2
- package/fontes/excecoes/excecao-sustar.js +0 -27
- package/fontes/excecoes/excecao-sustar.js.map +0 -1
|
@@ -18,15 +18,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
exports.DeleguaFuncao = void 0;
|
|
19
19
|
var chamavel_1 = require("./chamavel");
|
|
20
20
|
var ambiente_1 = require("../ambiente");
|
|
21
|
-
var
|
|
21
|
+
var quebras_1 = require("../quebras");
|
|
22
22
|
var DeleguaFuncao = /** @class */ (function (_super) {
|
|
23
23
|
__extends(DeleguaFuncao, _super);
|
|
24
|
-
function DeleguaFuncao(nome, declaracao,
|
|
24
|
+
function DeleguaFuncao(nome, declaracao, instancia, eInicializador) {
|
|
25
|
+
if (instancia === void 0) { instancia = undefined; }
|
|
25
26
|
if (eInicializador === void 0) { eInicializador = false; }
|
|
26
27
|
var _this = _super.call(this) || this;
|
|
27
28
|
_this.nome = nome;
|
|
28
29
|
_this.declaracao = declaracao;
|
|
29
|
-
_this.
|
|
30
|
+
_this.instancia = instancia;
|
|
30
31
|
_this.eInicializador = eInicializador;
|
|
31
32
|
return _this;
|
|
32
33
|
}
|
|
@@ -40,40 +41,33 @@ var DeleguaFuncao = /** @class */ (function (_super) {
|
|
|
40
41
|
return "<fun\u00E7\u00E3o ".concat(this.nome, ">");
|
|
41
42
|
};
|
|
42
43
|
DeleguaFuncao.prototype.chamar = function (interpretador, argumentos) {
|
|
43
|
-
var ambiente = new ambiente_1.Ambiente(
|
|
44
|
+
var ambiente = new ambiente_1.Ambiente();
|
|
44
45
|
var parametros = this.declaracao.parametros;
|
|
45
46
|
if (parametros && parametros.length) {
|
|
46
47
|
for (var i = 0; i < parametros.length; i++) {
|
|
47
|
-
var
|
|
48
|
-
var nome =
|
|
48
|
+
var parametro = parametros[i];
|
|
49
|
+
var nome = parametro["nome"].lexema;
|
|
49
50
|
var valor = argumentos[i];
|
|
50
51
|
if (argumentos[i] === null) {
|
|
51
|
-
valor =
|
|
52
|
+
valor = parametro["padrao"] ? parametro["padrao"].valor : null;
|
|
52
53
|
}
|
|
53
|
-
ambiente.
|
|
54
|
+
ambiente.valores[nome] = valor;
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
if (this.instancia !== undefined) {
|
|
58
|
+
ambiente.valores['isto'] = this.instancia;
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
else {
|
|
66
|
-
throw erro;
|
|
67
|
-
}
|
|
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;
|
|
68
66
|
}
|
|
69
|
-
|
|
70
|
-
return this.ambienteAnterior.obterVariavelEm(0, "isto");
|
|
71
|
-
return null;
|
|
67
|
+
return retornoBloco;
|
|
72
68
|
};
|
|
73
|
-
DeleguaFuncao.prototype.
|
|
74
|
-
|
|
75
|
-
ambiente.definirVariavel("isto", instancia);
|
|
76
|
-
return new DeleguaFuncao(this.nome, this.declaracao, ambiente, this.eInicializador);
|
|
69
|
+
DeleguaFuncao.prototype.definirInstancia = function (instancia) {
|
|
70
|
+
return new DeleguaFuncao(this.nome, this.declaracao, instancia, this.eInicializador);
|
|
77
71
|
};
|
|
78
72
|
return DeleguaFuncao;
|
|
79
73
|
}(chamavel_1.Chamavel));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"funcao.js","sourceRoot":"","sources":["../../../fontes/estruturas/funcao.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAAsC;AACtC,wCAAuC;
|
|
1
|
+
{"version":3,"file":"funcao.js","sourceRoot":"","sources":["../../../fontes/estruturas/funcao.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAAsC;AACtC,wCAAuC;AAGvC,sCAA2C;AAG3C;IAAmC,iCAAQ;IAMvC,uBAAY,IAAY,EAAE,UAAkB,EAAE,SAA0C,EAAE,cAAsB;QAAlE,0BAAA,EAAA,qBAA0C;QAAE,+BAAA,EAAA,sBAAsB;QAAhH,YACI,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,0CAAE,MAAM,KAAI,CAAC,CAAC;IACpD,CAAC;IAED,iCAAS,GAAT;QACI,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI;YAAE,OAAO,UAAU,CAAC;QAC1C,OAAO,4BAAW,IAAI,CAAC,IAAI,MAAG,CAAC;IACnC,CAAC;IAED,8BAAM,GAAN,UAAO,aAAqC,EAAE,UAAe;QACzD,IAAI,QAAQ,GAAG,IAAI,mBAAQ,EAAE,CAAC;QAC9B,IAAI,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;QAE5C,IAAI,UAAU,IAAI,UAAU,CAAC,MAAM,EAAE;YACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACxC,IAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;gBAEhC,IAAM,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC;gBACtC,IAAI,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;gBAC1B,IAAI,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;oBACxB,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;iBAClE;gBAED,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;aAClC;SACJ;QAED,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,EAAE;YAC9B,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;SAC7C;QAED,IAAM,YAAY,GAAQ,aAAa,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACvF,IAAI,YAAY,YAAY,uBAAa,EAAE;YACvC,OAAO,YAAY,CAAC,KAAK,CAAC;SAC7B;QAED,IAAI,IAAI,CAAC,cAAc,EAAG;YACtB,OAAO,IAAI,CAAC,SAAS,CAAC;SACzB;QAED,OAAO,YAAY,CAAC;IAExB,CAAC;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,AAlED,CAAmC,mBAAQ,GAkE1C;AAlEY,sCAAa"}
|
|
@@ -15,9 +15,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./chamavel"), exports);
|
|
18
|
-
__exportStar(require("./classe"), exports);
|
|
18
|
+
__exportStar(require("./delegua-classe"), exports);
|
|
19
19
|
__exportStar(require("./funcao-padrao"), exports);
|
|
20
20
|
__exportStar(require("./funcao"), exports);
|
|
21
|
-
__exportStar(require("./
|
|
21
|
+
__exportStar(require("./objeto-delegua-classe"), exports);
|
|
22
22
|
__exportStar(require("./modulo"), exports);
|
|
23
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../fontes/estruturas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../fontes/estruturas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,mDAAiC;AACjC,kDAAgC;AAChC,2CAAyB;AACzB,0DAAwC;AACxC,2CAAyB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SimboloInterface } from "../interfaces";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { DeleguaClasse } from "./delegua-classe";
|
|
3
|
+
export declare class ObjetoDeleguaClasse {
|
|
4
|
+
classe: DeleguaClasse;
|
|
4
5
|
campos: any;
|
|
5
6
|
constructor(criarClasse: any);
|
|
6
7
|
get(simbolo: SimboloInterface): any;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ObjetoDeleguaClasse = void 0;
|
|
4
|
+
var excecoes_1 = require("../excecoes");
|
|
5
|
+
var ObjetoDeleguaClasse = /** @class */ (function () {
|
|
6
|
+
function ObjetoDeleguaClasse(criarClasse) {
|
|
7
|
+
this.classe = criarClasse;
|
|
8
|
+
this.campos = {};
|
|
9
|
+
}
|
|
10
|
+
ObjetoDeleguaClasse.prototype.get = function (simbolo) {
|
|
11
|
+
if (this.campos.hasOwnProperty(simbolo.lexema)) {
|
|
12
|
+
return this.campos[simbolo.lexema];
|
|
13
|
+
}
|
|
14
|
+
var metodo = this.classe.encontrarMetodo(simbolo.lexema);
|
|
15
|
+
if (metodo)
|
|
16
|
+
return metodo.definirInstancia(this);
|
|
17
|
+
throw new excecoes_1.ErroEmTempoDeExecucao(simbolo, "Método indefinido não recuperado.");
|
|
18
|
+
};
|
|
19
|
+
ObjetoDeleguaClasse.prototype.set = function (simbolo, valor) {
|
|
20
|
+
this.campos[simbolo.lexema] = valor;
|
|
21
|
+
};
|
|
22
|
+
ObjetoDeleguaClasse.prototype.toString = function () {
|
|
23
|
+
return "<Objeto " + this.classe.nome + ">";
|
|
24
|
+
};
|
|
25
|
+
return ObjetoDeleguaClasse;
|
|
26
|
+
}());
|
|
27
|
+
exports.ObjetoDeleguaClasse = ObjetoDeleguaClasse;
|
|
28
|
+
//# sourceMappingURL=objeto-delegua-classe.js.map
|
|
@@ -0,0 +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,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACzD,IAAI,MAAM;YAAE,OAAO,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAEjD,MAAM,IAAI,gCAAqB,CAAC,OAAO,EAAE,mCAAmC,CAAC,CAAC;IAClF,CAAC;IAED,iCAAG,GAAH,UAAI,OAAyB,EAAE,KAAU;QACrC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;IACxC,CAAC;IAED,sCAAQ,GAAR;QACI,OAAO,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,GAAG,CAAC;IAC/C,CAAC;IACL,0BAAC;AAAD,CAAC,AA3BD,IA2BC;AA3BY,kDAAmB"}
|
package/fontes/excecoes/index.js
CHANGED
|
@@ -14,8 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./excecao-sustar"), exports);
|
|
18
|
-
__exportStar(require("./excecao-continuar"), exports);
|
|
19
17
|
__exportStar(require("./erro-em-tempo-de-execucao"), exports);
|
|
20
|
-
__exportStar(require("./excecao-retornar"), exports);
|
|
21
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../fontes/excecoes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../fontes/excecoes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RetornoImportador } from "../importador";
|
|
2
|
-
import { AvaliadorSintaticoInterface, ImportadorInterface, InterpretadorInterface, LexadorInterface, ResolvedorInterface, SimboloInterface } from "../interfaces";
|
|
2
|
+
import { AvaliadorSintaticoInterface, ImportadorInterface, InterpretadorInterface, LexadorInterface, ResolvedorInterface, RetornoExecucaoInterface, SimboloInterface } from "../interfaces";
|
|
3
3
|
export interface DeleguaInterface {
|
|
4
4
|
nomeArquivo: string;
|
|
5
5
|
teveErro: boolean;
|
|
@@ -16,7 +16,7 @@ export interface DeleguaInterface {
|
|
|
16
16
|
versao(): string;
|
|
17
17
|
iniciarDelegua(): void;
|
|
18
18
|
carregarArquivo(caminhoRelativoArquivo: string): void;
|
|
19
|
-
executar(retornoImportador: RetornoImportador):
|
|
19
|
+
executar(retornoImportador: RetornoImportador): 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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escopo-execucao.js","sourceRoot":"","sources":["../../../fontes/interfaces/escopo-execucao.ts"],"names":[],"mappings":""}
|
|
@@ -21,5 +21,6 @@ __exportStar(require("./interpretador-interface"), exports);
|
|
|
21
21
|
__exportStar(require("./lexador-interface"), exports);
|
|
22
22
|
__exportStar(require("./pilha-interface"), exports);
|
|
23
23
|
__exportStar(require("./resolvedor-interface"), exports);
|
|
24
|
+
__exportStar(require("./retorno-execucao-interface"), exports);
|
|
24
25
|
__exportStar(require("./simbolo-interface"), exports);
|
|
25
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../fontes/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAAgD;AAChD,sDAAoC;AACpC,yDAAuC;AACvC,4DAA0C;AAC1C,sDAAoC;AACpC,oDAAkC;AAClC,yDAAuC;AACvC,sDAAoC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../fontes/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAAgD;AAChD,sDAAoC;AACpC,yDAAuC;AACvC,4DAA0C;AAC1C,sDAAoC;AACpC,oDAAkC;AAClC,yDAAuC;AACvC,+DAA6C;AAC7C,sDAAoC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { Ambiente } from "../ambiente";
|
|
2
2
|
import { Construto } from "../construtos";
|
|
3
|
+
import { Declaracao } from "../declaracoes";
|
|
3
4
|
import { RetornoInterpretador } from "../interpretador/retorno-interpretador";
|
|
5
|
+
import { EscopoExecucao } from "./escopo-execucao";
|
|
6
|
+
import { PilhaInterface } from "./pilha-interface";
|
|
4
7
|
export interface InterpretadorInterface {
|
|
5
8
|
diretorioBase: any;
|
|
6
|
-
global: Ambiente;
|
|
7
|
-
ambiente: Ambiente;
|
|
8
9
|
locais: Map<Construto, number>;
|
|
10
|
+
pilhaEscoposExecucao: PilhaInterface<EscopoExecucao>;
|
|
9
11
|
visitarExpressaoLiteral(expressao: any): any;
|
|
10
12
|
avaliar(expressao: any): any;
|
|
11
13
|
visitarExpressaoAgrupamento(expressao: any): any;
|
|
@@ -29,7 +31,7 @@ export interface InterpretadorInterface {
|
|
|
29
31
|
visitarExpressaoEnquanto(declaracao: any): any;
|
|
30
32
|
visitarExpressaoImportar(declaracao: any): any;
|
|
31
33
|
visitarExpressaoEscreva(declaracao: any): any;
|
|
32
|
-
executarBloco(declaracoes:
|
|
34
|
+
executarBloco(declaracoes: Declaracao[], ambiente?: Ambiente): void;
|
|
33
35
|
visitarExpressaoBloco(declaracao: any): null;
|
|
34
36
|
visitarExpressaoVar(declaracao: any): null;
|
|
35
37
|
visitarExpressaoContinua(declaracao?: any): void;
|
|
@@ -48,5 +50,5 @@ export interface InterpretadorInterface {
|
|
|
48
50
|
visitarExpressaoSuper(expressao: any): any;
|
|
49
51
|
paraTexto(objeto: any): any;
|
|
50
52
|
executar(declaracao: any, mostrarResultado: boolean): void;
|
|
51
|
-
interpretar(declaracoes:
|
|
53
|
+
interpretar(declaracoes: Declaracao[], manterAmbiente?: boolean): RetornoInterpretador;
|
|
52
54
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ErroAvaliadorSintatico } from "../avaliador-sintatico";
|
|
2
|
+
import { ErroInterpretador } from "../interpretador";
|
|
3
|
+
import { ErroLexador } from "../lexador/erro-lexador";
|
|
4
|
+
export interface RetornoExecucaoInterface {
|
|
5
|
+
erros: {
|
|
6
|
+
avaliadorSintatico: Array<ErroAvaliadorSintatico>;
|
|
7
|
+
lexador: Array<ErroLexador>;
|
|
8
|
+
interpretador: Array<ErroInterpretador>;
|
|
9
|
+
};
|
|
10
|
+
resultado: Array<String>;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retorno-execucao-interface.js","sourceRoot":"","sources":["../../../fontes/interfaces/retorno-execucao-interface.ts"],"names":[],"mappings":""}
|
|
@@ -2,10 +2,12 @@ import { Ambiente } from '../../ambiente';
|
|
|
2
2
|
import { Delegua } from '../../delegua';
|
|
3
3
|
import { DeleguaFuncao } from '../../estruturas/funcao';
|
|
4
4
|
import { InterpretadorInterface, SimboloInterface } from '../../interfaces';
|
|
5
|
-
import { Classe, Enquanto, Escolha, Escreva, Fazer, Funcao, Importar, Para, Se, Tente } from '../../declaracoes';
|
|
6
|
-
import { Construto, Super } from '../../construtos';
|
|
5
|
+
import { Classe, Declaracao, Enquanto, Escolha, Escreva, Expressao, Fazer, Funcao, Importar, Para, Se, Tente, Var } from '../../declaracoes';
|
|
6
|
+
import { Atribuir, Construto, Literal, Super, Variavel } from '../../construtos';
|
|
7
7
|
import { RetornoInterpretador } from '../retorno-interpretador';
|
|
8
8
|
import { ErroInterpretador } from '../erro-interpretador';
|
|
9
|
+
import { PilhaEscoposExecucao } from '../pilha-escopos-execucao';
|
|
10
|
+
import { ContinuarQuebra, RetornoQuebra, SustarQuebra } from '../../quebras';
|
|
9
11
|
/**
|
|
10
12
|
* O Interpretador visita todos os elementos complexos gerados pelo analisador sintático (Parser)
|
|
11
13
|
* e de fato executa a lógica de programação descrita no código.
|
|
@@ -13,40 +15,45 @@ import { ErroInterpretador } from '../erro-interpretador';
|
|
|
13
15
|
export declare class InterpretadorEguaClassico implements InterpretadorInterface {
|
|
14
16
|
Delegua: Delegua;
|
|
15
17
|
diretorioBase: any;
|
|
16
|
-
global: Ambiente;
|
|
17
|
-
ambiente: Ambiente;
|
|
18
18
|
locais: Map<Construto, number>;
|
|
19
19
|
erros: ErroInterpretador[];
|
|
20
|
+
pilhaEscoposExecucao: PilhaEscoposExecucao;
|
|
20
21
|
constructor(Delegua: Delegua, diretorioBase: string);
|
|
21
|
-
visitarExpressaoLiteral(expressao:
|
|
22
|
-
avaliar(expressao:
|
|
22
|
+
visitarExpressaoLiteral(expressao: Literal): any;
|
|
23
|
+
avaliar(expressao: Construto): any;
|
|
23
24
|
visitarExpressaoAgrupamento(expressao: any): any;
|
|
24
25
|
eVerdadeiro(objeto: any): boolean;
|
|
25
26
|
verificarOperandoNumero(operador: any, operand: any): void;
|
|
26
27
|
visitarExpressaoUnaria(expr: any): number | boolean;
|
|
27
28
|
eIgual(esquerda: any, direita: any): boolean;
|
|
28
29
|
verificarOperandosNumeros(operador: any, direita: any, esquerda: any): void;
|
|
29
|
-
visitarExpressaoBinaria(
|
|
30
|
+
visitarExpressaoBinaria(expressao: any): string | number | boolean;
|
|
30
31
|
visitarExpressaoDeChamada(expressao: any): any;
|
|
31
|
-
visitarExpressaoDeAtribuicao(expressao:
|
|
32
|
-
procurarVariavel(simbolo: SimboloInterface,
|
|
33
|
-
visitarExpressaoDeVariavel(expressao:
|
|
34
|
-
visitarDeclaracaoDeExpressao(declaracao:
|
|
32
|
+
visitarExpressaoDeAtribuicao(expressao: Atribuir): any;
|
|
33
|
+
procurarVariavel(simbolo: SimboloInterface, expressao: any): any;
|
|
34
|
+
visitarExpressaoDeVariavel(expressao: Variavel): any;
|
|
35
|
+
visitarDeclaracaoDeExpressao(declaracao: Expressao): any;
|
|
35
36
|
visitarExpressaoLogica(expressao: any): any;
|
|
36
37
|
visitarExpressaoSe(declaracao: Se): any;
|
|
37
38
|
visitarExpressaoPara(declaracao: Para): any;
|
|
38
39
|
visitarExpressaoFazer(declaracao: Fazer): void;
|
|
39
40
|
visitarExpressaoEscolha(declaracao: Escolha): void;
|
|
40
|
-
visitarExpressaoTente(declaracao: Tente):
|
|
41
|
+
visitarExpressaoTente(declaracao: Tente): any;
|
|
41
42
|
visitarExpressaoEnquanto(declaracao: Enquanto): any;
|
|
42
43
|
visitarExpressaoImportar(declaracao: Importar): any;
|
|
43
44
|
visitarExpressaoEscreva(declaracao: Escreva): any;
|
|
44
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Empilha declarações na pilha de escopos de execução, cria um novo ambiente e
|
|
47
|
+
* executa as declarações empilhadas.
|
|
48
|
+
* @param declaracoes Um vetor de declaracoes a ser executado.
|
|
49
|
+
* @param ambiente O ambiente de execução quando houver, como parâmetros, argumentos, etc.
|
|
50
|
+
*/
|
|
51
|
+
executarBloco(declaracoes: Declaracao[], ambiente?: Ambiente): any;
|
|
45
52
|
visitarExpressaoBloco(declaracao: any): any;
|
|
46
|
-
visitarExpressaoVar(declaracao:
|
|
47
|
-
visitarExpressaoContinua(declaracao?: any):
|
|
48
|
-
visitarExpressaoSustar(declaracao?: any):
|
|
49
|
-
visitarExpressaoRetornar(declaracao: any):
|
|
53
|
+
visitarExpressaoVar(declaracao: Var): any;
|
|
54
|
+
visitarExpressaoContinua(declaracao?: any): ContinuarQuebra;
|
|
55
|
+
visitarExpressaoSustar(declaracao?: any): SustarQuebra;
|
|
56
|
+
visitarExpressaoRetornar(declaracao: any): RetornoQuebra;
|
|
50
57
|
visitarExpressaoDeleguaFuncao(expressao: any): DeleguaFuncao;
|
|
51
58
|
visitarExpressaoAtribuicaoSobrescrita(expressao: any): void;
|
|
52
59
|
visitarExpressaoAcessoIndiceVariavel(expressao: any): any;
|
|
@@ -59,6 +66,7 @@ export declare class InterpretadorEguaClassico implements InterpretadorInterface
|
|
|
59
66
|
visitarExpressaoVetor(expressao: any): any[];
|
|
60
67
|
visitarExpressaoSuper(expressao: Super): any;
|
|
61
68
|
paraTexto(objeto: any): any;
|
|
62
|
-
executar(declaracao:
|
|
63
|
-
|
|
69
|
+
executar(declaracao: Declaracao, mostrarResultado?: boolean): void;
|
|
70
|
+
executarUltimoEscopo(): void;
|
|
71
|
+
interpretar(declaracoes: Declaracao[]): RetornoInterpretador;
|
|
64
72
|
}
|