@designliquido/delegua 0.1.4 → 0.1.8

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 (175) hide show
  1. package/bin/package.json +4 -3
  2. package/index.d.ts +1 -0
  3. package/package.json +3 -2
  4. package/src/ambiente.d.ts +11 -0
  5. package/src/avaliador-sintatico/dialetos/egua-classico.d.ts +60 -0
  6. package/src/avaliador-sintatico/dialetos/egua-classico.js +116 -116
  7. package/src/avaliador-sintatico/dialetos/egua-classico.js.map +1 -1
  8. package/src/avaliador-sintatico/dialetos/index.d.ts +1 -0
  9. package/src/avaliador-sintatico/erros-avaliador.d.ts +2 -0
  10. package/src/avaliador-sintatico/{parser-error.js → erros-avaliador.js} +1 -1
  11. package/src/avaliador-sintatico/erros-avaliador.js.map +1 -0
  12. package/src/avaliador-sintatico/index.d.ts +61 -0
  13. package/src/avaliador-sintatico/index.js +123 -123
  14. package/src/avaliador-sintatico/index.js.map +1 -1
  15. package/src/bibliotecas/bibliotecaGlobal.d.ts +1 -0
  16. package/src/bibliotecas/importarBiblioteca.d.ts +2 -0
  17. package/src/construtos/assign-subscript.d.ts +8 -0
  18. package/src/construtos/assign-subscript.js +1 -1
  19. package/src/construtos/assign-subscript.js.map +1 -1
  20. package/src/construtos/atribuir.d.ts +7 -0
  21. package/src/construtos/atribuir.js +1 -1
  22. package/src/construtos/atribuir.js.map +1 -1
  23. package/src/construtos/binario.d.ts +8 -0
  24. package/src/construtos/binario.js +1 -1
  25. package/src/construtos/binario.js.map +1 -1
  26. package/src/construtos/call.d.ts +8 -0
  27. package/src/construtos/call.js +1 -1
  28. package/src/construtos/call.js.map +1 -1
  29. package/src/construtos/conjunto.d.ts +8 -0
  30. package/src/construtos/conjunto.js +1 -1
  31. package/src/construtos/conjunto.js.map +1 -1
  32. package/src/construtos/dicionario.d.ts +7 -0
  33. package/src/construtos/dicionario.js +1 -1
  34. package/src/construtos/dicionario.js.map +1 -1
  35. package/src/construtos/expr.d.ts +3 -0
  36. package/src/construtos/funcao.d.ts +7 -0
  37. package/src/construtos/funcao.js +1 -1
  38. package/src/construtos/funcao.js.map +1 -1
  39. package/src/construtos/get.d.ts +7 -0
  40. package/src/construtos/get.js +1 -1
  41. package/src/construtos/get.js.map +1 -1
  42. package/src/construtos/grouping.d.ts +6 -0
  43. package/src/construtos/grouping.js +1 -1
  44. package/src/construtos/grouping.js.map +1 -1
  45. package/src/construtos/index.d.ts +18 -0
  46. package/src/construtos/isto.d.ts +6 -0
  47. package/src/construtos/isto.js +1 -1
  48. package/src/construtos/isto.js.map +1 -1
  49. package/src/construtos/literal.d.ts +6 -0
  50. package/src/construtos/literal.js +1 -1
  51. package/src/construtos/literal.js.map +1 -1
  52. package/src/construtos/logical.d.ts +8 -0
  53. package/src/construtos/logical.js +1 -1
  54. package/src/construtos/logical.js.map +1 -1
  55. package/src/construtos/subscript.d.ts +8 -0
  56. package/src/construtos/subscript.js +1 -1
  57. package/src/construtos/subscript.js.map +1 -1
  58. package/src/construtos/super.d.ts +7 -0
  59. package/src/construtos/super.js +1 -1
  60. package/src/construtos/super.js.map +1 -1
  61. package/src/construtos/unario.d.ts +7 -0
  62. package/src/construtos/unario.js +1 -1
  63. package/src/construtos/unario.js.map +1 -1
  64. package/src/construtos/variavel.d.ts +6 -0
  65. package/src/construtos/variavel.js +1 -1
  66. package/src/construtos/variavel.js.map +1 -1
  67. package/src/construtos/vetor.d.ts +6 -0
  68. package/src/construtos/vetor.js +1 -1
  69. package/src/construtos/vetor.js.map +1 -1
  70. package/src/declaracoes/block.d.ts +6 -0
  71. package/src/declaracoes/block.js +33 -0
  72. package/src/declaracoes/block.js.map +1 -0
  73. package/src/declaracoes/classe.d.ts +8 -0
  74. package/src/declaracoes/classe.js +35 -0
  75. package/src/declaracoes/classe.js.map +1 -0
  76. package/src/declaracoes/continua.d.ts +5 -0
  77. package/src/declaracoes/continua.js +31 -0
  78. package/src/declaracoes/continua.js.map +1 -0
  79. package/src/declaracoes/enquanto.d.ts +7 -0
  80. package/src/declaracoes/enquanto.js +34 -0
  81. package/src/declaracoes/enquanto.js.map +1 -0
  82. package/src/declaracoes/escolha.d.ts +8 -0
  83. package/src/declaracoes/escolha.js +35 -0
  84. package/src/declaracoes/escolha.js.map +1 -0
  85. package/src/declaracoes/escreva.d.ts +6 -0
  86. package/src/declaracoes/escreva.js +33 -0
  87. package/src/declaracoes/escreva.js.map +1 -0
  88. package/src/declaracoes/expressao.d.ts +6 -0
  89. package/src/declaracoes/expressao.js +33 -0
  90. package/src/declaracoes/expressao.js.map +1 -0
  91. package/src/declaracoes/fazer.d.ts +7 -0
  92. package/src/declaracoes/fazer.js +34 -0
  93. package/src/declaracoes/fazer.js.map +1 -0
  94. package/src/declaracoes/funcao.d.ts +7 -0
  95. package/src/declaracoes/funcao.js +34 -0
  96. package/src/declaracoes/funcao.js.map +1 -0
  97. package/src/declaracoes/importar.d.ts +7 -0
  98. package/src/declaracoes/importar.js +34 -0
  99. package/src/declaracoes/importar.js.map +1 -0
  100. package/src/declaracoes/index.d.ts +17 -0
  101. package/src/declaracoes/index.js +27 -246
  102. package/src/declaracoes/index.js.map +1 -1
  103. package/src/declaracoes/para.d.ts +9 -0
  104. package/src/declaracoes/para.js +36 -0
  105. package/src/declaracoes/para.js.map +1 -0
  106. package/src/declaracoes/pausa.d.ts +5 -0
  107. package/src/declaracoes/pausa.js +31 -0
  108. package/src/declaracoes/pausa.js.map +1 -0
  109. package/src/declaracoes/retorna.d.ts +7 -0
  110. package/src/declaracoes/retorna.js +34 -0
  111. package/src/declaracoes/retorna.js.map +1 -0
  112. package/src/declaracoes/se.d.ts +9 -0
  113. package/src/declaracoes/se.js +36 -0
  114. package/src/declaracoes/se.js.map +1 -0
  115. package/src/declaracoes/stmt.d.ts +3 -0
  116. package/src/declaracoes/stmt.js +11 -0
  117. package/src/declaracoes/stmt.js.map +1 -0
  118. package/src/declaracoes/tente.d.ts +9 -0
  119. package/src/declaracoes/tente.js +36 -0
  120. package/src/declaracoes/tente.js.map +1 -0
  121. package/src/declaracoes/var.d.ts +7 -0
  122. package/src/declaracoes/var.js +34 -0
  123. package/src/declaracoes/var.js.map +1 -0
  124. package/src/delegua.d.ts +21 -0
  125. package/src/delegua.js +12 -6
  126. package/src/delegua.js.map +1 -1
  127. package/src/estruturas/callable.d.ts +5 -0
  128. package/src/estruturas/classe.d.ts +11 -0
  129. package/src/estruturas/funcao-padrao.d.ts +9 -0
  130. package/src/estruturas/funcao.d.ts +12 -0
  131. package/src/estruturas/funcao.js +1 -1
  132. package/src/estruturas/funcao.js.map +1 -1
  133. package/src/estruturas/index.d.ts +6 -0
  134. package/src/estruturas/instancia.d.ts +8 -0
  135. package/src/estruturas/modulo.d.ts +5 -0
  136. package/src/excecoes/break-exception.d.ts +2 -0
  137. package/src/excecoes/continue-exception.d.ts +2 -0
  138. package/src/excecoes/erro-em-tempo-de-execucao.d.ts +5 -0
  139. package/src/excecoes/index.d.ts +4 -0
  140. package/src/excecoes/return-exception.d.ts +4 -0
  141. package/src/interfaces/avaliador-sintatico-interface.d.ts +55 -0
  142. package/src/interfaces/index.d.ts +6 -0
  143. package/src/interfaces/interpretador-interface.d.ts +51 -0
  144. package/src/interfaces/lexador-interface.d.ts +23 -0
  145. package/src/interfaces/pilha-interface.d.ts +7 -0
  146. package/src/interfaces/resolvedor-interface.d.ts +48 -0
  147. package/src/interfaces/simbolo-interface.d.ts +6 -0
  148. package/src/interpretador/dialetos/egua-classico.d.ts +58 -0
  149. package/src/interpretador/dialetos/egua-classico.js +64 -68
  150. package/src/interpretador/dialetos/egua-classico.js.map +1 -1
  151. package/src/interpretador/dialetos/index.d.ts +1 -0
  152. package/src/interpretador/index.d.ts +58 -0
  153. package/src/interpretador/index.js +74 -75
  154. package/src/interpretador/index.js.map +1 -1
  155. package/src/lexador/dialetos/egua-classico.d.ts +31 -0
  156. package/src/lexador/dialetos/egua-classico.js +5 -7
  157. package/src/lexador/dialetos/egua-classico.js.map +1 -1
  158. package/src/lexador/dialetos/index.d.ts +1 -0
  159. package/src/lexador/index.d.ts +31 -0
  160. package/src/lexador/index.js +7 -10
  161. package/src/lexador/index.js.map +1 -1
  162. package/src/resolvedor/Pilha.d.ts +9 -0
  163. package/src/resolvedor/ResolverError.d.ts +4 -0
  164. package/src/resolvedor/dialetos/egua-classico.d.ts +56 -0
  165. package/src/resolvedor/dialetos/egua-classico.js +39 -39
  166. package/src/resolvedor/dialetos/egua-classico.js.map +1 -1
  167. package/src/resolvedor/dialetos/index.d.ts +1 -0
  168. package/src/resolvedor/index.d.ts +56 -0
  169. package/src/resolvedor/index.js +39 -39
  170. package/src/resolvedor/index.js.map +1 -1
  171. package/src/tiposDeSimbolos.d.ts +67 -0
  172. package/src/tiposDeSimbolos.js +1 -1
  173. package/src/tiposDeSimbolos.js.map +1 -1
  174. package/src/web.d.ts +11 -0
  175. package/src/avaliador-sintatico/parser-error.js.map +0 -1
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ParserEguaClassico = void 0;
4
4
  var tiposDeSimbolos_1 = require("../../tiposDeSimbolos");
5
5
  var construtos_1 = require("../../construtos");
6
+ var erros_avaliador_1 = require("../erros-avaliador");
6
7
  var declaracoes_1 = require("../../declaracoes");
7
- var parser_error_1 = require("../parser-error");
8
8
  /**
9
9
  * O avaliador sintático (Parser) é responsável por transformar os símbolos do Lexador em estruturas de alto nível.
10
10
  * Essas estruturas de alto nível são as partes que executam lógica de programação de fato.
@@ -21,7 +21,7 @@ var ParserEguaClassico = /** @class */ (function () {
21
21
  while (!this.estaNoFinal()) {
22
22
  if (this.voltar().tipo === tiposDeSimbolos_1.default.PONTO_E_VIRGULA)
23
23
  return;
24
- switch (this.peek().tipo) {
24
+ switch (this.simboloAtual().tipo) {
25
25
  case tiposDeSimbolos_1.default.CLASSE:
26
26
  case tiposDeSimbolos_1.default.FUNCAO:
27
27
  case tiposDeSimbolos_1.default.VAR:
@@ -37,25 +37,25 @@ var ParserEguaClassico = /** @class */ (function () {
37
37
  };
38
38
  ParserEguaClassico.prototype.erro = function (simbolo, mensagemDeErro) {
39
39
  this.Delegua.erro(simbolo, mensagemDeErro);
40
- return new parser_error_1.ErroAvaliador();
40
+ return new erros_avaliador_1.ErroAvaliador();
41
41
  };
42
42
  ParserEguaClassico.prototype.consumir = function (tipo, mensagemDeErro) {
43
43
  if (this.verificar(tipo))
44
44
  return this.avancar();
45
45
  else
46
- throw this.erro(this.peek(), mensagemDeErro);
46
+ throw this.erro(this.simboloAtual(), mensagemDeErro);
47
47
  };
48
48
  ParserEguaClassico.prototype.verificar = function (tipo) {
49
49
  if (this.estaNoFinal())
50
50
  return false;
51
- return this.peek().tipo === tipo;
51
+ return this.simboloAtual().tipo === tipo;
52
52
  };
53
53
  ParserEguaClassico.prototype.verificarProximo = function (tipo) {
54
54
  if (this.estaNoFinal())
55
55
  return false;
56
56
  return this.simbolos[this.atual + 1].tipo === tipo;
57
57
  };
58
- ParserEguaClassico.prototype.peek = function () {
58
+ ParserEguaClassico.prototype.simboloAtual = function () {
59
59
  return this.simbolos[this.atual];
60
60
  };
61
61
  ParserEguaClassico.prototype.voltar = function () {
@@ -65,14 +65,14 @@ var ParserEguaClassico = /** @class */ (function () {
65
65
  return this.simbolos[this.atual + posicao];
66
66
  };
67
67
  ParserEguaClassico.prototype.estaNoFinal = function () {
68
- return this.peek().tipo === tiposDeSimbolos_1.default.EOF;
68
+ return this.simboloAtual().tipo === tiposDeSimbolos_1.default.EOF;
69
69
  };
70
70
  ParserEguaClassico.prototype.avancar = function () {
71
71
  if (!this.estaNoFinal())
72
72
  this.atual += 1;
73
73
  return this.voltar();
74
74
  };
75
- ParserEguaClassico.prototype.match = function () {
75
+ ParserEguaClassico.prototype.verificarSeSimboloAtualEIgualA = function () {
76
76
  var argumentos = [];
77
77
  for (var _i = 0; _i < arguments.length; _i++) {
78
78
  argumentos[_i] = arguments[_i];
@@ -87,78 +87,78 @@ var ParserEguaClassico = /** @class */ (function () {
87
87
  return false;
88
88
  };
89
89
  ParserEguaClassico.prototype.primario = function () {
90
- if (this.match(tiposDeSimbolos_1.default.SUPER)) {
90
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.SUPER)) {
91
91
  var palavraChave = this.voltar();
92
- this.consumir(tiposDeSimbolos_1.default.DOT, "Esperado '.' após 'super'.");
92
+ this.consumir(tiposDeSimbolos_1.default.PONTO, "Esperado '.' após 'super'.");
93
93
  var metodo = this.consumir(tiposDeSimbolos_1.default.IDENTIFICADOR, "Esperado nome do método da SuperClasse.");
94
94
  return new construtos_1.Super(palavraChave, metodo);
95
95
  }
96
- if (this.match(tiposDeSimbolos_1.default.COLCHETE_ESQUERDO)) {
96
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.COLCHETE_ESQUERDO)) {
97
97
  var valores = [];
98
- if (this.match(tiposDeSimbolos_1.default.COLCHETE_DIREITO)) {
98
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.COLCHETE_DIREITO)) {
99
99
  return new construtos_1.Vetor([]);
100
100
  }
101
- while (!this.match(tiposDeSimbolos_1.default.COLCHETE_DIREITO)) {
101
+ while (!this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.COLCHETE_DIREITO)) {
102
102
  var valor = this.atribuir();
103
103
  valores.push(valor);
104
- if (this.peek().tipo !== tiposDeSimbolos_1.default.COLCHETE_DIREITO) {
104
+ if (this.simboloAtual().tipo !== tiposDeSimbolos_1.default.COLCHETE_DIREITO) {
105
105
  this.consumir(tiposDeSimbolos_1.default.COMMA, "Esperado vírgula antes da próxima expressão.");
106
106
  }
107
107
  }
108
108
  return new construtos_1.Vetor(valores);
109
109
  }
110
- if (this.match(tiposDeSimbolos_1.default.CHAVE_ESQUERDA)) {
110
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.CHAVE_ESQUERDA)) {
111
111
  var chaves = [];
112
112
  var valores = [];
113
- if (this.match(tiposDeSimbolos_1.default.CHAVE_DIREITA)) {
113
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.CHAVE_DIREITA)) {
114
114
  return new construtos_1.Dicionario([], []);
115
115
  }
116
- while (!this.match(tiposDeSimbolos_1.default.CHAVE_DIREITA)) {
116
+ while (!this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.CHAVE_DIREITA)) {
117
117
  var chave = this.atribuir();
118
118
  this.consumir(tiposDeSimbolos_1.default.DOIS_PONTOS, "Esperado ':' entre chave e valor.");
119
119
  var valor = this.atribuir();
120
120
  chaves.push(chave);
121
121
  valores.push(valor);
122
- if (this.peek().tipo !== tiposDeSimbolos_1.default.CHAVE_DIREITA) {
122
+ if (this.simboloAtual().tipo !== tiposDeSimbolos_1.default.CHAVE_DIREITA) {
123
123
  this.consumir(tiposDeSimbolos_1.default.COMMA, "Esperado vírgula antes da próxima expressão.");
124
124
  }
125
125
  }
126
126
  return new construtos_1.Dicionario(chaves, valores);
127
127
  }
128
- if (this.match(tiposDeSimbolos_1.default.FUNCAO))
128
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.FUNCAO))
129
129
  return this.corpoDaFuncao("funcao");
130
- if (this.match(tiposDeSimbolos_1.default.FALSO))
130
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.FALSO))
131
131
  return new construtos_1.Literal(false);
132
- if (this.match(tiposDeSimbolos_1.default.VERDADEIRO))
132
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.VERDADEIRO))
133
133
  return new construtos_1.Literal(true);
134
- if (this.match(tiposDeSimbolos_1.default.NULO))
134
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.NULO))
135
135
  return new construtos_1.Literal(null);
136
- if (this.match(tiposDeSimbolos_1.default.ISTO))
136
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.ISTO))
137
137
  return new construtos_1.Isto(this.voltar());
138
- if (this.match(tiposDeSimbolos_1.default.NUMERO, tiposDeSimbolos_1.default.TEXTO)) {
138
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.NUMERO, tiposDeSimbolos_1.default.TEXTO)) {
139
139
  return new construtos_1.Literal(this.voltar().literal);
140
140
  }
141
- if (this.match(tiposDeSimbolos_1.default.IDENTIFICADOR)) {
141
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.IDENTIFICADOR)) {
142
142
  return new construtos_1.Variavel(this.voltar());
143
143
  }
144
- if (this.match(tiposDeSimbolos_1.default.PARENTESE_ESQUERDO)) {
144
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.PARENTESE_ESQUERDO)) {
145
145
  var expr = this.expressao();
146
146
  this.consumir(tiposDeSimbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após a expressão.");
147
147
  return new construtos_1.Grouping(expr);
148
148
  }
149
- if (this.match(tiposDeSimbolos_1.default.IMPORTAR))
150
- return this.importStatement();
151
- throw this.erro(this.peek(), "Esperado expressão.");
149
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.IMPORTAR))
150
+ return this.declaracaoImportar();
151
+ throw this.erro(this.simboloAtual(), "Esperado expressão.");
152
152
  };
153
153
  ParserEguaClassico.prototype.finalizarChamada = function (callee) {
154
154
  var argumentos = [];
155
155
  if (!this.verificar(tiposDeSimbolos_1.default.PARENTESE_DIREITO)) {
156
156
  do {
157
157
  if (argumentos.length >= 255) {
158
- throw this.erro(this.peek(), "Não pode haver mais de 255 argumentos.");
158
+ throw this.erro(this.simboloAtual(), "Não pode haver mais de 255 argumentos.");
159
159
  }
160
160
  argumentos.push(this.expressao());
161
- } while (this.match(tiposDeSimbolos_1.default.COMMA));
161
+ } while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.COMMA));
162
162
  }
163
163
  var parenteseDireito = this.consumir(tiposDeSimbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após os argumentos.");
164
164
  return new construtos_1.Call(callee, parenteseDireito, argumentos);
@@ -166,14 +166,14 @@ var ParserEguaClassico = /** @class */ (function () {
166
166
  ParserEguaClassico.prototype.chamar = function () {
167
167
  var expr = this.primario();
168
168
  while (true) {
169
- if (this.match(tiposDeSimbolos_1.default.PARENTESE_ESQUERDO)) {
169
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.PARENTESE_ESQUERDO)) {
170
170
  expr = this.finalizarChamada(expr);
171
171
  }
172
- else if (this.match(tiposDeSimbolos_1.default.DOT)) {
172
+ else if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.PONTO)) {
173
173
  var nome = this.consumir(tiposDeSimbolos_1.default.IDENTIFICADOR, "Esperado nome do método após '.'.");
174
174
  expr = new construtos_1.Get(expr, nome);
175
175
  }
176
- else if (this.match(tiposDeSimbolos_1.default.COLCHETE_ESQUERDO)) {
176
+ else if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.COLCHETE_ESQUERDO)) {
177
177
  var indice = this.expressao();
178
178
  var closeBracket = this.consumir(tiposDeSimbolos_1.default.COLCHETE_DIREITO, "Esperado ']' após escrita do indice.");
179
179
  expr = new construtos_1.Subscript(expr, indice, closeBracket);
@@ -185,16 +185,16 @@ var ParserEguaClassico = /** @class */ (function () {
185
185
  return expr;
186
186
  };
187
187
  ParserEguaClassico.prototype.unario = function () {
188
- if (this.match(tiposDeSimbolos_1.default.NEGACAO, tiposDeSimbolos_1.default.SUBTRACAO, tiposDeSimbolos_1.default.BIT_NOT)) {
188
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.NEGACAO, tiposDeSimbolos_1.default.SUBTRACAO, tiposDeSimbolos_1.default.BIT_NOT)) {
189
189
  var operador = this.voltar();
190
190
  var direito = this.unario();
191
191
  return new construtos_1.Unario(operador, direito);
192
192
  }
193
193
  return this.chamar();
194
194
  };
195
- ParserEguaClassico.prototype.exponent = function () {
195
+ ParserEguaClassico.prototype.exponenciacao = function () {
196
196
  var expr = this.unario();
197
- while (this.match(tiposDeSimbolos_1.default.EXPONENCIACAO)) {
197
+ while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.EXPONENCIACAO)) {
198
198
  var operador = this.voltar();
199
199
  var direito = this.unario();
200
200
  expr = new construtos_1.Binario(expr, operador, direito);
@@ -202,17 +202,17 @@ var ParserEguaClassico = /** @class */ (function () {
202
202
  return expr;
203
203
  };
204
204
  ParserEguaClassico.prototype.multiplicar = function () {
205
- var expr = this.exponent();
206
- while (this.match(tiposDeSimbolos_1.default.DIVISAO, tiposDeSimbolos_1.default.MULTIPLICACAO, tiposDeSimbolos_1.default.MODULO)) {
205
+ var expr = this.exponenciacao();
206
+ while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.DIVISAO, tiposDeSimbolos_1.default.MULTIPLICACAO, tiposDeSimbolos_1.default.MODULO)) {
207
207
  var operador = this.voltar();
208
- var direito = this.exponent();
208
+ var direito = this.exponenciacao();
209
209
  expr = new construtos_1.Binario(expr, operador, direito);
210
210
  }
211
211
  return expr;
212
212
  };
213
213
  ParserEguaClassico.prototype.adicionar = function () {
214
214
  var expr = this.multiplicar();
215
- while (this.match(tiposDeSimbolos_1.default.SUBTRACAO, tiposDeSimbolos_1.default.ADICAO)) {
215
+ while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.SUBTRACAO, tiposDeSimbolos_1.default.ADICAO)) {
216
216
  var operador = this.voltar();
217
217
  var direito = this.multiplicar();
218
218
  expr = new construtos_1.Binario(expr, operador, direito);
@@ -221,7 +221,7 @@ var ParserEguaClassico = /** @class */ (function () {
221
221
  };
222
222
  ParserEguaClassico.prototype.bitFill = function () {
223
223
  var expr = this.adicionar();
224
- while (this.match(tiposDeSimbolos_1.default.MENOR_MENOR, tiposDeSimbolos_1.default.MAIOR_MAIOR)) {
224
+ while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.MENOR_MENOR, tiposDeSimbolos_1.default.MAIOR_MAIOR)) {
225
225
  var operador = this.voltar();
226
226
  var direito = this.adicionar();
227
227
  expr = new construtos_1.Binario(expr, operador, direito);
@@ -230,7 +230,7 @@ var ParserEguaClassico = /** @class */ (function () {
230
230
  };
231
231
  ParserEguaClassico.prototype.bitE = function () {
232
232
  var expr = this.bitFill();
233
- while (this.match(tiposDeSimbolos_1.default.BIT_AND)) {
233
+ while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.BIT_AND)) {
234
234
  var operador = this.voltar();
235
235
  var direito = this.bitFill();
236
236
  expr = new construtos_1.Binario(expr, operador, direito);
@@ -239,7 +239,7 @@ var ParserEguaClassico = /** @class */ (function () {
239
239
  };
240
240
  ParserEguaClassico.prototype.bitOu = function () {
241
241
  var expr = this.bitE();
242
- while (this.match(tiposDeSimbolos_1.default.BIT_OR, tiposDeSimbolos_1.default.BIT_XOR)) {
242
+ while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.BIT_OR, tiposDeSimbolos_1.default.BIT_XOR)) {
243
243
  var operador = this.voltar();
244
244
  var direito = this.bitE();
245
245
  expr = new construtos_1.Binario(expr, operador, direito);
@@ -248,16 +248,16 @@ var ParserEguaClassico = /** @class */ (function () {
248
248
  };
249
249
  ParserEguaClassico.prototype.comparar = function () {
250
250
  var expr = this.bitOu();
251
- while (this.match(tiposDeSimbolos_1.default.MAIOR, tiposDeSimbolos_1.default.MAIOR_IGUAL, tiposDeSimbolos_1.default.MENOR, tiposDeSimbolos_1.default.MENOR_IGUAL)) {
251
+ while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.MAIOR, tiposDeSimbolos_1.default.MAIOR_IGUAL, tiposDeSimbolos_1.default.MENOR, tiposDeSimbolos_1.default.MENOR_IGUAL)) {
252
252
  var operador = this.voltar();
253
253
  var direito = this.bitOu();
254
254
  expr = new construtos_1.Binario(expr, operador, direito);
255
255
  }
256
256
  return expr;
257
257
  };
258
- ParserEguaClassico.prototype.equality = function () {
258
+ ParserEguaClassico.prototype.comparacaoIgualdade = function () {
259
259
  var expr = this.comparar();
260
- while (this.match(tiposDeSimbolos_1.default.DIFERENTE, tiposDeSimbolos_1.default.IGUAL_IGUAL)) {
260
+ while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.DIFERENTE, tiposDeSimbolos_1.default.IGUAL_IGUAL)) {
261
261
  var operador = this.voltar();
262
262
  var direito = this.comparar();
263
263
  expr = new construtos_1.Binario(expr, operador, direito);
@@ -265,17 +265,17 @@ var ParserEguaClassico = /** @class */ (function () {
265
265
  return expr;
266
266
  };
267
267
  ParserEguaClassico.prototype.em = function () {
268
- var expr = this.equality();
269
- while (this.match(tiposDeSimbolos_1.default.EM)) {
268
+ var expr = this.comparacaoIgualdade();
269
+ while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.EM)) {
270
270
  var operador = this.voltar();
271
- var direito = this.equality();
271
+ var direito = this.comparacaoIgualdade();
272
272
  expr = new construtos_1.Logical(expr, operador, direito);
273
273
  }
274
274
  return expr;
275
275
  };
276
276
  ParserEguaClassico.prototype.e = function () {
277
277
  var expr = this.em();
278
- while (this.match(tiposDeSimbolos_1.default.E)) {
278
+ while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.E)) {
279
279
  var operador = this.voltar();
280
280
  var direito = this.em();
281
281
  expr = new construtos_1.Logical(expr, operador, direito);
@@ -284,7 +284,7 @@ var ParserEguaClassico = /** @class */ (function () {
284
284
  };
285
285
  ParserEguaClassico.prototype.ou = function () {
286
286
  var expr = this.e();
287
- while (this.match(tiposDeSimbolos_1.default.OU)) {
287
+ while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.OU)) {
288
288
  var operador = this.voltar();
289
289
  var direito = this.e();
290
290
  expr = new construtos_1.Logical(expr, operador, direito);
@@ -293,8 +293,7 @@ var ParserEguaClassico = /** @class */ (function () {
293
293
  };
294
294
  ParserEguaClassico.prototype.atribuir = function () {
295
295
  var expr = this.ou();
296
- if (this.match(tiposDeSimbolos_1.default.IGUAL) ||
297
- this.match(tiposDeSimbolos_1.default.MAIS_IGUAL)) {
296
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.IGUAL)) {
298
297
  var igual = this.voltar();
299
298
  var valor = this.atribuir();
300
299
  if (expr instanceof construtos_1.Variavel) {
@@ -322,12 +321,12 @@ var ParserEguaClassico = /** @class */ (function () {
322
321
  this.consumir(tiposDeSimbolos_1.default.PONTO_E_VIRGULA, "Esperado ';' após o valor.");
323
322
  return new declaracoes_1.Escreva(valor);
324
323
  };
325
- ParserEguaClassico.prototype.expressionStatement = function () {
324
+ ParserEguaClassico.prototype.declaracaoExpressao = function () {
326
325
  var expr = this.expressao();
327
326
  this.consumir(tiposDeSimbolos_1.default.PONTO_E_VIRGULA, "Esperado ';' após expressão.");
328
327
  return new declaracoes_1.Expressao(expr);
329
328
  };
330
- ParserEguaClassico.prototype.block = function () {
329
+ ParserEguaClassico.prototype.blocoEscopo = function () {
331
330
  var declaracoes = [];
332
331
  while (!this.verificar(tiposDeSimbolos_1.default.CHAVE_DIREITA) &&
333
332
  !this.estaNoFinal()) {
@@ -340,50 +339,50 @@ var ParserEguaClassico = /** @class */ (function () {
340
339
  this.consumir(tiposDeSimbolos_1.default.PARENTESE_ESQUERDO, "Esperado '(' após 'se'.");
341
340
  var condicao = this.expressao();
342
341
  this.consumir(tiposDeSimbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após condição do se.");
343
- var thenBranch = this.statement();
342
+ var thenBranch = this.resolverDeclaracao();
344
343
  var elifBranches = [];
345
- while (this.match(tiposDeSimbolos_1.default.SENAOSE)) {
344
+ while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.SENAOSE)) {
346
345
  this.consumir(tiposDeSimbolos_1.default.PARENTESE_ESQUERDO, "Esperado '(' após 'senaose'.");
347
346
  var elifCondition = this.expressao();
348
347
  this.consumir(tiposDeSimbolos_1.default.PARENTESE_DIREITO, "Esperado ')' apóes codição do 'senaose.");
349
- var branch = this.statement();
348
+ var branch = this.resolverDeclaracao();
350
349
  elifBranches.push({
351
350
  condition: elifCondition,
352
351
  branch: branch,
353
352
  });
354
353
  }
355
354
  var elseBranch = null;
356
- if (this.match(tiposDeSimbolos_1.default.SENAO)) {
357
- elseBranch = this.statement();
355
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.SENAO)) {
356
+ elseBranch = this.resolverDeclaracao();
358
357
  }
359
358
  return new declaracoes_1.Se(condicao, thenBranch, elifBranches, elseBranch);
360
359
  };
361
- ParserEguaClassico.prototype.whileStatement = function () {
360
+ ParserEguaClassico.prototype.declaracaoEnquanto = function () {
362
361
  try {
363
362
  this.ciclos += 1;
364
363
  this.consumir(tiposDeSimbolos_1.default.PARENTESE_ESQUERDO, "Esperado '(' após 'enquanto'.");
365
364
  var condicao = this.expressao();
366
365
  this.consumir(tiposDeSimbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após condicional.");
367
- var corpo = this.statement();
366
+ var corpo = this.resolverDeclaracao();
368
367
  return new declaracoes_1.Enquanto(condicao, corpo);
369
368
  }
370
369
  finally {
371
370
  this.ciclos -= 1;
372
371
  }
373
372
  };
374
- ParserEguaClassico.prototype.forStatement = function () {
373
+ ParserEguaClassico.prototype.declaracaoPara = function () {
375
374
  try {
376
375
  this.ciclos += 1;
377
376
  this.consumir(tiposDeSimbolos_1.default.PARENTESE_ESQUERDO, "Esperado '(' após 'para'.");
378
377
  var inicializador = void 0;
379
- if (this.match(tiposDeSimbolos_1.default.PONTO_E_VIRGULA)) {
378
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.PONTO_E_VIRGULA)) {
380
379
  inicializador = null;
381
380
  }
382
- else if (this.match(tiposDeSimbolos_1.default.VAR)) {
381
+ else if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.VAR)) {
383
382
  inicializador = this.declaracaoDeVariavel();
384
383
  }
385
384
  else {
386
- inicializador = this.expressionStatement();
385
+ inicializador = this.declaracaoExpressao();
387
386
  }
388
387
  var condicao = null;
389
388
  if (!this.verificar(tiposDeSimbolos_1.default.PONTO_E_VIRGULA)) {
@@ -395,7 +394,7 @@ var ParserEguaClassico = /** @class */ (function () {
395
394
  incrementar = this.expressao();
396
395
  }
397
396
  this.consumir(tiposDeSimbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após cláusulas");
398
- var corpo = this.statement();
397
+ var corpo = this.resolverDeclaracao();
399
398
  return new declaracoes_1.Para(inicializador, condicao, incrementar, corpo);
400
399
  }
401
400
  finally {
@@ -409,7 +408,7 @@ var ParserEguaClassico = /** @class */ (function () {
409
408
  this.consumir(tiposDeSimbolos_1.default.PONTO_E_VIRGULA, "Esperado ';' após 'pausa'.");
410
409
  return new declaracoes_1.Pausa();
411
410
  };
412
- ParserEguaClassico.prototype.declaracaoContinue = function () {
411
+ ParserEguaClassico.prototype.declaracaoContinua = function () {
413
412
  if (this.ciclos < 1) {
414
413
  this.erro(this.voltar(), "'continua' precisa estar em um laço de repetição.");
415
414
  }
@@ -434,9 +433,9 @@ var ParserEguaClassico = /** @class */ (function () {
434
433
  this.consumir(tiposDeSimbolos_1.default.CHAVE_ESQUERDA, "Esperado '{' antes do escopo do 'escolha'.");
435
434
  var branches = [];
436
435
  var defaultBranch = null;
437
- while (!this.match(tiposDeSimbolos_1.default.CHAVE_DIREITA) &&
436
+ while (!this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.CHAVE_DIREITA) &&
438
437
  !this.estaNoFinal()) {
439
- if (this.match(tiposDeSimbolos_1.default.CASO)) {
438
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.CASO)) {
440
439
  var branchConditions = [this.expressao()];
441
440
  this.consumir(tiposDeSimbolos_1.default.DOIS_PONTOS, "Esperado ':' após o 'caso'.");
442
441
  while (this.verificar(tiposDeSimbolos_1.default.CASO)) {
@@ -446,7 +445,7 @@ var ParserEguaClassico = /** @class */ (function () {
446
445
  }
447
446
  var stmts = [];
448
447
  do {
449
- stmts.push(this.statement());
448
+ stmts.push(this.resolverDeclaracao());
450
449
  } while (!this.verificar(tiposDeSimbolos_1.default.CASO) &&
451
450
  !this.verificar(tiposDeSimbolos_1.default.PADRAO) &&
452
451
  !this.verificar(tiposDeSimbolos_1.default.CHAVE_DIREITA));
@@ -455,13 +454,13 @@ var ParserEguaClassico = /** @class */ (function () {
455
454
  stmts: stmts,
456
455
  });
457
456
  }
458
- else if (this.match(tiposDeSimbolos_1.default.PADRAO)) {
457
+ else if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.PADRAO)) {
459
458
  if (defaultBranch !== null)
460
- throw new parser_error_1.ErroAvaliador("Você só pode ter um 'padrao' em cada declaração de 'escolha'.");
459
+ throw new erros_avaliador_1.ErroAvaliador("Você só pode ter um 'padrao' em cada declaração de 'escolha'.");
461
460
  this.consumir(tiposDeSimbolos_1.default.DOIS_PONTOS, "Esperado ':' após declaração do 'padrao'.");
462
461
  var stmts = [];
463
462
  do {
464
- stmts.push(this.statement());
463
+ stmts.push(this.resolverDeclaracao());
465
464
  } while (!this.verificar(tiposDeSimbolos_1.default.CASO) &&
466
465
  !this.verificar(tiposDeSimbolos_1.default.PADRAO) &&
467
466
  !this.verificar(tiposDeSimbolos_1.default.CHAVE_DIREITA));
@@ -476,36 +475,36 @@ var ParserEguaClassico = /** @class */ (function () {
476
475
  this.ciclos -= 1;
477
476
  }
478
477
  };
479
- ParserEguaClassico.prototype.importStatement = function () {
478
+ ParserEguaClassico.prototype.declaracaoImportar = function () {
480
479
  this.consumir(tiposDeSimbolos_1.default.PARENTESE_ESQUERDO, "Esperado '(' após declaração.");
481
480
  var caminho = this.expressao();
482
481
  var closeBracket = this.consumir(tiposDeSimbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após declaração.");
483
482
  return new declaracoes_1.Importar(caminho, closeBracket);
484
483
  };
485
- ParserEguaClassico.prototype.tryStatement = function () {
484
+ ParserEguaClassico.prototype.declaracaoTentar = function () {
486
485
  this.consumir(tiposDeSimbolos_1.default.CHAVE_ESQUERDA, "Esperado '{' após a declaração 'tente'.");
487
- var tryBlock = this.block();
486
+ var tryBlock = this.blocoEscopo();
488
487
  var catchBlock = null;
489
- if (this.match(tiposDeSimbolos_1.default.PEGUE)) {
488
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.PEGUE)) {
490
489
  this.consumir(tiposDeSimbolos_1.default.CHAVE_ESQUERDA, "Esperado '{' após a declaração 'pegue'.");
491
- catchBlock = this.block();
490
+ catchBlock = this.blocoEscopo();
492
491
  }
493
492
  var elseBlock = null;
494
- if (this.match(tiposDeSimbolos_1.default.SENAO)) {
493
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.SENAO)) {
495
494
  this.consumir(tiposDeSimbolos_1.default.CHAVE_ESQUERDA, "Esperado '{' após a declaração 'pegue'.");
496
- elseBlock = this.block();
495
+ elseBlock = this.blocoEscopo();
497
496
  }
498
497
  var finallyBlock = null;
499
- if (this.match(tiposDeSimbolos_1.default.FINALMENTE)) {
498
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.FINALMENTE)) {
500
499
  this.consumir(tiposDeSimbolos_1.default.CHAVE_ESQUERDA, "Esperado '{' após a declaração 'pegue'.");
501
- finallyBlock = this.block();
500
+ finallyBlock = this.blocoEscopo();
502
501
  }
503
502
  return new declaracoes_1.Tente(tryBlock, catchBlock, elseBlock, finallyBlock);
504
503
  };
505
- ParserEguaClassico.prototype.doStatement = function () {
504
+ ParserEguaClassico.prototype.declaracaoFazer = function () {
506
505
  try {
507
506
  this.ciclos += 1;
508
- var doBranch = this.statement();
507
+ var doBranch = this.resolverDeclaracao();
509
508
  this.consumir(tiposDeSimbolos_1.default.ENQUANTO, "Esperado declaração do 'enquanto' após o escopo do 'fazer'.");
510
509
  this.consumir(tiposDeSimbolos_1.default.PARENTESE_ESQUERDO, "Esperado '(' após declaração 'enquanto'.");
511
510
  var whileCondition = this.expressao();
@@ -516,36 +515,35 @@ var ParserEguaClassico = /** @class */ (function () {
516
515
  this.ciclos -= 1;
517
516
  }
518
517
  };
519
- ParserEguaClassico.prototype.statement = function () {
520
- if (this.match(tiposDeSimbolos_1.default.FAZER))
521
- return this.doStatement();
522
- if (this.match(tiposDeSimbolos_1.default.TENTE))
523
- return this.tryStatement();
524
- if (this.match(tiposDeSimbolos_1.default.ESCOLHA))
518
+ ParserEguaClassico.prototype.resolverDeclaracao = function () {
519
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.FAZER))
520
+ return this.declaracaoFazer();
521
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.TENTE))
522
+ return this.declaracaoTentar();
523
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.ESCOLHA))
525
524
  return this.declaracaoEscolha();
526
- if (this.match(tiposDeSimbolos_1.default.RETORNA))
525
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.RETORNA))
527
526
  return this.declaracaoRetorna();
528
- if (this.match(tiposDeSimbolos_1.default.CONTINUA))
529
- return this.declaracaoContinue();
530
- if (this.match(tiposDeSimbolos_1.default.PAUSA))
527
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.CONTINUA))
528
+ return this.declaracaoContinua();
529
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.PAUSA))
531
530
  return this.breakStatement();
532
- if (this.match(tiposDeSimbolos_1.default.PARA))
533
- return this.forStatement();
534
- if (this.match(tiposDeSimbolos_1.default.ENQUANTO))
535
- return this.whileStatement();
536
- if (this.match(tiposDeSimbolos_1.default.SE))
531
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.PARA))
532
+ return this.declaracaoPara();
533
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.ENQUANTO))
534
+ return this.declaracaoEnquanto();
535
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.SE))
537
536
  return this.declaracaoSe();
538
- if (this.match(tiposDeSimbolos_1.default.ESCREVA))
537
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.ESCREVA))
539
538
  return this.declaracaoMostrar();
540
- if (this.match(tiposDeSimbolos_1.default.CHAVE_ESQUERDA))
541
- return new declaracoes_1.Block(this.block());
542
- return this.expressionStatement();
539
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.CHAVE_ESQUERDA))
540
+ return new declaracoes_1.Block(this.blocoEscopo());
541
+ return this.declaracaoExpressao();
543
542
  };
544
543
  ParserEguaClassico.prototype.declaracaoDeVariavel = function () {
545
544
  var nome = this.consumir(tiposDeSimbolos_1.default.IDENTIFICADOR, "Esperado nome de variável.");
546
545
  var inicializador = null;
547
- if (this.match(tiposDeSimbolos_1.default.IGUAL) ||
548
- this.match(tiposDeSimbolos_1.default.MAIS_IGUAL)) {
546
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.IGUAL)) {
549
547
  inicializador = this.expressao();
550
548
  }
551
549
  this.consumir(tiposDeSimbolos_1.default.PONTO_E_VIRGULA, "Esperado ';' após a declaração da variável.");
@@ -561,10 +559,10 @@ var ParserEguaClassico = /** @class */ (function () {
561
559
  if (!this.verificar(tiposDeSimbolos_1.default.PARENTESE_DIREITO)) {
562
560
  do {
563
561
  if (parametros.length >= 255) {
564
- this.erro(this.peek(), "Não pode haver mais de 255 parâmetros");
562
+ this.erro(this.simboloAtual(), "Não pode haver mais de 255 parâmetros");
565
563
  }
566
564
  var paramObj = {};
567
- if (this.peek().tipo === tiposDeSimbolos_1.default.MULTIPLICACAO) {
565
+ if (this.simboloAtual().tipo === tiposDeSimbolos_1.default.MULTIPLICACAO) {
568
566
  this.consumir(tiposDeSimbolos_1.default.MULTIPLICACAO, null);
569
567
  paramObj["tipo"] = "wildcard";
570
568
  }
@@ -572,23 +570,23 @@ var ParserEguaClassico = /** @class */ (function () {
572
570
  paramObj["tipo"] = "standard";
573
571
  }
574
572
  paramObj["nome"] = this.consumir(tiposDeSimbolos_1.default.IDENTIFICADOR, "Esperado nome do parâmetro.");
575
- if (this.match(tiposDeSimbolos_1.default.IGUAL)) {
573
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.IGUAL)) {
576
574
  paramObj["default"] = this.primario();
577
575
  }
578
576
  parametros.push(paramObj);
579
577
  if (paramObj["tipo"] === "wildcard")
580
578
  break;
581
- } while (this.match(tiposDeSimbolos_1.default.COMMA));
579
+ } while (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.COMMA));
582
580
  }
583
581
  this.consumir(tiposDeSimbolos_1.default.PARENTESE_DIREITO, "Esperado ')' após parâmetros.");
584
582
  this.consumir(tiposDeSimbolos_1.default.CHAVE_ESQUERDA, "Esperado '{' antes do escopo do ".concat(kind, "."));
585
- var corpo = this.block();
583
+ var corpo = this.blocoEscopo();
586
584
  return new declaracoes_1.Funcao(parametros, corpo);
587
585
  };
588
586
  ParserEguaClassico.prototype.declaracaoDeClasse = function () {
589
587
  var nome = this.consumir(tiposDeSimbolos_1.default.IDENTIFICADOR, "Esperado nome da classe.");
590
588
  var superClasse = null;
591
- if (this.match(tiposDeSimbolos_1.default.HERDA)) {
589
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.HERDA)) {
592
590
  this.consumir(tiposDeSimbolos_1.default.IDENTIFICADOR, "Esperado nome da SuperClasse.");
593
591
  superClasse = new construtos_1.Variavel(this.voltar());
594
592
  }
@@ -608,11 +606,11 @@ var ParserEguaClassico = /** @class */ (function () {
608
606
  this.consumir(tiposDeSimbolos_1.default.FUNCAO, null);
609
607
  return this.funcao("funcao");
610
608
  }
611
- if (this.match(tiposDeSimbolos_1.default.VAR))
609
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.VAR))
612
610
  return this.declaracaoDeVariavel();
613
- if (this.match(tiposDeSimbolos_1.default.CLASSE))
611
+ if (this.verificarSeSimboloAtualEIgualA(tiposDeSimbolos_1.default.CLASSE))
614
612
  return this.declaracaoDeClasse();
615
- return this.statement();
613
+ return this.resolverDeclaracao();
616
614
  }
617
615
  catch (erro) {
618
616
  this.sincronizar();
@@ -620,6 +618,8 @@ var ParserEguaClassico = /** @class */ (function () {
620
618
  }
621
619
  };
622
620
  ParserEguaClassico.prototype.analisar = function (simbolos) {
621
+ this.atual = 0;
622
+ this.ciclos = 0;
623
623
  if (simbolos) {
624
624
  this.simbolos = simbolos;
625
625
  }