@designliquido/delegua 0.1.0 → 0.1.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.
Files changed (193) hide show
  1. package/bin/delegua +2 -2
  2. package/bin/delegua.cmd +1 -1
  3. package/bin/package.json +51 -0
  4. package/index.js +27 -0
  5. package/index.js.map +1 -0
  6. package/package.json +4 -4
  7. package/src/ambiente.js +49 -0
  8. package/src/ambiente.js.map +1 -0
  9. package/src/avaliador-sintatico/dialetos/egua-classico.js +635 -0
  10. package/src/avaliador-sintatico/dialetos/egua-classico.js.map +1 -0
  11. package/src/avaliador-sintatico/dialetos/index.js +14 -0
  12. package/src/avaliador-sintatico/dialetos/index.js.map +1 -0
  13. package/src/avaliador-sintatico/index.js +635 -0
  14. package/src/avaliador-sintatico/index.js.map +1 -0
  15. package/src/avaliador-sintatico/parser-error.js +27 -0
  16. package/src/avaliador-sintatico/parser-error.js.map +1 -0
  17. package/src/bibliotecas/bibliotecaGlobal.js +97 -0
  18. package/src/bibliotecas/bibliotecaGlobal.js.map +1 -0
  19. package/src/bibliotecas/importarBiblioteca.js +32 -0
  20. package/src/bibliotecas/importarBiblioteca.js.map +1 -0
  21. package/src/construtos/assign-subscript.js +35 -0
  22. package/src/construtos/assign-subscript.js.map +1 -0
  23. package/src/construtos/atribuir.js +34 -0
  24. package/src/construtos/atribuir.js.map +1 -0
  25. package/src/construtos/binario.js +35 -0
  26. package/src/construtos/binario.js.map +1 -0
  27. package/src/construtos/call.js +35 -0
  28. package/src/construtos/call.js.map +1 -0
  29. package/src/construtos/conjunto.js +35 -0
  30. package/src/construtos/conjunto.js.map +1 -0
  31. package/src/construtos/dicionario.js +34 -0
  32. package/src/construtos/dicionario.js.map +1 -0
  33. package/src/construtos/expr.js +11 -0
  34. package/src/construtos/expr.js.map +1 -0
  35. package/src/construtos/funcao.js +34 -0
  36. package/src/construtos/funcao.js.map +1 -0
  37. package/src/construtos/get.js +34 -0
  38. package/src/construtos/get.js.map +1 -0
  39. package/src/construtos/grouping.js +33 -0
  40. package/src/construtos/grouping.js.map +1 -0
  41. package/src/construtos/index.js +31 -0
  42. package/src/construtos/index.js.map +1 -0
  43. package/src/construtos/isto.js +33 -0
  44. package/src/construtos/isto.js.map +1 -0
  45. package/src/construtos/literal.js +33 -0
  46. package/src/construtos/literal.js.map +1 -0
  47. package/src/construtos/logical.js +35 -0
  48. package/src/construtos/logical.js.map +1 -0
  49. package/src/construtos/subscript.js +35 -0
  50. package/src/construtos/subscript.js.map +1 -0
  51. package/src/construtos/super.js +34 -0
  52. package/src/construtos/super.js.map +1 -0
  53. package/src/construtos/unario.js +34 -0
  54. package/src/construtos/unario.js.map +1 -0
  55. package/src/construtos/variavel.js +33 -0
  56. package/src/construtos/variavel.js.map +1 -0
  57. package/src/construtos/vetor.js +33 -0
  58. package/src/construtos/vetor.js.map +1 -0
  59. package/src/declaracoes/index.js +249 -0
  60. package/src/declaracoes/index.js.map +1 -0
  61. package/src/delegua.js +129 -0
  62. package/src/delegua.js.map +1 -0
  63. package/src/estruturas/callable.js +16 -0
  64. package/src/estruturas/callable.js.map +1 -0
  65. package/src/estruturas/classe.js +57 -0
  66. package/src/estruturas/classe.js.map +1 -0
  67. package/src/estruturas/funcao-padrao.js +38 -0
  68. package/src/estruturas/funcao-padrao.js.map +1 -0
  69. package/src/estruturas/funcao.js +81 -0
  70. package/src/estruturas/funcao.js.map +1 -0
  71. package/src/estruturas/index.js +19 -0
  72. package/src/estruturas/index.js.map +1 -0
  73. package/src/estruturas/instancia.js +28 -0
  74. package/src/estruturas/instancia.js.map +1 -0
  75. package/src/estruturas/modulo.js +15 -0
  76. package/src/estruturas/modulo.js.map +1 -0
  77. package/src/excecoes/break-exception.js +27 -0
  78. package/src/excecoes/break-exception.js.map +1 -0
  79. package/src/excecoes/continue-exception.js +27 -0
  80. package/src/excecoes/continue-exception.js.map +1 -0
  81. package/src/excecoes/erro-em-tempo-de-execucao.js +31 -0
  82. package/src/excecoes/erro-em-tempo-de-execucao.js.map +1 -0
  83. package/src/excecoes/index.js +17 -0
  84. package/src/excecoes/index.js.map +1 -0
  85. package/src/excecoes/return-exception.js +30 -0
  86. package/src/excecoes/return-exception.js.map +1 -0
  87. package/src/interfaces/avaliador-sintatico-interface.js +3 -0
  88. package/src/interfaces/avaliador-sintatico-interface.js.map +1 -0
  89. package/src/interfaces/index.js +19 -0
  90. package/src/interfaces/index.js.map +1 -0
  91. package/src/interfaces/interpretador-interface.js +3 -0
  92. package/src/interfaces/interpretador-interface.js.map +1 -0
  93. package/src/interfaces/lexador-interface.js +3 -0
  94. package/src/interfaces/lexador-interface.js.map +1 -0
  95. package/src/interfaces/pilha-interface.js +3 -0
  96. package/src/interfaces/pilha-interface.js.map +1 -0
  97. package/src/interfaces/resolvedor-interface.js +3 -0
  98. package/src/interfaces/resolvedor-interface.js.map +1 -0
  99. package/src/interfaces/simbolo-interface.js +3 -0
  100. package/src/interfaces/simbolo-interface.js.map +1 -0
  101. package/src/interpretador/dialetos/egua-classico.js +656 -0
  102. package/src/interpretador/dialetos/egua-classico.js.map +1 -0
  103. package/src/interpretador/dialetos/index.js +14 -0
  104. package/src/interpretador/dialetos/index.js.map +1 -0
  105. package/src/interpretador/index.js +665 -0
  106. package/src/interpretador/index.js.map +1 -0
  107. package/src/lexador/dialetos/egua-classico.js +287 -0
  108. package/src/lexador/dialetos/egua-classico.js.map +1 -0
  109. package/src/lexador/dialetos/index.js +14 -0
  110. package/src/lexador/dialetos/index.js.map +1 -0
  111. package/src/lexador/index.js +287 -0
  112. package/src/lexador/index.js.map +1 -0
  113. package/src/resolvedor/Pilha.js +27 -0
  114. package/src/resolvedor/Pilha.js.map +1 -0
  115. package/src/resolvedor/ResolverError.js +29 -0
  116. package/src/resolvedor/ResolverError.js.map +1 -0
  117. package/src/resolvedor/{index.ts → dialetos/egua-classico.js} +147 -228
  118. package/src/resolvedor/dialetos/egua-classico.js.map +1 -0
  119. package/src/resolvedor/dialetos/index.js +14 -0
  120. package/src/resolvedor/dialetos/index.js.map +1 -0
  121. package/src/resolvedor/{dialetos/egua-classico.ts → index.js} +147 -228
  122. package/src/resolvedor/index.js.map +1 -0
  123. package/src/{tiposDeSimbolos.ts → tiposDeSimbolos.js} +5 -2
  124. package/src/tiposDeSimbolos.js.map +1 -0
  125. package/src/web.js +66 -0
  126. package/src/web.js.map +1 -0
  127. package/.github/CONTRIBUTING.md +0 -37
  128. package/.github/workflows/principal.yml +0 -22
  129. package/.release-it.json +0 -9
  130. package/.vscode/launch.json +0 -64
  131. package/.vscode/settings.json +0 -3
  132. package/LICENSE +0 -21
  133. package/babel.config.js +0 -1
  134. package/index.ts +0 -29
  135. package/src/ambiente.ts +0 -56
  136. package/src/avaliador-sintatico/dialetos/egua-classico.ts +0 -983
  137. package/src/avaliador-sintatico/dialetos/index.ts +0 -1
  138. package/src/avaliador-sintatico/index.ts +0 -983
  139. package/src/avaliador-sintatico/parser-error.ts +0 -1
  140. package/src/bibliotecas/bibliotecaGlobal.ts +0 -171
  141. package/src/bibliotecas/importarBiblioteca.ts +0 -32
  142. package/src/construtos/assign-subscript.ts +0 -19
  143. package/src/construtos/atribuir.ts +0 -17
  144. package/src/construtos/binario.ts +0 -19
  145. package/src/construtos/call.ts +0 -19
  146. package/src/construtos/conjunto.ts +0 -19
  147. package/src/construtos/dicionario.ts +0 -17
  148. package/src/construtos/expr.ts +0 -3
  149. package/src/construtos/funcao.ts +0 -17
  150. package/src/construtos/get.ts +0 -17
  151. package/src/construtos/grouping.ts +0 -15
  152. package/src/construtos/index.ts +0 -18
  153. package/src/construtos/isto.ts +0 -15
  154. package/src/construtos/literal.ts +0 -15
  155. package/src/construtos/logical.ts +0 -19
  156. package/src/construtos/subscript.ts +0 -19
  157. package/src/construtos/super.ts +0 -17
  158. package/src/construtos/unario.ts +0 -17
  159. package/src/construtos/variavel.ts +0 -15
  160. package/src/construtos/vetor.ts +0 -15
  161. package/src/declaracoes/index.ts +0 -243
  162. package/src/delegua.ts +0 -156
  163. package/src/estruturas/callable.ts +0 -11
  164. package/src/estruturas/classe.ts +0 -47
  165. package/src/estruturas/funcao-padrao.ts +0 -22
  166. package/src/estruturas/funcao.ts +0 -70
  167. package/src/estruturas/index.ts +0 -6
  168. package/src/estruturas/instancia.ts +0 -30
  169. package/src/estruturas/modulo.ts +0 -11
  170. package/src/excecoes/break-exception.ts +0 -1
  171. package/src/excecoes/continue-exception.ts +0 -1
  172. package/src/excecoes/erro-em-tempo-de-execucao.ts +0 -11
  173. package/src/excecoes/index.ts +0 -4
  174. package/src/excecoes/return-exception.ts +0 -10
  175. package/src/interfaces/avaliador-sintatico-interface.ts +0 -58
  176. package/src/interfaces/index.ts +0 -6
  177. package/src/interfaces/interpretador-interface.ts +0 -52
  178. package/src/interfaces/lexador-interface.ts +0 -24
  179. package/src/interfaces/pilha-interface.ts +0 -7
  180. package/src/interfaces/resolvedor-interface.ts +0 -49
  181. package/src/interfaces/simbolo-interface.ts +0 -6
  182. package/src/interpretador/dialetos/egua-classico.ts +0 -825
  183. package/src/interpretador/dialetos/index.ts +0 -1
  184. package/src/interpretador/index.ts +0 -825
  185. package/src/lexador/dialetos/egua-classico.ts +0 -333
  186. package/src/lexador/dialetos/index.ts +0 -1
  187. package/src/lexador/index.ts +0 -333
  188. package/src/resolvedor/Pilha.ts +0 -29
  189. package/src/resolvedor/ResolverError.ts +0 -8
  190. package/src/resolvedor/dialetos/index.ts +0 -1
  191. package/src/web.ts +0 -75
  192. package/testes/testes.egua +0 -630
  193. package/tsconfig.json +0 -11
package/src/delegua.js ADDED
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Delegua = void 0;
4
+ var fs = require("fs");
5
+ var caminho = require("path");
6
+ var readline = require("readline");
7
+ var lexador_1 = require("./lexador");
8
+ var avaliador_sintatico_1 = require("./avaliador-sintatico");
9
+ var resolvedor_1 = require("./resolvedor");
10
+ var interpretador_1 = require("./interpretador");
11
+ var tiposDeSimbolos_1 = require("./tiposDeSimbolos");
12
+ var excecoes_1 = require("./excecoes");
13
+ var egua_classico_1 = require("./interpretador/dialetos/egua-classico");
14
+ var egua_classico_2 = require("./resolvedor/dialetos/egua-classico");
15
+ var egua_classico_3 = require("./avaliador-sintatico/dialetos/egua-classico");
16
+ var egua_classico_4 = require("./lexador/dialetos/egua-classico");
17
+ var Delegua = /** @class */ (function () {
18
+ function Delegua(dialeto, nomeArquivo) {
19
+ if (dialeto === void 0) { dialeto = 'delegua'; }
20
+ this.nomeArquivo = nomeArquivo;
21
+ this.teveErro = false;
22
+ this.teveErroEmTempoDeExecucao = false;
23
+ this.dialeto = dialeto;
24
+ switch (this.dialeto) {
25
+ case 'egua':
26
+ this.interpretador = new egua_classico_1.InterpretadorEguaClassico(this, process.cwd());
27
+ this.lexador = new egua_classico_4.LexerEguaClassico(this);
28
+ this.avaliadorSintatico = new egua_classico_3.ParserEguaClassico(this);
29
+ this.resolvedor = new egua_classico_2.ResolverEguaClassico(this, this.interpretador);
30
+ console.log('Usando dialeto: Égua');
31
+ break;
32
+ case 'eguac':
33
+ this.interpretador = new interpretador_1.Interpretador(this, process.cwd());
34
+ this.lexador = new lexador_1.Lexer(this);
35
+ this.avaliadorSintatico = new avaliador_sintatico_1.Parser(this);
36
+ this.resolvedor = new resolvedor_1.Resolver(this, this.interpretador);
37
+ console.log('Usando dialeto: ÉguaC');
38
+ break;
39
+ case 'eguap':
40
+ this.interpretador = new interpretador_1.Interpretador(this, process.cwd());
41
+ this.lexador = new lexador_1.Lexer(this);
42
+ this.avaliadorSintatico = new avaliador_sintatico_1.Parser(this);
43
+ this.resolvedor = new resolvedor_1.Resolver(this, this.interpretador);
44
+ console.log('Usando dialeto: ÉguaP');
45
+ break;
46
+ default:
47
+ this.interpretador = new interpretador_1.Interpretador(this, process.cwd());
48
+ this.lexador = new lexador_1.Lexer(this);
49
+ this.avaliadorSintatico = new avaliador_sintatico_1.Parser(this);
50
+ this.resolvedor = new resolvedor_1.Resolver(this, this.interpretador);
51
+ console.log('Usando dialeto: padrão');
52
+ break;
53
+ }
54
+ }
55
+ Delegua.prototype.versao = function () {
56
+ return JSON.parse(fs.readFileSync('./package.json', { encoding: 'utf8' })).version || '';
57
+ };
58
+ Delegua.prototype.iniciarDelegua = function () {
59
+ var _this = this;
60
+ var interpretador = new interpretador_1.Interpretador(this, process.cwd());
61
+ console.log("Console da Linguagem Del\u00E9gua v".concat(this.versao()));
62
+ var leiaLinha = readline.createInterface({
63
+ input: process.stdin,
64
+ output: process.stdout,
65
+ prompt: "\ndelegua> "
66
+ });
67
+ leiaLinha.prompt();
68
+ leiaLinha.on("line", function (linha) {
69
+ _this.teveErro = false;
70
+ _this.teveErroEmTempoDeExecucao = false;
71
+ _this.run(linha);
72
+ leiaLinha.prompt();
73
+ });
74
+ };
75
+ Delegua.prototype.carregarArquivo = function (nomeArquivo) {
76
+ this.nomeArquivo = caminho.basename(nomeArquivo);
77
+ var dadosDoArquivo = fs.readFileSync(nomeArquivo).toString();
78
+ this.run(dadosDoArquivo);
79
+ if (this.teveErro)
80
+ process.exit(65);
81
+ if (this.teveErroEmTempoDeExecucao)
82
+ process.exit(70);
83
+ };
84
+ Delegua.prototype.run = function (codigo) {
85
+ var simbolos = this.lexador.scan(codigo);
86
+ if (this.teveErro === true)
87
+ return;
88
+ var declaracoes = this.avaliadorSintatico.analisar(simbolos);
89
+ if (this.teveErro === true)
90
+ return;
91
+ this.resolvedor.resolver(declaracoes);
92
+ if (this.teveErro === true)
93
+ return;
94
+ this.interpretador.interpretar(declaracoes);
95
+ };
96
+ Delegua.prototype.reportar = function (linha, onde, mensagem) {
97
+ if (this.nomeArquivo)
98
+ console.error("[Arquivo: ".concat(this.nomeArquivo, "] [Linha: ").concat(linha, "] Erro").concat(onde, ": ").concat(mensagem));
99
+ else
100
+ console.error("[Linha: ".concat(linha, "] Erro").concat(onde, ": ").concat(mensagem));
101
+ this.teveErro = true;
102
+ };
103
+ Delegua.prototype.erro = function (simbolo, mensagemDeErro) {
104
+ if (simbolo.tipo === tiposDeSimbolos_1.default.EOF) {
105
+ this.reportar(simbolo.line, " no final", mensagemDeErro);
106
+ }
107
+ else {
108
+ this.reportar(simbolo.line, " no '".concat(simbolo.lexema, "'"), mensagemDeErro);
109
+ }
110
+ };
111
+ Delegua.prototype.lexerError = function (linha, caractere, mensagem) {
112
+ this.reportar(linha, " no '".concat(caractere, "'"), mensagem);
113
+ };
114
+ Delegua.prototype.erroEmTempoDeExecucao = function (erro) {
115
+ if (erro & erro.simbolo && erro.simbolo.linha) {
116
+ if (this.nomeArquivo)
117
+ console.error("Erro: [Arquivo: ".concat(this.nomeArquivo, "] [Linha: ").concat(erro.simbolo.linha, "] ").concat(erro.mensagem));
118
+ else
119
+ console.error("Erro: [Linha: ".concat(erro.simbolo.linha, "] ").concat(erro.mensagem));
120
+ }
121
+ else if (!(erro instanceof excecoes_1.ReturnException)) { // TODO: Ao se livrar de ReturnException, remover isto.
122
+ console.error("Erro: ".concat(erro.mensagem));
123
+ }
124
+ this.teveErroEmTempoDeExecucao = true;
125
+ };
126
+ return Delegua;
127
+ }());
128
+ exports.Delegua = Delegua;
129
+ //# sourceMappingURL=delegua.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delegua.js","sourceRoot":"","sources":["../../src/delegua.ts"],"names":[],"mappings":";;;AAAA,uBAAyB;AACzB,8BAAgC;AAChC,mCAAqC;AAErC,qCAAkC;AAClC,6DAA+C;AAC/C,2CAAwC;AACxC,iDAAgD;AAChD,qDAAgD;AAEhD,uCAA6C;AAG7C,wEAAmF;AACnF,qEAA2E;AAC3E,8EAAkF;AAClF,kEAAqE;AAErE;IAWI,iBAAY,OAA2B,EAAE,WAAoB;QAAjD,wBAAA,EAAA,mBAA2B;QACnC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAE/B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,yBAAyB,GAAG,KAAK,CAAC;QAEvC,IAAI,C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AC1C,CAAC;IACL,cAAC;AAAD,CAAC,AAtID,IAsIC;AAtIY,0BAAO"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Callable = void 0;
4
+ var Callable = /** @class */ (function () {
5
+ function Callable() {
6
+ }
7
+ Callable.prototype.aridade = function () {
8
+ return this.valorAridade;
9
+ };
10
+ Callable.prototype.chamar = function (interpretador, argumentos, simbolo) {
11
+ throw new Error("Este método não deveria ser chamado.");
12
+ };
13
+ return Callable;
14
+ }());
15
+ exports.Callable = Callable;
16
+ //# sourceMappingURL=callable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callable.js","sourceRoot":"","sources":["../../../src/estruturas/callable.ts"],"names":[],"mappings":";;;AAAA;IAAA;IAUA,CAAC;IAPG,0BAAO,GAAP;QACI,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED,yBAAM,GAAN,UAAO,aAAmB,EAAE,UAAgB,EAAE,OAAa;QACvD,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC5D,CAAC;IACL,eAAC;AAAD,CAAC,AAVD,IAUC;AAVY,4BAAQ"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.DeleguaClasse = void 0;
19
+ var callable_1 = require("./callable");
20
+ var instancia_1 = require("./instancia");
21
+ var DeleguaClasse = /** @class */ (function (_super) {
22
+ __extends(DeleguaClasse, _super);
23
+ function DeleguaClasse(nome, superClasse, metodos) {
24
+ var _this = _super.call(this) || this;
25
+ _this.nome = nome;
26
+ _this.superClasse = superClasse;
27
+ _this.metodos = metodos;
28
+ return _this;
29
+ }
30
+ DeleguaClasse.prototype.encontrarMetodo = function (nome) {
31
+ if (this.metodos.hasOwnProperty(nome)) {
32
+ return this.metodos[nome];
33
+ }
34
+ if (this.superClasse !== null) {
35
+ return this.superClasse.encontrarMetodo(nome);
36
+ }
37
+ return undefined;
38
+ };
39
+ DeleguaClasse.prototype.toString = function () {
40
+ return "<classe ".concat(this.nome, ">");
41
+ };
42
+ DeleguaClasse.prototype.aridade = function () {
43
+ var inicializador = this.encontrarMetodo("construtor");
44
+ return inicializador ? inicializador.aridade() : 0;
45
+ };
46
+ DeleguaClasse.prototype.chamar = function (interpretador, argumentos) {
47
+ var instancia = new instancia_1.DeleguaInstancia(this);
48
+ var inicializador = this.encontrarMetodo("construtor");
49
+ if (inicializador) {
50
+ inicializador.bind(instancia).call(interpretador, argumentos);
51
+ }
52
+ return instancia;
53
+ };
54
+ return DeleguaClasse;
55
+ }(callable_1.Callable));
56
+ exports.DeleguaClasse = DeleguaClasse;
57
+ //# sourceMappingURL=classe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classe.js","sourceRoot":"","sources":["../../../src/estruturas/classe.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAAsC;AACtC,yCAA+C;AAE/C;IAAmC,iCAAQ;IAKvC,uBAAY,IAAU,EAAE,WAAiB,EAAE,OAAa;QAAxD,YACI,iBAAO,SAIV;QAHG,KAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,KAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;;IAC3B,CAAC;IAED,uCAAe,GAAf,UAAgB,IAAS;QACrB,IAAI,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE;YACnC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAC7B;QAED,IAAI,IAAI,CAAC,WAAW,KAAK,IAAI,EAAE;YAC3B,OAAO,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;SACjD;QAED,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,gCAAQ,GAAR;QACI,OAAO,kBAAW,IAAI,CAAC,IAAI,MAAG,CAAC;IACnC,CAAC;IAED,+BAAO,GAAP;QACI,IAAI,aAAa,GAAG,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;QACvD,OAAO,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACvD,CAAC;IAED,8BAAM,GAAN,UAAO,aAAkB,EAAE,UAAe;QACtC,IAAI,SAAS,GAAG,IAAI,4BAAgB,CAAC,IAAI,CAAC,CAAC;QAE3C,IAAI,aAAa,GAAG,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;QACvD,IAAI,aAAa,EAAE;YACf,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;SACjE;QAED,OAAO,SAAS,CAAC;IACrB,CAAC;IACL,oBAAC;AAAD,CAAC,AA3CD,CAAmC,mBAAQ,GA2C1C;AA3CY,sCAAa"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.FuncaoPadrao = void 0;
19
+ var callable_1 = require("./callable");
20
+ var FuncaoPadrao = /** @class */ (function (_super) {
21
+ __extends(FuncaoPadrao, _super);
22
+ function FuncaoPadrao(valorAridade, funcao) {
23
+ var _this = _super.call(this) || this;
24
+ _this.valorAridade = valorAridade;
25
+ _this.funcao = funcao;
26
+ return _this;
27
+ }
28
+ FuncaoPadrao.prototype.chamar = function (interpretador, argumentos, simbolo) {
29
+ this.simbolo = simbolo;
30
+ return this.funcao.apply(this, argumentos);
31
+ };
32
+ FuncaoPadrao.prototype.toString = function () {
33
+ return "<função>";
34
+ };
35
+ return FuncaoPadrao;
36
+ }(callable_1.Callable));
37
+ exports.FuncaoPadrao = FuncaoPadrao;
38
+ //# sourceMappingURL=funcao-padrao.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"funcao-padrao.js","sourceRoot":"","sources":["../../../src/estruturas/funcao-padrao.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAAsC;AAEtC;IAAkC,gCAAQ;IAKtC,sBAAY,YAAY,EAAE,MAAM;QAAhC,YACI,iBAAO,SAGV;QAFG,KAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC;;IACzB,CAAC;IAED,6BAAM,GAAN,UAAO,aAAkB,EAAE,UAAe,EAAE,OAAY;QACpD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC/C,CAAC;IAED,+BAAQ,GAAR;QACI,OAAO,UAAU,CAAC;IACtB,CAAC;IACL,mBAAC;AAAD,CAAC,AAnBD,CAAkC,mBAAQ,GAmBzC;AAnBY,oCAAY"}
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.DeleguaFuncao = void 0;
19
+ var callable_1 = require("./callable");
20
+ var ambiente_1 = require("../ambiente");
21
+ var excecoes_1 = require("../excecoes");
22
+ var DeleguaFuncao = /** @class */ (function (_super) {
23
+ __extends(DeleguaFuncao, _super);
24
+ function DeleguaFuncao(nome, declaracao, closure, eInicializador) {
25
+ if (eInicializador === void 0) { eInicializador = false; }
26
+ var _this = _super.call(this) || this;
27
+ _this.nome = nome;
28
+ _this.declaracao = declaracao;
29
+ _this.closure = closure;
30
+ _this.eInicializador = eInicializador;
31
+ return _this;
32
+ }
33
+ DeleguaFuncao.prototype.aridade = function () {
34
+ var _a, _b;
35
+ return ((_b = (_a = this.declaracao) === null || _a === void 0 ? void 0 : _a.parametros) === null || _b === void 0 ? void 0 : _b.length) || 0;
36
+ };
37
+ DeleguaFuncao.prototype.toString = function () {
38
+ if (this.nome === null)
39
+ return "<função>";
40
+ return "<fun\u00E7\u00E3o ".concat(this.nome, ">");
41
+ };
42
+ DeleguaFuncao.prototype.chamar = function (interpretador, argumentos) {
43
+ var ambiente = new ambiente_1.Ambiente(this.closure);
44
+ var parametros = this.declaracao.parametros;
45
+ if (parametros && parametros.length) {
46
+ for (var i = 0; i < parametros.length; i++) {
47
+ var param = parametros[i];
48
+ var nome = param["nome"].lexema;
49
+ var valor = argumentos[i];
50
+ if (argumentos[i] === null) {
51
+ valor = param["padrao"] ? param["padrao"].valor : null;
52
+ }
53
+ ambiente.definirVariavel(nome, valor);
54
+ }
55
+ }
56
+ try {
57
+ interpretador.executeBlock(this.declaracao.funcao, ambiente);
58
+ }
59
+ catch (erro) {
60
+ if (erro instanceof excecoes_1.ReturnException) {
61
+ if (this.eInicializador)
62
+ return this.closure.obterVariavelEm(0, "isto");
63
+ return erro.valor;
64
+ }
65
+ else {
66
+ throw erro;
67
+ }
68
+ }
69
+ if (this.eInicializador)
70
+ return this.closure.obterVariavelEm(0, "isto");
71
+ return null;
72
+ };
73
+ DeleguaFuncao.prototype.bind = function (instancia) {
74
+ var ambiente = new ambiente_1.Ambiente(this.closure);
75
+ ambiente.definirVariavel("isto", instancia);
76
+ return new DeleguaFuncao(this.nome, this.declaracao, ambiente, this.eInicializador);
77
+ };
78
+ return DeleguaFuncao;
79
+ }(callable_1.Callable));
80
+ exports.DeleguaFuncao = DeleguaFuncao;
81
+ //# sourceMappingURL=funcao.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"funcao.js","sourceRoot":"","sources":["../../../src/estruturas/funcao.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAAsC;AACtC,wCAAuC;AACvC,wCAA8C;AAE9C;IAAmC,iCAAQ;IAMvC,uBAAY,IAAS,EAAE,UAAe,EAAE,OAAY,EAAE,cAAsB;QAAtB,+BAAA,EAAA,sBAAsB;QAA5E,YACI,iBAAO,SAKV;QAJG,KAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,KAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,KAAI,CAAC,OAAO,GAAG,OAAO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ACX,IAAI,IAAI,YAAY,0BAAe,EAAE;gBACjC,IAAI,IAAI,CAAC,cAAc;oBAAE,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;gBACxE,OAAO,IAAI,CAAC,KAAK,CAAC;aACrB;iBAAM;gBACH,MAAM,IAAI,CAAC;aACd;SACJ;QAED,IAAI,IAAI,CAAC,cAAc;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QACxE,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,4BAAI,GAAJ,UAAK,SAAc;QACf,IAAI,QAAQ,GAAG,IAAI,mBAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,QAAQ,CAAC,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAC5C,OAAO,IAAI,aAAa,CACpB,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,UAAU,EACf,QAAQ,EACR,IAAI,CAAC,cAAc,CACtB,CAAC;IACN,CAAC;IACL,oBAAC;AAAD,CAAC,AAjED,CAAmC,mBAAQ,GAiE1C;AAjEY,sCAAa"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./callable"), exports);
14
+ __exportStar(require("./classe"), exports);
15
+ __exportStar(require("./funcao-padrao"), exports);
16
+ __exportStar(require("./funcao"), exports);
17
+ __exportStar(require("./instancia"), exports);
18
+ __exportStar(require("./modulo"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/estruturas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA2B;AAC3B,2CAAyB;AACzB,kDAAgC;AAChC,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleguaInstancia = void 0;
4
+ var excecoes_1 = require("../excecoes");
5
+ var DeleguaInstancia = /** @class */ (function () {
6
+ function DeleguaInstancia(criarClasse) {
7
+ this.criarClasse = criarClasse;
8
+ this.campos = {};
9
+ }
10
+ DeleguaInstancia.prototype.get = function (nome) {
11
+ if (this.campos.hasOwnProperty(nome.lexema)) {
12
+ return this.campos[nome.lexema];
13
+ }
14
+ var metodo = this.criarClasse.encontrarMetodo(nome.lexema);
15
+ if (metodo)
16
+ return metodo.bind(this);
17
+ throw new excecoes_1.ErroEmTempoDeExecucao(nome, "Método indefinido não recuperado.");
18
+ };
19
+ DeleguaInstancia.prototype.set = function (nome, valor) {
20
+ this.campos[nome.lexema] = valor;
21
+ };
22
+ DeleguaInstancia.prototype.toString = function () {
23
+ return "<Objeto " + this.criarClasse.nome + ">";
24
+ };
25
+ return DeleguaInstancia;
26
+ }());
27
+ exports.DeleguaInstancia = DeleguaInstancia;
28
+ //# sourceMappingURL=instancia.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instancia.js","sourceRoot":"","sources":["../../../src/estruturas/instancia.ts"],"names":[],"mappings":";;;AAAA,wCAAoD;AAEpD;IAII,0BAAY,WAAW;QACnB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;IACrB,CAAC;IAED,8BAAG,GAAH,UAAI,IAAS;QACT,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YACzC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACnC;QAED,IAAI,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3D,IAAI,MAAM;YAAE,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAErC,MAAM,IAAI,gCAAqB,CAAC,IAAI,EAAE,mCAAmC,CAAC,CAAC;IAC/E,CAAC;IAED,8BAAG,GAAH,UAAI,IAAS,EAAE,KAAU;QACrB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;IACrC,CAAC;IAED,mCAAQ,GAAR;QACI,OAAO,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,GAAG,GAAG,CAAC;IACpD,CAAC;IACL,uBAAC;AAAD,CAAC,AA3BD,IA2BC;AA3BY,4CAAgB"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleguaModulo = void 0;
4
+ var DeleguaModulo = /** @class */ (function () {
5
+ function DeleguaModulo(nome) {
6
+ if (nome)
7
+ this.nome = nome;
8
+ }
9
+ DeleguaModulo.prototype.toString = function () {
10
+ return this.nome ? "<modulo ".concat(this.nome, ">") : "<modulo>";
11
+ };
12
+ return DeleguaModulo;
13
+ }());
14
+ exports.DeleguaModulo = DeleguaModulo;
15
+ //# sourceMappingURL=modulo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modulo.js","sourceRoot":"","sources":["../../../src/estruturas/modulo.ts"],"names":[],"mappings":";;;AAAA;IAGI,uBAAY,IAAa;QACrB,IAAI,IAAI;YAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAC/B,CAAC;IAED,gCAAQ,GAAR;QACI,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAW,IAAI,CAAC,IAAI,MAAG,CAAC,CAAC,CAAC,UAAU,CAAC;IAC5D,CAAC;IACL,oBAAC;AAAD,CAAC,AAVD,IAUC;AAVY,sCAAa"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.BreakException = void 0;
19
+ var BreakException = /** @class */ (function (_super) {
20
+ __extends(BreakException, _super);
21
+ function BreakException() {
22
+ return _super !== null && _super.apply(this, arguments) || this;
23
+ }
24
+ return BreakException;
25
+ }(Error));
26
+ exports.BreakException = BreakException;
27
+ //# sourceMappingURL=break-exception.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"break-exception.js","sourceRoot":"","sources":["../../../src/excecoes/break-exception.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;IAAoC,kCAAK;IAAzC;;IAA4C,CAAC;IAAD,qBAAC;AAAD,CAAC,AAA7C,CAAoC,KAAK,GAAI;AAAhC,wCAAc"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.ContinueException = void 0;
19
+ var ContinueException = /** @class */ (function (_super) {
20
+ __extends(ContinueException, _super);
21
+ function ContinueException() {
22
+ return _super !== null && _super.apply(this, arguments) || this;
23
+ }
24
+ return ContinueException;
25
+ }(Error));
26
+ exports.ContinueException = ContinueException;
27
+ //# sourceMappingURL=continue-exception.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"continue-exception.js","sourceRoot":"","sources":["../../../src/excecoes/continue-exception.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;IAAuC,qCAAK;IAA5C;;IAA+C,CAAC;IAAD,wBAAC;AAAD,CAAC,AAAhD,CAAuC,KAAK,GAAI;AAAnC,8CAAiB"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.ErroEmTempoDeExecucao = void 0;
19
+ var ErroEmTempoDeExecucao = /** @class */ (function (_super) {
20
+ __extends(ErroEmTempoDeExecucao, _super);
21
+ function ErroEmTempoDeExecucao(simbolo, mensagem) {
22
+ var _this = _super.call(this, mensagem) || this;
23
+ _this.simbolo = simbolo;
24
+ _this.mensagem = mensagem;
25
+ Object.setPrototypeOf(_this, ErroEmTempoDeExecucao.prototype);
26
+ return _this;
27
+ }
28
+ return ErroEmTempoDeExecucao;
29
+ }(Error));
30
+ exports.ErroEmTempoDeExecucao = ErroEmTempoDeExecucao;
31
+ //# sourceMappingURL=erro-em-tempo-de-execucao.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"erro-em-tempo-de-execucao.js","sourceRoot":"","sources":["../../../src/excecoes/erro-em-tempo-de-execucao.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;IAA2C,yCAAK;IAI9C,+BAAY,OAAa,EAAE,QAAiB;QAA5C,YACE,kBAAM,QAAQ,CAAC,SAIhB;QAHC,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,KAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;;IAC/D,CAAC;IACH,4BAAC;AAAD,CAAC,AAVD,CAA2C,KAAK,GAU/C;AAVY,sDAAqB"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./break-exception"), exports);
14
+ __exportStar(require("./continue-exception"), exports);
15
+ __exportStar(require("./erro-em-tempo-de-execucao"), exports);
16
+ __exportStar(require("./return-exception"), exports);
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/excecoes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAkC;AAClC,uDAAqC;AACrC,8DAA4C;AAC5C,qDAAmC"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.ReturnException = void 0;
19
+ var ReturnException = /** @class */ (function (_super) {
20
+ __extends(ReturnException, _super);
21
+ function ReturnException(valor) {
22
+ var _this = _super.call(this, valor) || this;
23
+ _this.valor = valor;
24
+ Object.setPrototypeOf(_this, ReturnException.prototype);
25
+ return _this;
26
+ }
27
+ return ReturnException;
28
+ }(Error));
29
+ exports.ReturnException = ReturnException;
30
+ //# sourceMappingURL=return-exception.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"return-exception.js","sourceRoot":"","sources":["../../../src/excecoes/return-exception.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA;IAAqC,mCAAK;IAGxC,yBAAY,KAAU;QAAtB,YACE,kBAAM,KAAK,CAAC,SAGb;QAFC,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;;IACzD,CAAC;IACH,sBAAC;AAAD,CAAC,AARD,CAAqC,KAAK,GAQzC;AARY,0CAAe"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=avaliador-sintatico-interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avaliador-sintatico-interface.js","sourceRoot":"","sources":["../../../src/interfaces/avaliador-sintatico-interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./avaliador-sintatico-interface"), exports);
14
+ __exportStar(require("./interpretador-interface"), exports);
15
+ __exportStar(require("./lexador-interface"), exports);
16
+ __exportStar(require("./pilha-interface"), exports);
17
+ __exportStar(require("./resolvedor-interface"), exports);
18
+ __exportStar(require("./simbolo-interface"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kEAAgD;AAChD,4DAA0C;AAC1C,sDAAoC;AACpC,oDAAiC;AACjC,yDAAuC;AACvC,sDAAmC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=interpretador-interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interpretador-interface.js","sourceRoot":"","sources":["../../../src/interfaces/interpretador-interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=lexador-interface.js.map