@designliquido/lincones-sqlite 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/README.md +15 -0
  2. package/bin/lincones-sqlite +3 -0
  3. package/bin/lincones-sqlite.cmd +1 -0
  4. package/comum/execucao.d.ts +1 -0
  5. package/comum/execucao.js +40 -0
  6. package/comum/execucao.js.map +1 -0
  7. package/comum/fontes/avaliador-sintatico/avaliador-sintatico-base.d.ts +15 -0
  8. package/comum/fontes/avaliador-sintatico/avaliador-sintatico-base.js +46 -0
  9. package/comum/fontes/avaliador-sintatico/avaliador-sintatico-base.js.map +1 -0
  10. package/comum/fontes/avaliador-sintatico/avaliador-sintatico.d.ts +15 -0
  11. package/comum/fontes/avaliador-sintatico/avaliador-sintatico.js +263 -0
  12. package/comum/fontes/avaliador-sintatico/avaliador-sintatico.js.map +1 -0
  13. package/comum/fontes/avaliador-sintatico/erro-avaliador-sintatico.d.ts +5 -0
  14. package/comum/fontes/avaliador-sintatico/erro-avaliador-sintatico.js +12 -0
  15. package/comum/fontes/avaliador-sintatico/erro-avaliador-sintatico.js.map +1 -0
  16. package/comum/fontes/avaliador-sintatico/index.d.ts +3 -0
  17. package/comum/fontes/avaliador-sintatico/index.js +23 -0
  18. package/comum/fontes/avaliador-sintatico/index.js.map +1 -0
  19. package/comum/fontes/comandos/atualizar.d.ts +14 -0
  20. package/comum/fontes/comandos/atualizar.js +14 -0
  21. package/comum/fontes/comandos/atualizar.js.map +1 -0
  22. package/comum/fontes/comandos/comando.d.ts +6 -0
  23. package/comum/fontes/comandos/comando.js +14 -0
  24. package/comum/fontes/comandos/comando.js.map +1 -0
  25. package/comum/fontes/comandos/criar.d.ts +7 -0
  26. package/comum/fontes/comandos/criar.js +13 -0
  27. package/comum/fontes/comandos/criar.js.map +1 -0
  28. package/comum/fontes/comandos/excluir.d.ts +6 -0
  29. package/comum/fontes/comandos/excluir.js +13 -0
  30. package/comum/fontes/comandos/excluir.js.map +1 -0
  31. package/comum/fontes/comandos/index.d.ts +6 -0
  32. package/comum/fontes/comandos/index.js +23 -0
  33. package/comum/fontes/comandos/index.js.map +1 -0
  34. package/comum/fontes/comandos/inserir.d.ts +8 -0
  35. package/comum/fontes/comandos/inserir.js +14 -0
  36. package/comum/fontes/comandos/inserir.js.map +1 -0
  37. package/comum/fontes/comandos/selecionar.d.ts +9 -0
  38. package/comum/fontes/comandos/selecionar.js +15 -0
  39. package/comum/fontes/comandos/selecionar.js.map +1 -0
  40. package/comum/fontes/construtos/coluna.d.ts +11 -0
  41. package/comum/fontes/construtos/coluna.js +16 -0
  42. package/comum/fontes/construtos/coluna.js.map +1 -0
  43. package/comum/fontes/construtos/condicao.d.ts +6 -0
  44. package/comum/fontes/construtos/condicao.js +12 -0
  45. package/comum/fontes/construtos/condicao.js.map +1 -0
  46. package/comum/fontes/construtos/index.d.ts +1 -0
  47. package/comum/fontes/construtos/index.js +18 -0
  48. package/comum/fontes/construtos/index.js.map +1 -0
  49. package/comum/fontes/interfaces/avaliador-sintatico-interface.d.ts +14 -0
  50. package/comum/fontes/interfaces/avaliador-sintatico-interface.js +3 -0
  51. package/comum/fontes/interfaces/avaliador-sintatico-interface.js.map +1 -0
  52. package/comum/fontes/interfaces/index.d.ts +3 -0
  53. package/comum/fontes/interfaces/index.js +18 -0
  54. package/comum/fontes/interfaces/index.js.map +1 -0
  55. package/comum/fontes/interfaces/lincones-interface.d.ts +3 -0
  56. package/comum/fontes/interfaces/lincones-interface.js +3 -0
  57. package/comum/fontes/interfaces/lincones-interface.js.map +1 -0
  58. package/comum/fontes/interfaces/retornos/index.d.ts +16 -0
  59. package/comum/fontes/interfaces/retornos/index.js +3 -0
  60. package/comum/fontes/interfaces/retornos/index.js.map +1 -0
  61. package/comum/fontes/interfaces/simbolo-interface.d.ts +6 -0
  62. package/comum/fontes/interfaces/simbolo-interface.js +3 -0
  63. package/comum/fontes/interfaces/simbolo-interface.js.map +1 -0
  64. package/comum/fontes/lexador/index.d.ts +26 -0
  65. package/comum/fontes/lexador/index.js +220 -0
  66. package/comum/fontes/lexador/index.js.map +1 -0
  67. package/comum/fontes/lexador/simbolo.d.ts +9 -0
  68. package/comum/fontes/lexador/simbolo.js +16 -0
  69. package/comum/fontes/lexador/simbolo.js.map +1 -0
  70. package/comum/fontes/lincones.d.ts +10 -0
  71. package/comum/fontes/lincones.js +21 -0
  72. package/comum/fontes/lincones.js.map +1 -0
  73. package/comum/fontes/palavras-reservadas.d.ts +26 -0
  74. package/comum/fontes/palavras-reservadas.js +32 -0
  75. package/comum/fontes/palavras-reservadas.js.map +1 -0
  76. package/comum/fontes/tipos-de-simbolos.d.ts +38 -0
  77. package/comum/fontes/tipos-de-simbolos.js +40 -0
  78. package/comum/fontes/tipos-de-simbolos.js.map +1 -0
  79. package/comum/fontes/tradutor/index.d.ts +18 -0
  80. package/comum/fontes/tradutor/index.js +161 -0
  81. package/comum/fontes/tradutor/index.js.map +1 -0
  82. package/comum/index.d.ts +1 -0
  83. package/comum/index.js +6 -0
  84. package/comum/index.js.map +1 -0
  85. package/comum/jest.config.d.ts +3 -0
  86. package/comum/jest.config.js +12 -0
  87. package/comum/jest.config.js.map +1 -0
  88. package/execucao.d.ts +1 -0
  89. package/execucao.js +55 -0
  90. package/execucao.js.map +1 -0
  91. package/fontes/avaliador-sintatico/avaliador-sintatico.d.ts +15 -0
  92. package/fontes/avaliador-sintatico/avaliador-sintatico.js +262 -0
  93. package/fontes/avaliador-sintatico/avaliador-sintatico.js.map +1 -0
  94. package/fontes/avaliador-sintatico/index.d.ts +2 -0
  95. package/fontes/avaliador-sintatico/index.js +21 -0
  96. package/fontes/avaliador-sintatico/index.js.map +1 -0
  97. package/fontes/infraestrutura/cliente-sqlite.d.ts +10 -0
  98. package/fontes/infraestrutura/cliente-sqlite.js +65 -0
  99. package/fontes/infraestrutura/cliente-sqlite.js.map +1 -0
  100. package/fontes/infraestrutura/index.d.ts +2 -0
  101. package/fontes/infraestrutura/index.js +19 -0
  102. package/fontes/infraestrutura/index.js.map +1 -0
  103. package/fontes/infraestrutura/retorno-comando.d.ts +7 -0
  104. package/fontes/infraestrutura/retorno-comando.js +22 -0
  105. package/fontes/infraestrutura/retorno-comando.js.map +1 -0
  106. package/fontes/lexador/index.d.ts +26 -0
  107. package/fontes/lexador/index.js +220 -0
  108. package/fontes/lexador/index.js.map +1 -0
  109. package/fontes/lincones-sqlite.d.ts +13 -0
  110. package/fontes/lincones-sqlite.js +29 -0
  111. package/fontes/lincones-sqlite.js.map +1 -0
  112. package/fontes/palavras-reservadas.d.ts +26 -0
  113. package/fontes/palavras-reservadas.js +32 -0
  114. package/fontes/palavras-reservadas.js.map +1 -0
  115. package/fontes/tradutor/index.d.ts +19 -0
  116. package/fontes/tradutor/index.js +150 -0
  117. package/fontes/tradutor/index.js.map +1 -0
  118. package/index.d.ts +1 -0
  119. package/index.js +18 -0
  120. package/index.js.map +1 -0
  121. package/package.json +62 -0
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./atualizar"), exports);
18
+ __exportStar(require("./comando"), exports);
19
+ __exportStar(require("./criar"), exports);
20
+ __exportStar(require("./excluir"), exports);
21
+ __exportStar(require("./inserir"), exports);
22
+ __exportStar(require("./selecionar"), exports);
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../comum/fontes/comandos/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,4CAA0B;AAC1B,0CAAwB;AACxB,4CAA0B;AAC1B,4CAA0B;AAC1B,+CAA6B"}
@@ -0,0 +1,8 @@
1
+ import { SimboloInterface } from "../interfaces";
2
+ import { Comando } from "./comando";
3
+ export declare class Inserir extends Comando {
4
+ tabela: string;
5
+ colunas: string[];
6
+ valores: SimboloInterface[];
7
+ constructor(linha: number, tabela: string, colunas: string[], valores: any[]);
8
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Inserir = void 0;
4
+ const comando_1 = require("./comando");
5
+ class Inserir extends comando_1.Comando {
6
+ constructor(linha, tabela, colunas, valores) {
7
+ super(linha);
8
+ this.tabela = tabela;
9
+ this.colunas = colunas;
10
+ this.valores = valores;
11
+ }
12
+ }
13
+ exports.Inserir = Inserir;
14
+ //# sourceMappingURL=inserir.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inserir.js","sourceRoot":"","sources":["../../../../comum/fontes/comandos/inserir.ts"],"names":[],"mappings":";;;AACA,uCAAoC;AAEpC,MAAa,OAAQ,SAAQ,iBAAO;IAKhC,YAAY,KAAa,EAAE,MAAc,EAAE,OAAiB,EAAE,OAAc;QACxE,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;CACJ;AAXD,0BAWC"}
@@ -0,0 +1,9 @@
1
+ import { Condicao } from "../construtos";
2
+ import { Comando } from "./comando";
3
+ export declare class Selecionar extends Comando {
4
+ tabela: string;
5
+ colunas: string[];
6
+ tudo: boolean;
7
+ condicoes: Condicao[];
8
+ constructor(linha: number, tabela: string, colunas: string[], condicoes: Condicao[], tudo?: boolean);
9
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Selecionar = void 0;
4
+ const comando_1 = require("./comando");
5
+ class Selecionar extends comando_1.Comando {
6
+ constructor(linha, tabela, colunas, condicoes, tudo = false) {
7
+ super(linha);
8
+ this.tabela = tabela;
9
+ this.tudo = tudo;
10
+ this.colunas = colunas;
11
+ this.condicoes = condicoes;
12
+ }
13
+ }
14
+ exports.Selecionar = Selecionar;
15
+ //# sourceMappingURL=selecionar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selecionar.js","sourceRoot":"","sources":["../../../../comum/fontes/comandos/selecionar.ts"],"names":[],"mappings":";;;AACA,uCAAoC;AAEpC,MAAa,UAAW,SAAQ,iBAAO;IAMnC,YAAY,KAAa,EAAE,MAAc,EAAE,OAAiB,EAAE,SAAqB,EAAE,IAAI,GAAG,KAAK;QAC7F,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC/B,CAAC;CACJ;AAbD,gCAaC"}
@@ -0,0 +1,11 @@
1
+ import { Simbolo } from "../lexador/simbolo";
2
+ export declare class Coluna {
3
+ nomeColuna: string;
4
+ tipo: 'INTEIRO' | 'LOGICO' | 'NUMERO' | 'TEXTO';
5
+ tamanho: number | Simbolo;
6
+ nulo: boolean;
7
+ chavePrimaria: boolean;
8
+ chaveEstrangeira: boolean;
9
+ autoIncremento: boolean;
10
+ constructor(nomeColuna: string, tipo: 'INTEIRO' | 'LOGICO' | 'NUMERO' | 'TEXTO', tamanho?: number | Simbolo, nulo?: boolean, chavePrimaria?: boolean, chaveEstrangeira?: boolean, autoIncremento?: boolean);
11
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Coluna = void 0;
4
+ class Coluna {
5
+ constructor(nomeColuna, tipo, tamanho, nulo, chavePrimaria, chaveEstrangeira, autoIncremento) {
6
+ this.nomeColuna = nomeColuna;
7
+ this.tipo = tipo;
8
+ this.tamanho = tamanho || -1;
9
+ this.nulo = nulo || false;
10
+ this.chavePrimaria = chavePrimaria || false;
11
+ this.chaveEstrangeira = chaveEstrangeira || false;
12
+ this.autoIncremento = autoIncremento || false;
13
+ }
14
+ }
15
+ exports.Coluna = Coluna;
16
+ //# sourceMappingURL=coluna.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coluna.js","sourceRoot":"","sources":["../../../../comum/fontes/construtos/coluna.ts"],"names":[],"mappings":";;;AAEA,MAAa,MAAM;IASf,YACI,UAAkB,EAClB,IAA+C,EAC/C,OAA0B,EAC1B,IAAc,EACd,aAAuB,EACvB,gBAA0B,EAC1B,cAAwB;QAExB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,CAAC,CAAC,CAAC;QAE7B,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,KAAK,CAAC;QAC1B,IAAI,CAAC,aAAa,GAAG,aAAa,IAAI,KAAK,CAAC;QAC5C,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,IAAI,KAAK,CAAC;QAClD,IAAI,CAAC,cAAc,GAAG,cAAc,IAAI,KAAK,CAAC;IAClD,CAAC;CACJ;AA3BD,wBA2BC"}
@@ -0,0 +1,6 @@
1
+ export declare class Condicao {
2
+ esquerda: any;
3
+ direita: any;
4
+ operador: 'IGUAL' | 'MAIOR' | 'MAIOR_IGUAL' | 'MENOR' | 'MENOR_IGUAL';
5
+ constructor(esquerda: any, operador: any, direita: any);
6
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Condicao = void 0;
4
+ class Condicao {
5
+ constructor(esquerda, operador, direita) {
6
+ this.esquerda = esquerda;
7
+ this.direita = direita;
8
+ this.operador = operador;
9
+ }
10
+ }
11
+ exports.Condicao = Condicao;
12
+ //# sourceMappingURL=condicao.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"condicao.js","sourceRoot":"","sources":["../../../../comum/fontes/construtos/condicao.ts"],"names":[],"mappings":";;;AAAA,MAAa,QAAQ;IAKjB,YAAY,QAAa,EAAE,QAAa,EAAE,OAAY;QAClD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;CACJ;AAVD,4BAUC"}
@@ -0,0 +1 @@
1
+ export * from './condicao';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./condicao"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../comum/fontes/construtos/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B"}
@@ -0,0 +1,14 @@
1
+ import { ErroAvaliadorSintatico } from '../avaliador-sintatico';
2
+ import { SimboloInterface } from './simbolo-interface';
3
+ export interface AvaliadorSintaticoInterface {
4
+ simbolos: SimboloInterface[];
5
+ erros: ErroAvaliadorSintatico[];
6
+ atual: number;
7
+ bloco: number;
8
+ consumir(tipo: string, mensagemDeErro: string): SimboloInterface;
9
+ estaNoFinal(): boolean;
10
+ verificarTipoSimboloAtual(tipo: string): boolean;
11
+ avancarEDevolverAnterior(): SimboloInterface;
12
+ erro(simbolo: SimboloInterface, mensagemDeErro: string): ErroAvaliadorSintatico;
13
+ verificarSeSimboloAtualEIgualA(...argumentos: string[]): boolean;
14
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=avaliador-sintatico-interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avaliador-sintatico-interface.js","sourceRoot":"","sources":["../../../../comum/fontes/interfaces/avaliador-sintatico-interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export { ILincones } from './lincones-interface';
2
+ export { AvaliadorSintaticoInterface } from './avaliador-sintatico-interface';
3
+ export * from './simbolo-interface';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./simbolo-interface"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../comum/fontes/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,sDAAoC"}
@@ -0,0 +1,3 @@
1
+ export interface ILincones {
2
+ iniciar(): void;
3
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=lincones-interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lincones-interface.js","sourceRoot":"","sources":["../../../../comum/fontes/interfaces/lincones-interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ import { SimboloInterface } from '..';
2
+ import { ErroAvaliadorSintatico } from '../../avaliador-sintatico';
3
+ import { Comando } from '../../comandos';
4
+ export interface RetornoAvaliadorSintatico {
5
+ comandos: Comando[];
6
+ erros: ErroAvaliadorSintatico[];
7
+ }
8
+ export interface RetornoLexador {
9
+ simbolos: SimboloInterface[];
10
+ erros: ErroLexador[];
11
+ }
12
+ export interface ErroLexador {
13
+ linha: number;
14
+ caractere: string;
15
+ mensagem: string;
16
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../comum/fontes/interfaces/retornos/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export interface SimboloInterface {
2
+ lexema: string;
3
+ tipo: string;
4
+ literal: string;
5
+ linha: number;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=simbolo-interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simbolo-interface.js","sourceRoot":"","sources":["../../../../comum/fontes/interfaces/simbolo-interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ import { SimboloInterface } from '../interfaces';
2
+ import { RetornoLexador } from '../interfaces/retornos';
3
+ export declare class Lexador {
4
+ inicioSimbolo: number;
5
+ atual: number;
6
+ linha: number;
7
+ codigo: string[];
8
+ simbolos: SimboloInterface[];
9
+ erros: any[];
10
+ eDigito(caractere: string): boolean;
11
+ eAlfabeto(caractere: string): boolean;
12
+ eAlfabetoOuDigito(caractere: string): boolean;
13
+ eFinalDoCodigo(): boolean;
14
+ eUltimaLinha(): boolean;
15
+ eFinalDaLinha(): boolean;
16
+ simboloAtual(): string;
17
+ avancar(): void;
18
+ proximoSimbolo(): string;
19
+ simboloAnterior(): string;
20
+ analisarNumero(): void;
21
+ analisarTexto(delimitador?: string): void;
22
+ adicionarSimbolo(tipo: string, literal?: any): void;
23
+ identificarPalavraChave(): void;
24
+ analisarToken(): void;
25
+ mapear(codigo: string[]): RetornoLexador;
26
+ }
@@ -0,0 +1,220 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Lexador = void 0;
7
+ const simbolo_1 = require("./simbolo");
8
+ const palavras_reservadas_1 = __importDefault(require("../palavras-reservadas"));
9
+ const tipos_de_simbolos_1 = __importDefault(require("../tipos-de-simbolos"));
10
+ class Lexador {
11
+ eDigito(caractere) {
12
+ return caractere >= '0' && caractere <= '9';
13
+ }
14
+ eAlfabeto(caractere) {
15
+ const acentuacoes = [
16
+ 'á',
17
+ 'Á',
18
+ 'ã',
19
+ 'Ã',
20
+ 'â',
21
+ 'Â',
22
+ 'à',
23
+ 'À',
24
+ 'é',
25
+ 'É',
26
+ 'ê',
27
+ 'Ê',
28
+ 'í',
29
+ 'Í',
30
+ 'ó',
31
+ 'Ó',
32
+ 'õ',
33
+ 'Õ',
34
+ 'ô',
35
+ 'Ô',
36
+ 'ú',
37
+ 'Ú',
38
+ 'ç',
39
+ 'Ç',
40
+ '_'
41
+ ];
42
+ return ((caractere >= 'a' && caractere <= 'z') ||
43
+ (caractere >= 'A' && caractere <= 'Z') ||
44
+ acentuacoes.includes(caractere));
45
+ }
46
+ eAlfabetoOuDigito(caractere) {
47
+ return this.eDigito(caractere) || this.eAlfabeto(caractere);
48
+ }
49
+ eFinalDoCodigo() {
50
+ return (this.eUltimaLinha() &&
51
+ this.codigo[this.codigo.length - 1].length <= this.atual);
52
+ }
53
+ eUltimaLinha() {
54
+ return this.linha >= this.codigo.length - 1;
55
+ }
56
+ eFinalDaLinha() {
57
+ if (this.codigo.length === this.linha) {
58
+ return true;
59
+ }
60
+ return this.atual >= this.codigo[this.linha].length;
61
+ }
62
+ simboloAtual() {
63
+ if (this.eFinalDaLinha())
64
+ return '\0';
65
+ return this.codigo[this.linha].charAt(this.atual);
66
+ }
67
+ avancar() {
68
+ this.atual += 1;
69
+ if (this.eFinalDaLinha() && !this.eUltimaLinha()) {
70
+ this.linha++;
71
+ this.atual = 0;
72
+ }
73
+ }
74
+ proximoSimbolo() {
75
+ return this.codigo[this.linha].charAt(this.atual + 1);
76
+ }
77
+ simboloAnterior() {
78
+ return this.codigo[this.linha].charAt(this.atual - 1);
79
+ }
80
+ analisarNumero() {
81
+ while (this.eDigito(this.simboloAtual())) {
82
+ this.avancar();
83
+ }
84
+ if (this.simboloAtual() == '.' && this.eDigito(this.proximoSimbolo())) {
85
+ this.avancar();
86
+ while (this.eDigito(this.simboloAtual())) {
87
+ this.avancar();
88
+ }
89
+ }
90
+ const numeroCompleto = this.codigo[this.linha].substring(this.inicioSimbolo, this.atual);
91
+ this.adicionarSimbolo(tipos_de_simbolos_1.default.NUMERO, parseFloat(numeroCompleto));
92
+ }
93
+ analisarTexto(delimitador = '"') {
94
+ while (this.simboloAtual() !== delimitador && !this.eFinalDoCodigo()) {
95
+ this.avancar();
96
+ }
97
+ if (this.eFinalDoCodigo()) {
98
+ this.erros.push({
99
+ linha: this.linha + 1,
100
+ caractere: this.simboloAnterior(),
101
+ mensagem: 'Texto não finalizado.'
102
+ });
103
+ return;
104
+ }
105
+ const valor = this.codigo[this.linha].substring(this.inicioSimbolo + 1, this.atual);
106
+ this.adicionarSimbolo(tipos_de_simbolos_1.default.TEXTO, valor);
107
+ }
108
+ adicionarSimbolo(tipo, literal = null) {
109
+ const texto = this.codigo[this.linha].substring(this.inicioSimbolo, this.atual);
110
+ this.simbolos.push(new simbolo_1.Simbolo(tipo, literal || texto, literal, this.linha + 1));
111
+ }
112
+ identificarPalavraChave() {
113
+ while (this.eAlfabetoOuDigito(this.simboloAtual())) {
114
+ this.avancar();
115
+ }
116
+ const codigo = this.codigo[this.linha].substring(this.inicioSimbolo, this.atual).toLowerCase();
117
+ const tipo = codigo in palavras_reservadas_1.default
118
+ ? palavras_reservadas_1.default[codigo]
119
+ : tipos_de_simbolos_1.default.IDENTIFICADOR;
120
+ this.adicionarSimbolo(tipo);
121
+ }
122
+ analisarToken() {
123
+ const caractere = this.simboloAtual();
124
+ switch (caractere) {
125
+ // Esta sessão ignora espaços em branco na tokenização.
126
+ case ' ':
127
+ case '\0':
128
+ case '\r':
129
+ case '\t':
130
+ this.avancar();
131
+ break;
132
+ case ';':
133
+ this.adicionarSimbolo(tipos_de_simbolos_1.default.PONTO_VIRGULA, ';');
134
+ this.linha++;
135
+ this.avancar();
136
+ break;
137
+ case '"':
138
+ this.avancar();
139
+ this.analisarTexto('"');
140
+ this.avancar();
141
+ break;
142
+ case "'":
143
+ this.avancar();
144
+ this.analisarTexto("'");
145
+ this.avancar();
146
+ break;
147
+ case '(':
148
+ this.adicionarSimbolo(tipos_de_simbolos_1.default.PARENTESE_ESQUERDO, '(');
149
+ this.avancar();
150
+ break;
151
+ case ')':
152
+ this.adicionarSimbolo(tipos_de_simbolos_1.default.PARENTESE_DIREITO, ')');
153
+ this.avancar();
154
+ break;
155
+ case ',':
156
+ this.adicionarSimbolo(tipos_de_simbolos_1.default.VIRGULA, ',');
157
+ this.avancar();
158
+ break;
159
+ case '=':
160
+ this.adicionarSimbolo(tipos_de_simbolos_1.default.IGUAL, '=');
161
+ this.avancar();
162
+ break;
163
+ case '*':
164
+ this.adicionarSimbolo(tipos_de_simbolos_1.default.TUDO, '*');
165
+ this.avancar();
166
+ break;
167
+ case '<':
168
+ this.avancar();
169
+ if (this.simboloAtual() === '=') {
170
+ this.adicionarSimbolo(tipos_de_simbolos_1.default.MENOR_IGUAL);
171
+ this.avancar();
172
+ }
173
+ else {
174
+ this.adicionarSimbolo(tipos_de_simbolos_1.default.MENOR);
175
+ }
176
+ break;
177
+ case '>':
178
+ this.avancar();
179
+ if (this.simboloAtual() === '=') {
180
+ this.adicionarSimbolo(tipos_de_simbolos_1.default.MAIOR_IGUAL);
181
+ this.avancar();
182
+ }
183
+ else {
184
+ this.adicionarSimbolo(tipos_de_simbolos_1.default.MAIOR);
185
+ }
186
+ break;
187
+ default:
188
+ if (this.eDigito(caractere))
189
+ this.analisarNumero();
190
+ else if (this.eAlfabeto(caractere))
191
+ this.identificarPalavraChave();
192
+ else {
193
+ this.erros.push({
194
+ linha: this.linha + 1,
195
+ caractere: caractere,
196
+ mensagem: 'Caractere inesperado.'
197
+ });
198
+ this.avancar();
199
+ }
200
+ }
201
+ }
202
+ mapear(codigo) {
203
+ this.inicioSimbolo = 0;
204
+ this.atual = 0;
205
+ this.linha = 0;
206
+ this.codigo = codigo || [''];
207
+ this.simbolos = [];
208
+ this.erros = [];
209
+ while (!this.eFinalDoCodigo()) {
210
+ this.inicioSimbolo = this.atual;
211
+ this.analisarToken();
212
+ }
213
+ return {
214
+ simbolos: this.simbolos,
215
+ erros: this.erros
216
+ };
217
+ }
218
+ }
219
+ exports.Lexador = Lexador;
220
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../comum/fontes/lexador/index.ts"],"names":[],"mappings":";;;;;;AACA,uCAAoC;AAEpC,iFAAwD;AACxD,6EAAmD;AAGnD,MAAa,OAAO;IAQhB,OAAO,CAAC,SAAiB;QACrB,OAAO,SAAS,IAAI,GAAG,IAAI,SAAS,IAAI,GAAG,CAAC;IAChD,CAAC;IAED,SAAS,CAAC,SAAiB;QACvB,MAAM,WAAW,GAAG;YAChB,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;YACH,GAAG;SACN,CAAC;QAEF,OAAO,CACH,CAAC,SAAS,IAAI,GAAG,IAAI,SAAS,IAAI,GAAG,CAAC;YACtC,CAAC,SAAS,IAAI,GAAG,IAAI,SAAS,IAAI,GAAG,CAAC;YACtC,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,CAClC,CAAC;IACN,CAAC;IAED,iBAAiB,CAAC,SAAiB;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAChE,CAAC;IAED,cAAc;QACV,OAAO,CACH,IAAI,CAAC,YAAY,EAAE;YACnB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,CAC3D,CAAC;IACN,CAAC;IAED,YAAY;QACR,OAAO,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;IAChD,CAAC;IAED,aAAa;QAC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olo implements SimboloInterface {
3
+ lexema: string;
4
+ tipo: string;
5
+ literal: any;
6
+ linha: number;
7
+ constructor(tipo: string, lexema: string, literal: any, linha: number);
8
+ paraTexto(): string;
9
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Simbolo = void 0;
4
+ class Simbolo {
5
+ constructor(tipo, lexema, literal, linha) {
6
+ this.tipo = tipo;
7
+ this.lexema = lexema;
8
+ this.literal = literal;
9
+ this.linha = linha;
10
+ }
11
+ paraTexto() {
12
+ return this.tipo + ' ' + this.lexema + ' ' + this.literal;
13
+ }
14
+ }
15
+ exports.Simbolo = Simbolo;
16
+ //# sourceMappingURL=simbolo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simbolo.js","sourceRoot":"","sources":["../../../../comum/fontes/lexador/simbolo.ts"],"names":[],"mappings":";;;AAEA,MAAa,OAAO;IAMhB,YACI,IAAY,EACZ,MAAc,EACd,OAAY,EACZ,KAAa;QAEb,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,SAAS;QACL,OAAO,IAAI,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC;IAC9D,CAAC;CACJ;AArBD,0BAqBC"}
@@ -0,0 +1,10 @@
1
+ import { AvaliadorSintatico } from "./avaliador-sintatico";
2
+ import { Lexador } from "./lexador";
3
+ import { Tradutor } from "./tradutor";
4
+ export declare class Lincones {
5
+ lexador: Lexador;
6
+ avaliadorSintatico: AvaliadorSintatico;
7
+ tradutor: Tradutor;
8
+ constructor();
9
+ executar(comando: string): string;
10
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Lincones = void 0;
4
+ const avaliador_sintatico_1 = require("./avaliador-sintatico");
5
+ const lexador_1 = require("./lexador");
6
+ const tradutor_1 = require("./tradutor");
7
+ class Lincones {
8
+ constructor() {
9
+ this.lexador = new lexador_1.Lexador();
10
+ this.avaliadorSintatico = new avaliador_sintatico_1.AvaliadorSintatico();
11
+ this.tradutor = new tradutor_1.Tradutor();
12
+ }
13
+ executar(comando) {
14
+ const resultadoLexador = this.lexador.mapear([comando]);
15
+ const resultadoAvaliacaoSintatica = this.avaliadorSintatico.analisar(resultadoLexador);
16
+ const resultadoTraducao = this.tradutor.traduzir(resultadoAvaliacaoSintatica.comandos);
17
+ return resultadoTraducao;
18
+ }
19
+ }
20
+ exports.Lincones = Lincones;
21
+ //# sourceMappingURL=lincones.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lincones.js","sourceRoot":"","sources":["../../../comum/fontes/lincones.ts"],"names":[],"mappings":";;;AAAA,+DAA2D;AAC3D,uCAAoC;AACpC,yCAAsC;AAEtC,MAAa,QAAQ;IAKjB;QACI,IAAI,CAAC,OAAO,GAAG,IAAI,iBAAO,EAAE,CAAC;QAC7B,IAAI,CAAC,kBAAkB,GAAG,IAAI,wCAAkB,EAAE,CAAC;QACnD,IAAI,CAAC,QAAQ,GAAG,IAAI,mBAAQ,EAAE,CAAC;IACnC,CAAC;IAED,QAAQ,CAAC,OAAe;QACpB,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QACxD,MAAM,2BAA2B,GAAG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;QACvF,MAAM,iBAAiB,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC;QACvF,OAAO,iBAAiB,CAAC;IAC7B,CAAC;CACJ;AAjBD,4BAiBC"}
@@ -0,0 +1,26 @@
1
+ declare const _default: {
2
+ atualizar: string;
3
+ auto: string;
4
+ chave: string;
5
+ criar: string;
6
+ de: string;
7
+ definir: string;
8
+ e: string;
9
+ em: string;
10
+ excluir: string;
11
+ falso: string;
12
+ incremento: string;
13
+ inserir: string;
14
+ inteiro: string;
15
+ logico: string;
16
+ nao: string;
17
+ nulo: string;
18
+ onde: string;
19
+ primaria: string;
20
+ selecionar: string;
21
+ tabela: string;
22
+ texto: string;
23
+ valores: string;
24
+ verdadeiro: string;
25
+ };
26
+ export default _default;