@designliquido/delegua 0.2.2 → 0.2.5

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 (105) hide show
  1. package/bin/package.json +3 -3
  2. package/fontes/avaliador-sintatico/avaliador-sintatico.d.ts +67 -0
  3. package/fontes/avaliador-sintatico/avaliador-sintatico.js +663 -0
  4. package/fontes/avaliador-sintatico/avaliador-sintatico.js.map +1 -0
  5. package/fontes/avaliador-sintatico/dialetos/{egua-classico.d.ts → avaliador-sintatico-egua-classico.d.ts} +2 -1
  6. package/fontes/avaliador-sintatico/dialetos/{egua-classico.js → avaliador-sintatico-egua-classico.js} +153 -155
  7. package/fontes/avaliador-sintatico/dialetos/avaliador-sintatico-egua-classico.js.map +1 -0
  8. package/fontes/avaliador-sintatico/dialetos/avaliador-sintatico-eguap.d.ts +80 -0
  9. package/fontes/avaliador-sintatico/dialetos/avaliador-sintatico-eguap.js +708 -0
  10. package/fontes/avaliador-sintatico/dialetos/avaliador-sintatico-eguap.js.map +1 -0
  11. package/fontes/avaliador-sintatico/dialetos/index.d.ts +1 -1
  12. package/fontes/avaliador-sintatico/dialetos/index.js +1 -1
  13. package/fontes/avaliador-sintatico/dialetos/index.js.map +1 -1
  14. package/fontes/avaliador-sintatico/index.d.ts +2 -66
  15. package/fontes/avaliador-sintatico/index.js +15 -661
  16. package/fontes/avaliador-sintatico/index.js.map +1 -1
  17. package/fontes/delegua.d.ts +6 -3
  18. package/fontes/delegua.js +35 -21
  19. package/fontes/delegua.js.map +1 -1
  20. package/fontes/interfaces/avaliador-sintatico-interface.d.ts +4 -3
  21. package/fontes/interfaces/delegua-interface.d.ts +3 -0
  22. package/fontes/interfaces/delegua-interface.js +3 -0
  23. package/fontes/interfaces/delegua-interface.js.map +1 -0
  24. package/fontes/interfaces/index.d.ts +7 -6
  25. package/fontes/interfaces/index.js +1 -0
  26. package/fontes/interfaces/index.js.map +1 -1
  27. package/fontes/interfaces/interpretador-interface.d.ts +4 -5
  28. package/fontes/interfaces/lexador-interface.d.ts +1 -1
  29. package/fontes/interfaces/pilha-interface.d.ts +6 -6
  30. package/fontes/interfaces/resolvedor-interface.d.ts +2 -2
  31. package/fontes/interpretador/dialetos/egua-classico.d.ts +6 -4
  32. package/fontes/interpretador/dialetos/egua-classico.js +34 -31
  33. package/fontes/interpretador/dialetos/egua-classico.js.map +1 -1
  34. package/fontes/interpretador/erro-interpretador.d.ts +5 -0
  35. package/fontes/interpretador/erro-interpretador.js +3 -0
  36. package/fontes/interpretador/erro-interpretador.js.map +1 -0
  37. package/fontes/interpretador/index.d.ts +6 -3
  38. package/fontes/interpretador/index.js +32 -26
  39. package/fontes/interpretador/index.js.map +1 -1
  40. package/fontes/interpretador/retorno-interpretador.d.ts +4 -0
  41. package/fontes/interpretador/retorno-interpretador.js +3 -0
  42. package/fontes/interpretador/retorno-interpretador.js.map +1 -0
  43. package/fontes/lexador/dialetos/index.d.ts +1 -1
  44. package/fontes/lexador/dialetos/index.js +1 -1
  45. package/fontes/lexador/dialetos/index.js.map +1 -1
  46. package/fontes/lexador/dialetos/{egua-classico.d.ts → lexador-egua-classico.d.ts} +2 -2
  47. package/fontes/lexador/dialetos/{egua-classico.js → lexador-egua-classico.js} +41 -82
  48. package/fontes/lexador/dialetos/lexador-egua-classico.js.map +1 -0
  49. package/fontes/lexador/dialetos/lexador-eguap.d.ts +51 -0
  50. package/fontes/lexador/dialetos/lexador-eguap.js +395 -0
  51. package/fontes/lexador/dialetos/lexador-eguap.js.map +1 -0
  52. package/fontes/lexador/dialetos/pragma.d.ts +8 -0
  53. package/fontes/lexador/dialetos/pragma.js +3 -0
  54. package/fontes/lexador/dialetos/pragma.js.map +1 -0
  55. package/fontes/{tiposDeSimbolos.d.ts → lexador/dialetos/tipos-de-simbolos-eguap.d.ts} +2 -1
  56. package/fontes/lexador/dialetos/tipos-de-simbolos-eguap.js +74 -0
  57. package/fontes/lexador/dialetos/tipos-de-simbolos-eguap.js.map +1 -0
  58. package/fontes/lexador/index.d.ts +2 -43
  59. package/fontes/lexador/index.js +15 -412
  60. package/fontes/lexador/index.js.map +1 -1
  61. package/fontes/lexador/lexador.d.ts +43 -0
  62. package/fontes/lexador/lexador.js +372 -0
  63. package/fontes/lexador/lexador.js.map +1 -0
  64. package/fontes/lexador/palavras-reservadas.d.ts +35 -0
  65. package/fontes/lexador/palavras-reservadas.js +41 -0
  66. package/fontes/lexador/palavras-reservadas.js.map +1 -0
  67. package/fontes/lexador/retorno-lexador.d.ts +4 -0
  68. package/fontes/lexador/simbolo.d.ts +9 -0
  69. package/fontes/lexador/simbolo.js +17 -0
  70. package/fontes/lexador/simbolo.js.map +1 -0
  71. package/fontes/lexador/tipos-de-simbolos.d.ts +72 -0
  72. package/fontes/{tiposDeSimbolos.js → lexador/tipos-de-simbolos.js} +2 -1
  73. package/fontes/lexador/tipos-de-simbolos.js.map +1 -0
  74. package/fontes/resolvedor/dialetos/egua-classico.d.ts +3 -3
  75. package/fontes/resolvedor/dialetos/egua-classico.js +5 -4
  76. package/fontes/resolvedor/dialetos/egua-classico.js.map +1 -1
  77. package/fontes/resolvedor/index.d.ts +3 -3
  78. package/fontes/resolvedor/index.js +5 -4
  79. package/fontes/resolvedor/index.js.map +1 -1
  80. package/fontes/resolvedor/pilha-escopos.d.ts +1 -1
  81. package/fontes/resolvedor/retorno-resolvedor.d.ts +2 -0
  82. package/fontes/tipos-de-simbolos.d.ts +72 -0
  83. package/fontes/tipos-de-simbolos.js +74 -0
  84. package/fontes/tipos-de-simbolos.js.map +1 -0
  85. package/package.json +3 -3
  86. package/testes/avaliador-sintatico.test.js +2 -2
  87. package/testes/avaliador-sintatico.test.js.map +1 -1
  88. package/testes/biblioteca-global.test.js +57 -57
  89. package/testes/biblioteca-global.test.js.map +1 -1
  90. package/testes/egua-classico/avaliador-sintatico.test.js +7 -16
  91. package/testes/egua-classico/avaliador-sintatico.test.js.map +1 -1
  92. package/testes/egua-classico/interpretador.test.js +81 -81
  93. package/testes/egua-classico/interpretador.test.js.map +1 -1
  94. package/testes/egua-classico/resolvedor.test.js +4 -4
  95. package/testes/egua-classico/resolvedor.test.js.map +1 -1
  96. package/testes/eguap/lexador.test.d.ts +1 -0
  97. package/testes/eguap/lexador.test.js +53 -0
  98. package/testes/eguap/lexador.test.js.map +1 -0
  99. package/testes/interpretador.test.js +81 -81
  100. package/testes/interpretador.test.js.map +1 -1
  101. package/testes/resolvedor.test.js +1 -1
  102. package/testes/resolvedor.test.js.map +1 -1
  103. package/fontes/avaliador-sintatico/dialetos/egua-classico.js.map +0 -1
  104. package/fontes/lexador/dialetos/egua-classico.js.map +0 -1
  105. package/fontes/tiposDeSimbolos.js.map +0 -1
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AvaliadorSintaticoEguaClassico = void 0;
7
- var tiposDeSimbolos_1 = __importDefault(require("../../tiposDeSimbolos"));
7
+ var tipos_de_simbolos_1 = __importDefault(require("../../lexador/tipos-de-simbolos"));
8
8
  var construtos_1 = require("../../construtos");
9
9
  var erro_avaliador_sintatico_1 = require("../erro-avaliador-sintatico");
10
10
  var declaracoes_1 = require("../../declaracoes");
@@ -21,17 +21,17 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
21
21
  AvaliadorSintaticoEguaClassico.prototype.sincronizar = function () {
22
22
  this.avancarEDevolverAnterior();
23
23
  while (!this.estaNoFinal()) {
24
- if (this.simboloAnterior().tipo === tiposDeSimbolos_1.default.PONTO_E_VIRGULA)
24
+ if (this.simboloAnterior().tipo === tipos_de_simbolos_1.default.PONTO_E_VIRGULA)
25
25
  return;
26
26
  switch (this.simboloAtual().tipo) {
27
- case tiposDeSimbolos_1.default.CLASSE:
28
- case tiposDeSimbolos_1.default.FUNÇÃO:
29
- case tiposDeSimbolos_1.default.VARIAVEL:
30
- case tiposDeSimbolos_1.default.PARA:
31
- case tiposDeSimbolos_1.default.SE:
32
- case tiposDeSimbolos_1.default.ENQUANTO:
33
- case tiposDeSimbolos_1.default.ESCREVA:
34
- case tiposDeSimbolos_1.default.RETORNA:
27
+ case tipos_de_simbolos_1.default.CLASSE:
28
+ case tipos_de_simbolos_1.default.FUNÇÃO:
29
+ case tipos_de_simbolos_1.default.VARIAVEL:
30
+ case tipos_de_simbolos_1.default.PARA:
31
+ case tipos_de_simbolos_1.default.SE:
32
+ case tipos_de_simbolos_1.default.ENQUANTO:
33
+ case tipos_de_simbolos_1.default.ESCREVA:
34
+ case tipos_de_simbolos_1.default.RETORNA:
35
35
  return;
36
36
  }
37
37
  this.avancarEDevolverAnterior();
@@ -68,7 +68,7 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
68
68
  return this.simbolos[this.atual + posicao];
69
69
  };
70
70
  AvaliadorSintaticoEguaClassico.prototype.estaNoFinal = function () {
71
- return this.simboloAtual().tipo === tiposDeSimbolos_1.default.EOF;
71
+ return this.simboloAtual().tipo === tipos_de_simbolos_1.default.EOF;
72
72
  };
73
73
  AvaliadorSintaticoEguaClassico.prototype.avancarEDevolverAnterior = function () {
74
74
  if (!this.estaNoFinal())
@@ -90,96 +90,96 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
90
90
  return false;
91
91
  };
92
92
  AvaliadorSintaticoEguaClassico.prototype.primario = function () {
93
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.SUPER)) {
93
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.SUPER)) {
94
94
  var palavraChave = this.simboloAnterior();
95
- this.consumir(tiposDeSimbolos_1.default.PONTO, "Esperado '.' após 'super'.");
96
- var metodo = this.consumir(tiposDeSimbolos_1.default.IDENTIFICADOR, 'Esperado nome do método da SuperClasse.');
95
+ this.consumir(tipos_de_simbolos_1.default.PONTO, "Esperado '.' após 'super'.");
96
+ var metodo = this.consumir(tipos_de_simbolos_1.default.IDENTIFICADOR, 'Esperado nome do método da SuperClasse.');
97
97
  return new construtos_1.Super(0, palavraChave, metodo);
98
98
  }
99
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.COLCHETE_ESQUERDO)) {
99
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.COLCHETE_ESQUERDO)) {
100
100
  var valores = [];
101
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.COLCHETE_DIREITO)) {
101
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.COLCHETE_DIREITO)) {
102
102
  return new construtos_1.Vetor(0, []);
103
103
  }
104
- while (!this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.COLCHETE_DIREITO)) {
104
+ while (!this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.COLCHETE_DIREITO)) {
105
105
  var valor = this.atribuir();
106
106
  valores.push(valor);
107
107
  if (this.simboloAtual().tipo !==
108
- tiposDeSimbolos_1.default.COLCHETE_DIREITO) {
109
- this.consumir(tiposDeSimbolos_1.default.VIRGULA, 'Esperado vírgula antes da próxima expressão.');
108
+ tipos_de_simbolos_1.default.COLCHETE_DIREITO) {
109
+ this.consumir(tipos_de_simbolos_1.default.VIRGULA, 'Esperado vírgula antes da próxima expressão.');
110
110
  }
111
111
  }
112
112
  return new construtos_1.Vetor(0, valores);
113
113
  }
114
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.CHAVE_ESQUERDA)) {
114
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.CHAVE_ESQUERDA)) {
115
115
  var chaves = [];
116
116
  var valores = [];
117
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.CHAVE_DIREITA)) {
117
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.CHAVE_DIREITA)) {
118
118
  return new construtos_1.Dicionario(0, [], []);
119
119
  }
120
- while (!this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.CHAVE_DIREITA)) {
120
+ while (!this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.CHAVE_DIREITA)) {
121
121
  var chave = this.atribuir();
122
- this.consumir(tiposDeSimbolos_1.default.DOIS_PONTOS, "Esperado ':' entre chave e valor.");
122
+ this.consumir(tipos_de_simbolos_1.default.DOIS_PONTOS, "Esperado ':' entre chave e valor.");
123
123
  var valor = this.atribuir();
124
124
  chaves.push(chave);
125
125
  valores.push(valor);
126
- if (this.simboloAtual().tipo !== tiposDeSimbolos_1.default.CHAVE_DIREITA) {
127
- this.consumir(tiposDeSimbolos_1.default.VIRGULA, 'Esperado vírgula antes da próxima expressão.');
126
+ if (this.simboloAtual().tipo !== tipos_de_simbolos_1.default.CHAVE_DIREITA) {
127
+ this.consumir(tipos_de_simbolos_1.default.VIRGULA, 'Esperado vírgula antes da próxima expressão.');
128
128
  }
129
129
  }
130
130
  return new construtos_1.Dicionario(0, chaves, valores);
131
131
  }
132
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.FUNÇÃO))
132
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.FUNÇÃO))
133
133
  return this.corpoDaFuncao('função');
134
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.FALSO))
134
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.FALSO))
135
135
  return new construtos_1.Literal(0, false);
136
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.VERDADEIRO))
136
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.VERDADEIRO))
137
137
  return new construtos_1.Literal(0, true);
138
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.NULO))
138
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.NULO))
139
139
  return new construtos_1.Literal(0, null);
140
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.ISTO))
140
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.ISTO))
141
141
  return new construtos_1.Isto(this.simboloAnterior());
142
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.NUMERO, tiposDeSimbolos_1.default.TEXTO)) {
142
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.NUMERO, tipos_de_simbolos_1.default.TEXTO)) {
143
143
  return new construtos_1.Literal(0, this.simboloAnterior().literal);
144
144
  }
145
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.IDENTIFICADOR)) {
145
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.IDENTIFICADOR)) {
146
146
  return new construtos_1.Variavel(this.simboloAnterior());
147
147
  }
148
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.PARENTESE_ESQUERDO)) {
149
- var expr = this.expressao();
150
- this.consumir(tiposDeSimbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após a expressão.");
151
- return new construtos_1.Agrupamento(0, expr);
148
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.PARENTESE_ESQUERDO)) {
149
+ var expressao = this.expressao();
150
+ this.consumir(tipos_de_simbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após a expressão.");
151
+ return new construtos_1.Agrupamento(0, expressao);
152
152
  }
153
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.IMPORTAR))
153
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.IMPORTAR))
154
154
  return this.declaracaoImportar();
155
155
  throw this.erro(this.simboloAtual(), 'Esperado expressão.');
156
156
  };
157
157
  AvaliadorSintaticoEguaClassico.prototype.finalizarChamada = function (entidadeChamada) {
158
158
  var argumentos = [];
159
- if (!this.verificarTipoSimboloAtual(tiposDeSimbolos_1.default.PARENTESE_DIREITO)) {
159
+ if (!this.verificarTipoSimboloAtual(tipos_de_simbolos_1.default.PARENTESE_DIREITO)) {
160
160
  do {
161
161
  if (argumentos.length >= 255) {
162
162
  throw this.erro(this.simboloAtual(), 'Não pode haver mais de 255 argumentos.');
163
163
  }
164
164
  argumentos.push(this.expressao());
165
- } while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.VIRGULA));
165
+ } while (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.VIRGULA));
166
166
  }
167
- var parenteseDireito = this.consumir(tiposDeSimbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após os argumentos.");
167
+ var parenteseDireito = this.consumir(tipos_de_simbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após os argumentos.");
168
168
  return new construtos_1.Chamada(entidadeChamada, parenteseDireito, argumentos);
169
169
  };
170
170
  AvaliadorSintaticoEguaClassico.prototype.chamar = function () {
171
171
  var expressao = this.primario();
172
172
  while (true) {
173
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.PARENTESE_ESQUERDO)) {
173
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.PARENTESE_ESQUERDO)) {
174
174
  expressao = this.finalizarChamada(expressao);
175
175
  }
176
- else if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.PONTO)) {
177
- var nome = this.consumir(tiposDeSimbolos_1.default.IDENTIFICADOR, "Esperado nome do método após '.'.");
176
+ else if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.PONTO)) {
177
+ var nome = this.consumir(tipos_de_simbolos_1.default.IDENTIFICADOR, "Esperado nome do método após '.'.");
178
178
  expressao = new construtos_1.AcessoMetodo(expressao, nome);
179
179
  }
180
- else if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.COLCHETE_ESQUERDO)) {
180
+ else if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.COLCHETE_ESQUERDO)) {
181
181
  var indice = this.expressao();
182
- var simboloFechamento = this.consumir(tiposDeSimbolos_1.default.COLCHETE_DIREITO, "Esperado ']' após escrita do indice.");
182
+ var simboloFechamento = this.consumir(tipos_de_simbolos_1.default.COLCHETE_DIREITO, "Esperado ']' após escrita do indice.");
183
183
  expressao = new construtos_1.AcessoIndiceVariavel(expressao, indice, simboloFechamento);
184
184
  }
185
185
  else {
@@ -189,7 +189,7 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
189
189
  return expressao;
190
190
  };
191
191
  AvaliadorSintaticoEguaClassico.prototype.unario = function () {
192
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.NEGACAO, tiposDeSimbolos_1.default.SUBTRACAO, tiposDeSimbolos_1.default.BIT_NOT)) {
192
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.NEGACAO, tipos_de_simbolos_1.default.SUBTRACAO, tipos_de_simbolos_1.default.BIT_NOT)) {
193
193
  var operador = this.simboloAnterior();
194
194
  var direito = this.unario();
195
195
  return new construtos_1.Unario(operador, direito);
@@ -198,7 +198,7 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
198
198
  };
199
199
  AvaliadorSintaticoEguaClassico.prototype.exponenciacao = function () {
200
200
  var expressao = this.unario();
201
- while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.EXPONENCIACAO)) {
201
+ while (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.EXPONENCIACAO)) {
202
202
  var operador = this.simboloAnterior();
203
203
  var direito = this.unario();
204
204
  expressao = new construtos_1.Binario(expressao, operador, direito);
@@ -207,7 +207,7 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
207
207
  };
208
208
  AvaliadorSintaticoEguaClassico.prototype.multiplicar = function () {
209
209
  var expressao = this.exponenciacao();
210
- while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.DIVISAO, tiposDeSimbolos_1.default.MULTIPLICACAO, tiposDeSimbolos_1.default.MODULO)) {
210
+ while (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.DIVISAO, tipos_de_simbolos_1.default.MULTIPLICACAO, tipos_de_simbolos_1.default.MODULO)) {
211
211
  var operador = this.simboloAnterior();
212
212
  var direito = this.exponenciacao();
213
213
  expressao = new construtos_1.Binario(expressao, operador, direito);
@@ -216,7 +216,7 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
216
216
  };
217
217
  AvaliadorSintaticoEguaClassico.prototype.adicionar = function () {
218
218
  var expressao = this.multiplicar();
219
- while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.SUBTRACAO, tiposDeSimbolos_1.default.ADICAO)) {
219
+ while (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.SUBTRACAO, tipos_de_simbolos_1.default.ADICAO)) {
220
220
  var operador = this.simboloAnterior();
221
221
  var direito = this.multiplicar();
222
222
  expressao = new construtos_1.Binario(expressao, operador, direito);
@@ -225,7 +225,7 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
225
225
  };
226
226
  AvaliadorSintaticoEguaClassico.prototype.bitFill = function () {
227
227
  var expressao = this.adicionar();
228
- while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.MENOR_MENOR, tiposDeSimbolos_1.default.MAIOR_MAIOR)) {
228
+ while (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.MENOR_MENOR, tipos_de_simbolos_1.default.MAIOR_MAIOR)) {
229
229
  var operador = this.simboloAnterior();
230
230
  var direito = this.adicionar();
231
231
  expressao = new construtos_1.Binario(expressao, operador, direito);
@@ -234,7 +234,7 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
234
234
  };
235
235
  AvaliadorSintaticoEguaClassico.prototype.bitE = function () {
236
236
  var expressao = this.bitFill();
237
- while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.BIT_AND)) {
237
+ while (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.BIT_AND)) {
238
238
  var operador = this.simboloAnterior();
239
239
  var direito = this.bitFill();
240
240
  expressao = new construtos_1.Binario(expressao, operador, direito);
@@ -243,7 +243,7 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
243
243
  };
244
244
  AvaliadorSintaticoEguaClassico.prototype.bitOu = function () {
245
245
  var expressao = this.bitE();
246
- while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.BIT_OR, tiposDeSimbolos_1.default.BIT_XOR)) {
246
+ while (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.BIT_OR, tipos_de_simbolos_1.default.BIT_XOR)) {
247
247
  var operador = this.simboloAnterior();
248
248
  var direito = this.bitE();
249
249
  expressao = new construtos_1.Binario(expressao, operador, direito);
@@ -252,7 +252,7 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
252
252
  };
253
253
  AvaliadorSintaticoEguaClassico.prototype.comparar = function () {
254
254
  var expressao = this.bitOu();
255
- while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.MAIOR, tiposDeSimbolos_1.default.MAIOR_IGUAL, tiposDeSimbolos_1.default.MENOR, tiposDeSimbolos_1.default.MENOR_IGUAL)) {
255
+ while (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.MAIOR, tipos_de_simbolos_1.default.MAIOR_IGUAL, tipos_de_simbolos_1.default.MENOR, tipos_de_simbolos_1.default.MENOR_IGUAL)) {
256
256
  var operador = this.simboloAnterior();
257
257
  var direito = this.bitOu();
258
258
  expressao = new construtos_1.Binario(expressao, operador, direito);
@@ -261,7 +261,7 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
261
261
  };
262
262
  AvaliadorSintaticoEguaClassico.prototype.comparacaoIgualdade = function () {
263
263
  var expressao = this.comparar();
264
- while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.DIFERENTE, tiposDeSimbolos_1.default.IGUAL_IGUAL)) {
264
+ while (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.DIFERENTE, tipos_de_simbolos_1.default.IGUAL_IGUAL)) {
265
265
  var operador = this.simboloAnterior();
266
266
  var direito = this.comparar();
267
267
  expressao = new construtos_1.Binario(expressao, operador, direito);
@@ -270,7 +270,7 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
270
270
  };
271
271
  AvaliadorSintaticoEguaClassico.prototype.em = function () {
272
272
  var expressao = this.comparacaoIgualdade();
273
- while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.EM)) {
273
+ while (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.EM)) {
274
274
  var operador = this.simboloAnterior();
275
275
  var direito = this.comparacaoIgualdade();
276
276
  expressao = new construtos_1.Logico(expressao, operador, direito);
@@ -279,7 +279,7 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
279
279
  };
280
280
  AvaliadorSintaticoEguaClassico.prototype.e = function () {
281
281
  var expressao = this.em();
282
- while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.E)) {
282
+ while (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.E)) {
283
283
  var operador = this.simboloAnterior();
284
284
  var direito = this.em();
285
285
  expressao = new construtos_1.Logico(expressao, operador, direito);
@@ -288,7 +288,7 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
288
288
  };
289
289
  AvaliadorSintaticoEguaClassico.prototype.ou = function () {
290
290
  var expressao = this.e();
291
- while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.OU)) {
291
+ while (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.OU)) {
292
292
  var operador = this.simboloAnterior();
293
293
  var direito = this.e();
294
294
  expressao = new construtos_1.Logico(expressao, operador, direito);
@@ -297,7 +297,7 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
297
297
  };
298
298
  AvaliadorSintaticoEguaClassico.prototype.atribuir = function () {
299
299
  var expressao = this.ou();
300
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.IGUAL)) {
300
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.IGUAL)) {
301
301
  var igual = this.simboloAnterior();
302
302
  var valor = this.atribuir();
303
303
  if (expressao instanceof construtos_1.Variavel) {
@@ -319,37 +319,37 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
319
319
  return this.atribuir();
320
320
  };
321
321
  AvaliadorSintaticoEguaClassico.prototype.declaracaoEscreva = function () {
322
- this.consumir(tiposDeSimbolos_1.default.PARENTESE_ESQUERDO, "Esperado '(' antes dos valores em escreva.");
322
+ this.consumir(tipos_de_simbolos_1.default.PARENTESE_ESQUERDO, "Esperado '(' antes dos valores em escreva.");
323
323
  var valor = this.expressao();
324
- this.consumir(tiposDeSimbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após os valores em escreva.");
325
- this.consumir(tiposDeSimbolos_1.default.PONTO_E_VIRGULA, "Esperado ';' após o valor.");
324
+ this.consumir(tipos_de_simbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após os valores em escreva.");
325
+ this.consumir(tipos_de_simbolos_1.default.PONTO_E_VIRGULA, "Esperado ';' após o valor.");
326
326
  return new declaracoes_1.Escreva(valor);
327
327
  };
328
328
  AvaliadorSintaticoEguaClassico.prototype.declaracaoExpressao = function () {
329
329
  var expressao = this.expressao();
330
- this.consumir(tiposDeSimbolos_1.default.PONTO_E_VIRGULA, "Esperado ';' após expressão.");
330
+ this.consumir(tipos_de_simbolos_1.default.PONTO_E_VIRGULA, "Esperado ';' após expressão.");
331
331
  return new declaracoes_1.Expressao(expressao);
332
332
  };
333
333
  AvaliadorSintaticoEguaClassico.prototype.blocoEscopo = function () {
334
334
  var declaracoes = [];
335
- while (!this.verificarTipoSimboloAtual(tiposDeSimbolos_1.default.CHAVE_DIREITA) &&
335
+ while (!this.verificarTipoSimboloAtual(tipos_de_simbolos_1.default.CHAVE_DIREITA) &&
336
336
  !this.estaNoFinal()) {
337
337
  declaracoes.push(this.declaracao());
338
338
  }
339
- this.consumir(tiposDeSimbolos_1.default.CHAVE_DIREITA, "Esperado '}' após o bloco.");
339
+ this.consumir(tipos_de_simbolos_1.default.CHAVE_DIREITA, "Esperado '}' após o bloco.");
340
340
  return declaracoes;
341
341
  };
342
342
  AvaliadorSintaticoEguaClassico.prototype.declaracaoSe = function () {
343
343
  var simboloSe = this.simboloAnterior();
344
- this.consumir(tiposDeSimbolos_1.default.PARENTESE_ESQUERDO, "Esperado '(' após 'se'.");
344
+ this.consumir(tipos_de_simbolos_1.default.PARENTESE_ESQUERDO, "Esperado '(' após 'se'.");
345
345
  var condicao = this.expressao();
346
- this.consumir(tiposDeSimbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após condição do se.");
346
+ this.consumir(tipos_de_simbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após condição do se.");
347
347
  var caminhoEntao = this.resolverDeclaracao();
348
348
  var caminhosSeSenao = [];
349
- while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.SENÃOSE)) {
350
- this.consumir(tiposDeSimbolos_1.default.PARENTESE_ESQUERDO, "Esperado '(' após 'senãose'.");
349
+ while (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.SENÃOSE)) {
350
+ this.consumir(tipos_de_simbolos_1.default.PARENTESE_ESQUERDO, "Esperado '(' após 'senãose'.");
351
351
  var condicaoSeSenao = this.expressao();
352
- this.consumir(tiposDeSimbolos_1.default.PARENTESE_DIREITO, "Esperado ')' apóes codição do 'senãose.");
352
+ this.consumir(tipos_de_simbolos_1.default.PARENTESE_DIREITO, "Esperado ')' apóes codição do 'senãose.");
353
353
  var caminho = this.resolverDeclaracao();
354
354
  caminhosSeSenao.push({
355
355
  condicao: condicaoSeSenao,
@@ -357,7 +357,7 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
357
357
  });
358
358
  }
359
359
  var caminhoSenao = null;
360
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.SENÃO)) {
360
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.SENÃO)) {
361
361
  caminhoSenao = this.resolverDeclaracao();
362
362
  }
363
363
  return new declaracoes_1.Se(Number(simboloSe.linha), condicao, caminhoEntao, caminhosSeSenao, caminhoSenao);
@@ -365,9 +365,9 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
365
365
  AvaliadorSintaticoEguaClassico.prototype.declaracaoEnquanto = function () {
366
366
  try {
367
367
  this.ciclos += 1;
368
- this.consumir(tiposDeSimbolos_1.default.PARENTESE_ESQUERDO, "Esperado '(' após 'enquanto'.");
368
+ this.consumir(tipos_de_simbolos_1.default.PARENTESE_ESQUERDO, "Esperado '(' após 'enquanto'.");
369
369
  var condicao = this.expressao();
370
- this.consumir(tiposDeSimbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após condicional.");
370
+ this.consumir(tipos_de_simbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após condicional.");
371
371
  var corpo = this.resolverDeclaracao();
372
372
  return new declaracoes_1.Enquanto(condicao, corpo);
373
373
  }
@@ -379,27 +379,27 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
379
379
  try {
380
380
  var simboloPara = this.simboloAnterior();
381
381
  this.ciclos += 1;
382
- this.consumir(tiposDeSimbolos_1.default.PARENTESE_ESQUERDO, "Esperado '(' após 'para'.");
382
+ this.consumir(tipos_de_simbolos_1.default.PARENTESE_ESQUERDO, "Esperado '(' após 'para'.");
383
383
  var inicializador = void 0;
384
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.PONTO_E_VIRGULA)) {
384
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.PONTO_E_VIRGULA)) {
385
385
  inicializador = null;
386
386
  }
387
- else if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.VARIAVEL)) {
387
+ else if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.VARIAVEL)) {
388
388
  inicializador = this.declaracaoDeVariavel();
389
389
  }
390
390
  else {
391
391
  inicializador = this.declaracaoExpressao();
392
392
  }
393
393
  var condicao = null;
394
- if (!this.verificarTipoSimboloAtual(tiposDeSimbolos_1.default.PONTO_E_VIRGULA)) {
394
+ if (!this.verificarTipoSimboloAtual(tipos_de_simbolos_1.default.PONTO_E_VIRGULA)) {
395
395
  condicao = this.expressao();
396
396
  }
397
- this.consumir(tiposDeSimbolos_1.default.PONTO_E_VIRGULA, "Esperado ';' após valores da condicional");
397
+ this.consumir(tipos_de_simbolos_1.default.PONTO_E_VIRGULA, "Esperado ';' após valores da condicional");
398
398
  var incrementar = null;
399
- if (!this.verificarTipoSimboloAtual(tiposDeSimbolos_1.default.PARENTESE_DIREITO)) {
399
+ if (!this.verificarTipoSimboloAtual(tipos_de_simbolos_1.default.PARENTESE_DIREITO)) {
400
400
  incrementar = this.expressao();
401
401
  }
402
- this.consumir(tiposDeSimbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após cláusulas");
402
+ this.consumir(tipos_de_simbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após cláusulas");
403
403
  var corpo = this.resolverDeclaracao();
404
404
  return new declaracoes_1.Para(Number(simboloPara.linha), inicializador, condicao, incrementar, corpo);
405
405
  }
@@ -411,68 +411,68 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
411
411
  if (this.ciclos < 1) {
412
412
  this.erro(this.simboloAnterior(), "'pausa' deve estar dentro de um loop.");
413
413
  }
414
- this.consumir(tiposDeSimbolos_1.default.PONTO_E_VIRGULA, "Esperado ';' após 'pausa'.");
414
+ this.consumir(tipos_de_simbolos_1.default.PONTO_E_VIRGULA, "Esperado ';' após 'pausa'.");
415
415
  return new declaracoes_1.Sustar();
416
416
  };
417
417
  AvaliadorSintaticoEguaClassico.prototype.declaracaoContinua = function () {
418
418
  if (this.ciclos < 1) {
419
419
  this.erro(this.simboloAnterior(), "'continua' precisa estar em um laço de repetição.");
420
420
  }
421
- this.consumir(tiposDeSimbolos_1.default.PONTO_E_VIRGULA, "Esperado ';' após 'continua'.");
421
+ this.consumir(tipos_de_simbolos_1.default.PONTO_E_VIRGULA, "Esperado ';' após 'continua'.");
422
422
  return new declaracoes_1.Continua();
423
423
  };
424
424
  AvaliadorSintaticoEguaClassico.prototype.declaracaoRetorna = function () {
425
425
  var palavraChave = this.simboloAnterior();
426
426
  var valor = null;
427
- if (!this.verificarTipoSimboloAtual(tiposDeSimbolos_1.default.PONTO_E_VIRGULA)) {
427
+ if (!this.verificarTipoSimboloAtual(tipos_de_simbolos_1.default.PONTO_E_VIRGULA)) {
428
428
  valor = this.expressao();
429
429
  }
430
- this.consumir(tiposDeSimbolos_1.default.PONTO_E_VIRGULA, "Esperado ';' após o retorno.");
430
+ this.consumir(tipos_de_simbolos_1.default.PONTO_E_VIRGULA, "Esperado ';' após o retorno.");
431
431
  return new declaracoes_1.Retorna(palavraChave, valor);
432
432
  };
433
433
  AvaliadorSintaticoEguaClassico.prototype.declaracaoEscolha = function () {
434
434
  try {
435
435
  this.ciclos += 1;
436
- this.consumir(tiposDeSimbolos_1.default.PARENTESE_ESQUERDO, "Esperado '{' após 'escolha'.");
436
+ this.consumir(tipos_de_simbolos_1.default.PARENTESE_ESQUERDO, "Esperado '{' após 'escolha'.");
437
437
  var condicao = this.expressao();
438
- this.consumir(tiposDeSimbolos_1.default.PARENTESE_DIREITO, "Esperado '}' após a condição de 'escolha'.");
439
- this.consumir(tiposDeSimbolos_1.default.CHAVE_ESQUERDA, "Esperado '{' antes do escopo do 'escolha'.");
438
+ this.consumir(tipos_de_simbolos_1.default.PARENTESE_DIREITO, "Esperado '}' após a condição de 'escolha'.");
439
+ this.consumir(tipos_de_simbolos_1.default.CHAVE_ESQUERDA, "Esperado '{' antes do escopo do 'escolha'.");
440
440
  var caminhos = [];
441
441
  var caminhoPadrao = null;
442
- while (!this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.CHAVE_DIREITA) &&
442
+ while (!this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.CHAVE_DIREITA) &&
443
443
  !this.estaNoFinal()) {
444
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.CASO)) {
445
- var branchConditions = [this.expressao()];
446
- this.consumir(tiposDeSimbolos_1.default.DOIS_PONTOS, "Esperado ':' após o 'caso'.");
447
- while (this.verificarTipoSimboloAtual(tiposDeSimbolos_1.default.CASO)) {
448
- this.consumir(tiposDeSimbolos_1.default.CASO, null);
449
- branchConditions.push(this.expressao());
450
- this.consumir(tiposDeSimbolos_1.default.DOIS_PONTOS, "Esperado ':' após declaração do 'caso'.");
444
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.CASO)) {
445
+ var caminhoCondicoes = [this.expressao()];
446
+ this.consumir(tipos_de_simbolos_1.default.DOIS_PONTOS, "Esperado ':' após o 'caso'.");
447
+ while (this.verificarTipoSimboloAtual(tipos_de_simbolos_1.default.CASO)) {
448
+ this.consumir(tipos_de_simbolos_1.default.CASO, null);
449
+ caminhoCondicoes.push(this.expressao());
450
+ this.consumir(tipos_de_simbolos_1.default.DOIS_PONTOS, "Esperado ':' após declaração do 'caso'.");
451
451
  }
452
452
  var declaracoes = [];
453
453
  do {
454
454
  declaracoes.push(this.resolverDeclaracao());
455
- } while (!this.verificarTipoSimboloAtual(tiposDeSimbolos_1.default.CASO) &&
456
- !this.verificarTipoSimboloAtual(tiposDeSimbolos_1.default.PADRAO) &&
457
- !this.verificarTipoSimboloAtual(tiposDeSimbolos_1.default.CHAVE_DIREITA));
455
+ } while (!this.verificarTipoSimboloAtual(tipos_de_simbolos_1.default.CASO) &&
456
+ !this.verificarTipoSimboloAtual(tipos_de_simbolos_1.default.PADRAO) &&
457
+ !this.verificarTipoSimboloAtual(tipos_de_simbolos_1.default.CHAVE_DIREITA));
458
458
  caminhos.push({
459
- conditions: branchConditions,
459
+ condicoes: caminhoCondicoes,
460
460
  declaracoes: declaracoes,
461
461
  });
462
462
  }
463
- else if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.PADRAO)) {
463
+ else if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.PADRAO)) {
464
464
  if (caminhoPadrao !== null) {
465
465
  var excecao = new erro_avaliador_sintatico_1.ErroAvaliadorSintatico(this.simboloAtual(), "Você só pode ter um 'padrao' em cada declaração de 'escolha'.");
466
466
  this.erros.push(excecao);
467
467
  throw excecao;
468
468
  }
469
- this.consumir(tiposDeSimbolos_1.default.DOIS_PONTOS, "Esperado ':' após declaração do 'padrao'.");
469
+ this.consumir(tipos_de_simbolos_1.default.DOIS_PONTOS, "Esperado ':' após declaração do 'padrao'.");
470
470
  var declaracoes = [];
471
471
  do {
472
472
  declaracoes.push(this.resolverDeclaracao());
473
- } while (!this.verificarTipoSimboloAtual(tiposDeSimbolos_1.default.CASO) &&
474
- !this.verificarTipoSimboloAtual(tiposDeSimbolos_1.default.PADRAO) &&
475
- !this.verificarTipoSimboloAtual(tiposDeSimbolos_1.default.CHAVE_DIREITA));
473
+ } while (!this.verificarTipoSimboloAtual(tipos_de_simbolos_1.default.CASO) &&
474
+ !this.verificarTipoSimboloAtual(tipos_de_simbolos_1.default.PADRAO) &&
475
+ !this.verificarTipoSimboloAtual(tipos_de_simbolos_1.default.CHAVE_DIREITA));
476
476
  caminhoPadrao = {
477
477
  declaracoes: declaracoes,
478
478
  };
@@ -485,27 +485,27 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
485
485
  }
486
486
  };
487
487
  AvaliadorSintaticoEguaClassico.prototype.declaracaoImportar = function () {
488
- this.consumir(tiposDeSimbolos_1.default.PARENTESE_ESQUERDO, "Esperado '(' após declaração.");
488
+ this.consumir(tipos_de_simbolos_1.default.PARENTESE_ESQUERDO, "Esperado '(' após declaração.");
489
489
  var caminho = this.expressao();
490
- var simboloFechamento = this.consumir(tiposDeSimbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após declaração.");
490
+ var simboloFechamento = this.consumir(tipos_de_simbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após declaração.");
491
491
  return new declaracoes_1.Importar(caminho, simboloFechamento);
492
492
  };
493
493
  AvaliadorSintaticoEguaClassico.prototype.declaracaoTente = function () {
494
- this.consumir(tiposDeSimbolos_1.default.CHAVE_ESQUERDA, "Esperado '{' após a declaração 'tente'.");
494
+ this.consumir(tipos_de_simbolos_1.default.CHAVE_ESQUERDA, "Esperado '{' após a declaração 'tente'.");
495
495
  var tryBlock = this.blocoEscopo();
496
496
  var catchBlock = null;
497
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.PEGUE)) {
498
- this.consumir(tiposDeSimbolos_1.default.CHAVE_ESQUERDA, "Esperado '{' após a declaração 'pegue'.");
497
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.PEGUE)) {
498
+ this.consumir(tipos_de_simbolos_1.default.CHAVE_ESQUERDA, "Esperado '{' após a declaração 'pegue'.");
499
499
  catchBlock = this.blocoEscopo();
500
500
  }
501
501
  var elseBlock = null;
502
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.SENÃO)) {
503
- this.consumir(tiposDeSimbolos_1.default.CHAVE_ESQUERDA, "Esperado '{' após a declaração 'pegue'.");
502
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.SENÃO)) {
503
+ this.consumir(tipos_de_simbolos_1.default.CHAVE_ESQUERDA, "Esperado '{' após a declaração 'pegue'.");
504
504
  elseBlock = this.blocoEscopo();
505
505
  }
506
506
  var finallyBlock = null;
507
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.FINALMENTE)) {
508
- this.consumir(tiposDeSimbolos_1.default.CHAVE_ESQUERDA, "Esperado '{' após a declaração 'pegue'.");
507
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.FINALMENTE)) {
508
+ this.consumir(tipos_de_simbolos_1.default.CHAVE_ESQUERDA, "Esperado '{' após a declaração 'pegue'.");
509
509
  finallyBlock = this.blocoEscopo();
510
510
  }
511
511
  return new declaracoes_1.Tente(tryBlock, catchBlock, elseBlock, finallyBlock);
@@ -514,10 +514,10 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
514
514
  try {
515
515
  this.ciclos += 1;
516
516
  var caminhoFazer = this.resolverDeclaracao();
517
- this.consumir(tiposDeSimbolos_1.default.ENQUANTO, "Esperado declaração do 'enquanto' após o escopo do 'fazer'.");
518
- this.consumir(tiposDeSimbolos_1.default.PARENTESE_ESQUERDO, "Esperado '(' após declaração 'enquanto'.");
517
+ this.consumir(tipos_de_simbolos_1.default.ENQUANTO, "Esperado declaração do 'enquanto' após o escopo do 'fazer'.");
518
+ this.consumir(tipos_de_simbolos_1.default.PARENTESE_ESQUERDO, "Esperado '(' após declaração 'enquanto'.");
519
519
  var condicaoEnquanto = this.expressao();
520
- this.consumir(tiposDeSimbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após declaração do 'enquanto'.");
520
+ this.consumir(tipos_de_simbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após declaração do 'enquanto'.");
521
521
  return new declaracoes_1.Fazer(caminhoFazer, condicaoEnquanto);
522
522
  }
523
523
  finally {
@@ -525,99 +525,99 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
525
525
  }
526
526
  };
527
527
  AvaliadorSintaticoEguaClassico.prototype.resolverDeclaracao = function () {
528
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.FAZER))
528
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.FAZER))
529
529
  return this.declaracaoFazer();
530
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.TENTE))
530
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.TENTE))
531
531
  return this.declaracaoTente();
532
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.ESCOLHA))
532
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.ESCOLHA))
533
533
  return this.declaracaoEscolha();
534
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.RETORNA))
534
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.RETORNA))
535
535
  return this.declaracaoRetorna();
536
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.CONTINUA))
536
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.CONTINUA))
537
537
  return this.declaracaoContinua();
538
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.PAUSA))
538
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.PAUSA))
539
539
  return this.declaracaoSustar();
540
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.PARA))
540
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.PARA))
541
541
  return this.declaracaoPara();
542
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.ENQUANTO))
542
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.ENQUANTO))
543
543
  return this.declaracaoEnquanto();
544
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.SE))
544
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.SE))
545
545
  return this.declaracaoSe();
546
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.ESCREVA))
546
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.ESCREVA))
547
547
  return this.declaracaoEscreva();
548
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.CHAVE_ESQUERDA))
548
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.CHAVE_ESQUERDA))
549
549
  return new declaracoes_1.Bloco(this.blocoEscopo());
550
550
  return this.declaracaoExpressao();
551
551
  };
552
552
  AvaliadorSintaticoEguaClassico.prototype.declaracaoDeVariavel = function () {
553
- var nome = this.consumir(tiposDeSimbolos_1.default.IDENTIFICADOR, 'Esperado nome de variável.');
553
+ var nome = this.consumir(tipos_de_simbolos_1.default.IDENTIFICADOR, 'Esperado nome de variável.');
554
554
  var inicializador = null;
555
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.IGUAL)) {
555
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.IGUAL)) {
556
556
  inicializador = this.expressao();
557
557
  }
558
- this.consumir(tiposDeSimbolos_1.default.PONTO_E_VIRGULA, "Esperado ';' após a declaração da variável.");
558
+ this.consumir(tipos_de_simbolos_1.default.PONTO_E_VIRGULA, "Esperado ';' após a declaração da variável.");
559
559
  return new declaracoes_1.Var(nome, inicializador);
560
560
  };
561
561
  AvaliadorSintaticoEguaClassico.prototype.funcao = function (kind) {
562
- var nome = this.consumir(tiposDeSimbolos_1.default.IDENTIFICADOR, "Esperado nome ".concat(kind, "."));
562
+ var nome = this.consumir(tipos_de_simbolos_1.default.IDENTIFICADOR, "Esperado nome ".concat(kind, "."));
563
563
  return new declaracoes_1.Funcao(nome, this.corpoDaFuncao(kind));
564
564
  };
565
565
  AvaliadorSintaticoEguaClassico.prototype.corpoDaFuncao = function (kind) {
566
- this.consumir(tiposDeSimbolos_1.default.PARENTESE_ESQUERDO, "Esperado '(' ap\u00F3s o nome ".concat(kind, "."));
566
+ this.consumir(tipos_de_simbolos_1.default.PARENTESE_ESQUERDO, "Esperado '(' ap\u00F3s o nome ".concat(kind, "."));
567
567
  var parametros = [];
568
- if (!this.verificarTipoSimboloAtual(tiposDeSimbolos_1.default.PARENTESE_DIREITO)) {
568
+ if (!this.verificarTipoSimboloAtual(tipos_de_simbolos_1.default.PARENTESE_DIREITO)) {
569
569
  do {
570
570
  if (parametros.length >= 255) {
571
571
  this.erro(this.simboloAtual(), 'Não pode haver mais de 255 parâmetros');
572
572
  }
573
573
  var paramObj = {};
574
- if (this.simboloAtual().tipo === tiposDeSimbolos_1.default.MULTIPLICACAO) {
575
- this.consumir(tiposDeSimbolos_1.default.MULTIPLICACAO, null);
574
+ if (this.simboloAtual().tipo === tipos_de_simbolos_1.default.MULTIPLICACAO) {
575
+ this.consumir(tipos_de_simbolos_1.default.MULTIPLICACAO, null);
576
576
  paramObj['tipo'] = 'wildcard';
577
577
  }
578
578
  else {
579
579
  paramObj['tipo'] = 'standard';
580
580
  }
581
- paramObj['nome'] = this.consumir(tiposDeSimbolos_1.default.IDENTIFICADOR, 'Esperado nome do parâmetro.');
582
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.IGUAL)) {
581
+ paramObj['nome'] = this.consumir(tipos_de_simbolos_1.default.IDENTIFICADOR, 'Esperado nome do parâmetro.');
582
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.IGUAL)) {
583
583
  paramObj['default'] = this.primario();
584
584
  }
585
585
  parametros.push(paramObj);
586
586
  if (paramObj['tipo'] === 'wildcard')
587
587
  break;
588
- } while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.VIRGULA));
588
+ } while (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.VIRGULA));
589
589
  }
590
- this.consumir(tiposDeSimbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após parâmetros.");
591
- this.consumir(tiposDeSimbolos_1.default.CHAVE_ESQUERDA, "Esperado '{' antes do escopo do ".concat(kind, "."));
590
+ this.consumir(tipos_de_simbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após parâmetros.");
591
+ this.consumir(tipos_de_simbolos_1.default.CHAVE_ESQUERDA, "Esperado '{' antes do escopo do ".concat(kind, "."));
592
592
  var corpo = this.blocoEscopo();
593
593
  return new construtos_1.Funcao(0, parametros, corpo);
594
594
  };
595
595
  AvaliadorSintaticoEguaClassico.prototype.declaracaoDeClasse = function () {
596
- var nome = this.consumir(tiposDeSimbolos_1.default.IDENTIFICADOR, 'Esperado nome da classe.');
596
+ var nome = this.consumir(tipos_de_simbolos_1.default.IDENTIFICADOR, 'Esperado nome da classe.');
597
597
  var superClasse = null;
598
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.HERDA)) {
599
- this.consumir(tiposDeSimbolos_1.default.IDENTIFICADOR, 'Esperado nome da SuperClasse.');
598
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.HERDA)) {
599
+ this.consumir(tipos_de_simbolos_1.default.IDENTIFICADOR, 'Esperado nome da SuperClasse.');
600
600
  superClasse = new construtos_1.Variavel(this.simboloAnterior());
601
601
  }
602
- this.consumir(tiposDeSimbolos_1.default.CHAVE_ESQUERDA, "Esperado '{' antes do escopo da classe.");
602
+ this.consumir(tipos_de_simbolos_1.default.CHAVE_ESQUERDA, "Esperado '{' antes do escopo da classe.");
603
603
  var metodos = [];
604
- while (!this.verificarTipoSimboloAtual(tiposDeSimbolos_1.default.CHAVE_DIREITA) &&
604
+ while (!this.verificarTipoSimboloAtual(tipos_de_simbolos_1.default.CHAVE_DIREITA) &&
605
605
  !this.estaNoFinal()) {
606
606
  metodos.push(this.funcao('método'));
607
607
  }
608
- this.consumir(tiposDeSimbolos_1.default.CHAVE_DIREITA, "Esperado '}' após o escopo da classe.");
608
+ this.consumir(tipos_de_simbolos_1.default.CHAVE_DIREITA, "Esperado '}' após o escopo da classe.");
609
609
  return new declaracoes_1.Classe(nome, superClasse, metodos);
610
610
  };
611
611
  AvaliadorSintaticoEguaClassico.prototype.declaracao = function () {
612
612
  try {
613
- if (this.verificarTipoSimboloAtual(tiposDeSimbolos_1.default.FUNÇÃO) &&
614
- this.verificarTipoProximoSimbolo(tiposDeSimbolos_1.default.IDENTIFICADOR)) {
615
- this.consumir(tiposDeSimbolos_1.default.FUNÇÃO, null);
613
+ if (this.verificarTipoSimboloAtual(tipos_de_simbolos_1.default.FUNÇÃO) &&
614
+ this.verificarTipoProximoSimbolo(tipos_de_simbolos_1.default.IDENTIFICADOR)) {
615
+ this.consumir(tipos_de_simbolos_1.default.FUNÇÃO, null);
616
616
  return this.funcao('função');
617
617
  }
618
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.VARIAVEL))
618
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.VARIAVEL))
619
619
  return this.declaracaoDeVariavel();
620
- if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.CLASSE))
620
+ if (this.verificarSeSimboloAtualEIgualA(tipos_de_simbolos_1.default.CLASSE))
621
621
  return this.declaracaoDeClasse();
622
622
  return this.resolverDeclaracao();
623
623
  }
@@ -626,13 +626,11 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
626
626
  return null;
627
627
  }
628
628
  };
629
- AvaliadorSintaticoEguaClassico.prototype.analisar = function (simbolos) {
629
+ AvaliadorSintaticoEguaClassico.prototype.analisar = function (retornoLexador) {
630
630
  this.erros = [];
631
631
  this.atual = 0;
632
632
  this.ciclos = 0;
633
- if (simbolos) {
634
- this.simbolos = simbolos;
635
- }
633
+ this.simbolos = (retornoLexador === null || retornoLexador === void 0 ? void 0 : retornoLexador.simbolos) || [];
636
634
  var declaracoes = [];
637
635
  while (!this.estaNoFinal()) {
638
636
  declaracoes.push(this.declaracao());
@@ -645,4 +643,4 @@ var AvaliadorSintaticoEguaClassico = /** @class */ (function () {
645
643
  return AvaliadorSintaticoEguaClassico;
646
644
  }());
647
645
  exports.AvaliadorSintaticoEguaClassico = AvaliadorSintaticoEguaClassico;
648
- //# sourceMappingURL=egua-classico.js.map
646
+ //# sourceMappingURL=avaliador-sintatico-egua-classico.js.map