@designliquido/lincones-sqlite 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/execucao.d.ts +1 -1
- package/execucao.js +52 -52
- package/execucao.js.map +1 -1
- package/fontes/avaliador-sintatico/avaliador-sintatico.d.ts +6 -15
- package/fontes/avaliador-sintatico/avaliador-sintatico.js +42 -261
- package/fontes/avaliador-sintatico/avaliador-sintatico.js.map +1 -1
- package/fontes/avaliador-sintatico/index.d.ts +1 -2
- package/fontes/avaliador-sintatico/index.js +5 -20
- package/fontes/avaliador-sintatico/index.js.map +1 -1
- package/fontes/comum/fontes/avaliador-sintatico/avaliador-sintatico-base.d.ts +36 -0
- package/{comum/fontes/avaliador-sintatico/avaliador-sintatico.js → fontes/comum/fontes/avaliador-sintatico/avaliador-sintatico-base.js} +444 -263
- package/fontes/comum/fontes/avaliador-sintatico/avaliador-sintatico-base.js.map +1 -0
- package/fontes/comum/fontes/avaliador-sintatico/avaliador-sintatico.d.ts +7 -0
- package/fontes/comum/fontes/avaliador-sintatico/avaliador-sintatico.js +12 -0
- package/fontes/comum/fontes/avaliador-sintatico/avaliador-sintatico.js.map +1 -0
- package/{comum → fontes/comum}/fontes/avaliador-sintatico/erro-avaliador-sintatico.d.ts +5 -5
- package/{comum → fontes/comum}/fontes/avaliador-sintatico/erro-avaliador-sintatico.js +11 -11
- package/fontes/comum/fontes/avaliador-sintatico/erro-avaliador-sintatico.js.map +1 -0
- package/fontes/comum/fontes/avaliador-sintatico/index.d.ts +3 -0
- package/{comum → fontes/comum}/fontes/avaliador-sintatico/index.js +19 -22
- package/fontes/comum/fontes/avaliador-sintatico/index.js.map +1 -0
- package/fontes/comum/fontes/comandos/alterar.d.ts +8 -0
- package/fontes/comum/fontes/comandos/alterar.js +14 -0
- package/fontes/comum/fontes/comandos/alterar.js.map +1 -0
- package/{comum → fontes/comum}/fontes/comandos/atualizar.d.ts +14 -14
- package/{comum → fontes/comum}/fontes/comandos/atualizar.js +13 -13
- package/fontes/comum/fontes/comandos/atualizar.js.map +1 -0
- package/{comum → fontes/comum}/fontes/comandos/comando.d.ts +6 -6
- package/{comum → fontes/comum}/fontes/comandos/comando.js +13 -13
- package/fontes/comum/fontes/comandos/comando.js.map +1 -0
- package/fontes/comum/fontes/comandos/criar.d.ts +8 -0
- package/{comum → fontes/comum}/fontes/comandos/criar.js +12 -12
- package/fontes/comum/fontes/comandos/criar.js.map +1 -0
- package/fontes/comum/fontes/comandos/excluir-entidade.d.ts +6 -0
- package/fontes/comum/fontes/comandos/excluir-entidade.js +13 -0
- package/fontes/comum/fontes/comandos/excluir-entidade.js.map +1 -0
- package/{comum → fontes/comum}/fontes/comandos/excluir.d.ts +6 -6
- package/{comum → fontes/comum}/fontes/comandos/excluir.js +12 -12
- package/fontes/comum/fontes/comandos/excluir.js.map +1 -0
- package/{comum → fontes/comum}/fontes/comandos/index.d.ts +8 -6
- package/{comum → fontes/comum}/fontes/comandos/index.js +24 -22
- package/fontes/comum/fontes/comandos/index.js.map +1 -0
- package/{comum → fontes/comum}/fontes/comandos/inserir.d.ts +8 -8
- package/{comum → fontes/comum}/fontes/comandos/inserir.js +13 -13
- package/fontes/comum/fontes/comandos/inserir.js.map +1 -0
- package/{comum → fontes/comum}/fontes/comandos/selecionar.d.ts +9 -9
- package/{comum → fontes/comum}/fontes/comandos/selecionar.js +14 -14
- package/fontes/comum/fontes/comandos/selecionar.js.map +1 -0
- package/{comum → fontes/comum}/fontes/construtos/coluna.d.ts +11 -11
- package/{comum → fontes/comum}/fontes/construtos/coluna.js +19 -15
- package/fontes/comum/fontes/construtos/coluna.js.map +1 -0
- package/{comum → fontes/comum}/fontes/construtos/condicao.d.ts +6 -6
- package/{comum → fontes/comum}/fontes/construtos/condicao.js +11 -11
- package/fontes/comum/fontes/construtos/condicao.js.map +1 -0
- package/{comum → fontes/comum}/fontes/construtos/index.d.ts +2 -1
- package/{comum → fontes/comum}/fontes/construtos/index.js +18 -17
- package/fontes/comum/fontes/construtos/index.js.map +1 -0
- package/fontes/comum/fontes/construtos/operacao-alteracao-tabela.d.ts +7 -0
- package/fontes/comum/fontes/construtos/operacao-alteracao-tabela.js +15 -0
- package/fontes/comum/fontes/construtos/operacao-alteracao-tabela.js.map +1 -0
- package/fontes/comum/fontes/construtos/restricao.d.ts +13 -0
- package/fontes/comum/fontes/construtos/restricao.js +19 -0
- package/fontes/comum/fontes/construtos/restricao.js.map +1 -0
- package/{comum → fontes/comum}/fontes/interfaces/avaliador-sintatico-interface.d.ts +14 -14
- package/{comum → fontes/comum}/fontes/interfaces/avaliador-sintatico-interface.js +2 -2
- package/fontes/comum/fontes/interfaces/avaliador-sintatico-interface.js.map +1 -0
- package/fontes/comum/fontes/interfaces/index.d.ts +3 -0
- package/fontes/comum/fontes/interfaces/index.js +20 -0
- package/fontes/comum/fontes/interfaces/index.js.map +1 -0
- package/fontes/comum/fontes/interfaces/lincones-interface.d.ts +3 -0
- package/{comum → fontes/comum}/fontes/interfaces/lincones-interface.js +2 -2
- package/fontes/comum/fontes/interfaces/lincones-interface.js.map +1 -0
- package/{comum → fontes/comum}/fontes/interfaces/retornos/index.d.ts +16 -16
- package/{comum → fontes/comum}/fontes/interfaces/retornos/index.js +2 -2
- package/fontes/comum/fontes/interfaces/retornos/index.js.map +1 -0
- package/{comum → fontes/comum}/fontes/interfaces/simbolo-interface.d.ts +6 -6
- package/{comum → fontes/comum}/fontes/interfaces/simbolo-interface.js +2 -2
- package/fontes/comum/fontes/interfaces/simbolo-interface.js.map +1 -0
- package/fontes/comum/fontes/lexador/index.d.ts +1 -0
- package/{comum/fontes/interfaces → fontes/comum/fontes/lexador}/index.js +17 -17
- package/fontes/comum/fontes/lexador/index.js.map +1 -0
- package/{comum/fontes/lexador/index.d.ts → fontes/comum/fontes/lexador/lexador.d.ts} +26 -26
- package/{comum/fontes/lexador/index.js → fontes/comum/fontes/lexador/lexador.js} +220 -220
- package/fontes/comum/fontes/lexador/lexador.js.map +1 -0
- package/{comum → fontes/comum}/fontes/lexador/simbolo.d.ts +9 -9
- package/{comum → fontes/comum}/fontes/lexador/simbolo.js +15 -15
- package/fontes/comum/fontes/lexador/simbolo.js.map +1 -0
- package/fontes/comum/fontes/palavras-reservadas.d.ts +51 -0
- package/{comum → fontes/comum}/fontes/palavras-reservadas.js +56 -31
- package/fontes/comum/fontes/palavras-reservadas.js.map +1 -0
- package/{comum → fontes/comum}/fontes/tipos-de-simbolos.d.ts +57 -38
- package/{comum → fontes/comum}/fontes/tipos-de-simbolos.js +58 -39
- package/fontes/comum/fontes/tipos-de-simbolos.js.map +1 -0
- package/fontes/comum/fontes/tradutor/index.d.ts +32 -0
- package/{comum → fontes/comum}/fontes/tradutor/index.js +238 -160
- package/fontes/comum/fontes/tradutor/index.js.map +1 -0
- package/fontes/comum/index.d.ts +8 -0
- package/fontes/comum/index.js +25 -0
- package/fontes/comum/index.js.map +1 -0
- package/{comum → fontes/comum}/jest.config.d.ts +3 -3
- package/{comum → fontes/comum}/jest.config.js +11 -11
- package/fontes/comum/jest.config.js.map +1 -0
- package/{comum/execucao.d.ts → fontes/comum/testes/avaliador-sintatico.test.d.ts} +1 -1
- package/fontes/comum/testes/avaliador-sintatico.test.js +86 -0
- package/fontes/comum/testes/avaliador-sintatico.test.js.map +1 -0
- package/fontes/comum/testes/lexador.test.d.ts +1 -0
- package/fontes/comum/testes/lexador.test.js +83 -0
- package/fontes/comum/testes/lexador.test.js.map +1 -0
- package/fontes/comum/testes/tradutor.test.d.ts +1 -0
- package/fontes/comum/testes/tradutor.test.js +133 -0
- package/fontes/comum/testes/tradutor.test.js.map +1 -0
- package/fontes/infraestrutura/cliente-sqlite.d.ts +10 -10
- package/fontes/infraestrutura/cliente-sqlite.js +71 -71
- package/fontes/infraestrutura/cliente-sqlite.js.map +1 -1
- package/fontes/infraestrutura/index.d.ts +2 -2
- package/fontes/infraestrutura/index.js +18 -18
- package/fontes/infraestrutura/retorno-comando.d.ts +8 -8
- package/fontes/infraestrutura/retorno-comando.js +28 -28
- package/fontes/infraestrutura/retorno-comando.js.map +1 -1
- package/fontes/lincones-sqlite.d.ts +13 -13
- package/fontes/lincones-sqlite.js +28 -28
- package/fontes/lincones-sqlite.js.map +1 -1
- package/fontes/palavras-reservadas.d.ts +26 -26
- package/fontes/palavras-reservadas.js +31 -31
- package/fontes/palavras-reservadas.js.map +1 -1
- package/fontes/tradutor/index.d.ts +21 -19
- package/fontes/tradutor/index.js +152 -149
- package/fontes/tradutor/index.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +17 -17
- package/package.json +17 -16
- package/comum/execucao.js +0 -40
- package/comum/execucao.js.map +0 -1
- package/comum/fontes/avaliador-sintatico/avaliador-sintatico-base.d.ts +0 -15
- package/comum/fontes/avaliador-sintatico/avaliador-sintatico-base.js +0 -46
- package/comum/fontes/avaliador-sintatico/avaliador-sintatico-base.js.map +0 -1
- package/comum/fontes/avaliador-sintatico/avaliador-sintatico.d.ts +0 -15
- package/comum/fontes/avaliador-sintatico/avaliador-sintatico.js.map +0 -1
- package/comum/fontes/avaliador-sintatico/erro-avaliador-sintatico.js.map +0 -1
- package/comum/fontes/avaliador-sintatico/index.d.ts +0 -3
- package/comum/fontes/avaliador-sintatico/index.js.map +0 -1
- package/comum/fontes/comandos/atualizar.js.map +0 -1
- package/comum/fontes/comandos/comando.js.map +0 -1
- package/comum/fontes/comandos/criar.d.ts +0 -7
- package/comum/fontes/comandos/criar.js.map +0 -1
- package/comum/fontes/comandos/excluir.js.map +0 -1
- package/comum/fontes/comandos/index.js.map +0 -1
- package/comum/fontes/comandos/inserir.js.map +0 -1
- package/comum/fontes/comandos/selecionar.js.map +0 -1
- package/comum/fontes/construtos/coluna.js.map +0 -1
- package/comum/fontes/construtos/condicao.js.map +0 -1
- package/comum/fontes/construtos/index.js.map +0 -1
- package/comum/fontes/interfaces/avaliador-sintatico-interface.js.map +0 -1
- package/comum/fontes/interfaces/index.d.ts +0 -3
- package/comum/fontes/interfaces/index.js.map +0 -1
- package/comum/fontes/interfaces/lincones-interface.d.ts +0 -3
- package/comum/fontes/interfaces/lincones-interface.js.map +0 -1
- package/comum/fontes/interfaces/retornos/index.js.map +0 -1
- package/comum/fontes/interfaces/simbolo-interface.js.map +0 -1
- package/comum/fontes/lexador/index.js.map +0 -1
- package/comum/fontes/lexador/simbolo.js.map +0 -1
- package/comum/fontes/lincones.d.ts +0 -10
- package/comum/fontes/lincones.js +0 -21
- package/comum/fontes/lincones.js.map +0 -1
- package/comum/fontes/palavras-reservadas.d.ts +0 -26
- package/comum/fontes/palavras-reservadas.js.map +0 -1
- package/comum/fontes/tipos-de-simbolos.js.map +0 -1
- package/comum/fontes/tradutor/index.d.ts +0 -18
- package/comum/fontes/tradutor/index.js.map +0 -1
- package/comum/index.d.ts +0 -1
- package/comum/index.js +0 -6
- package/comum/index.js.map +0 -1
- package/comum/jest.config.js.map +0 -1
- package/fontes/lexador/index.d.ts +0 -26
- package/fontes/lexador/index.js +0 -220
- package/fontes/lexador/index.js.map +0 -1
|
@@ -1,38 +1,57 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
declare const _default: {
|
|
2
|
+
ADICIONAR: string;
|
|
3
|
+
AGRUPAR: string;
|
|
4
|
+
ALTERAR: string;
|
|
5
|
+
ATUALIZAR: string;
|
|
6
|
+
AUTO: string;
|
|
7
|
+
COLUNA: string;
|
|
8
|
+
CHAVE: string;
|
|
9
|
+
CRIAR: string;
|
|
10
|
+
DE: string;
|
|
11
|
+
DEFINIR: string;
|
|
12
|
+
DISTINTO: string;
|
|
13
|
+
E: string;
|
|
14
|
+
ENTRE: string;
|
|
15
|
+
EM: string;
|
|
16
|
+
ESTRANGEIRA: string;
|
|
17
|
+
EXCLUIR: string;
|
|
18
|
+
FALSO: string;
|
|
19
|
+
IDENTIDADE: string;
|
|
20
|
+
IDENTIFICADOR: string;
|
|
21
|
+
IGUAL: string;
|
|
22
|
+
INCREMENTO: string;
|
|
23
|
+
INSERIR: string;
|
|
24
|
+
INTEIRO: string;
|
|
25
|
+
LOGICO: string;
|
|
26
|
+
MAIOR: string;
|
|
27
|
+
MAIOR_IGUAL: string;
|
|
28
|
+
MEDIA: string;
|
|
29
|
+
MENOR: string;
|
|
30
|
+
MENOR_IGUAL: string;
|
|
31
|
+
NAO: string;
|
|
32
|
+
NULO: string;
|
|
33
|
+
NUMERO: string;
|
|
34
|
+
ONDE: string;
|
|
35
|
+
ORDENAR: string;
|
|
36
|
+
PARA: string;
|
|
37
|
+
PARENTESE_DIREITO: string;
|
|
38
|
+
PARENTESE_ESQUERDO: string;
|
|
39
|
+
PONTO_VIRGULA: string;
|
|
40
|
+
POR: string;
|
|
41
|
+
PRIMARIA: string;
|
|
42
|
+
REFERENCIA: string;
|
|
43
|
+
RENOMEAR: string;
|
|
44
|
+
REMOVER: string;
|
|
45
|
+
RESTRICAO: string;
|
|
46
|
+
SE: string;
|
|
47
|
+
SELECIONAR: string;
|
|
48
|
+
TABELA: string;
|
|
49
|
+
TEXTO: string;
|
|
50
|
+
TUDO: string;
|
|
51
|
+
UNICA: string;
|
|
52
|
+
VALORES: string;
|
|
53
|
+
VERDADEIRO: string;
|
|
54
|
+
VIRGULA: string;
|
|
55
|
+
VISAO: string;
|
|
56
|
+
};
|
|
57
|
+
export default _default;
|
|
@@ -1,40 +1,59 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
ADICIONAR: 'ADICIONAR',
|
|
5
|
+
AGRUPAR: 'AGRUPAR',
|
|
6
|
+
ALTERAR: 'ALTERAR',
|
|
7
|
+
ATUALIZAR: 'ATUALIZAR',
|
|
8
|
+
AUTO: 'AUTO',
|
|
9
|
+
COLUNA: 'COLUNA',
|
|
10
|
+
CHAVE: 'CHAVE',
|
|
11
|
+
CRIAR: 'CRIAR',
|
|
12
|
+
DE: 'DE',
|
|
13
|
+
DEFINIR: 'DEFINIR',
|
|
14
|
+
DISTINTO: 'DISTINTO',
|
|
15
|
+
E: 'E',
|
|
16
|
+
ENTRE: 'ENTRE',
|
|
17
|
+
EM: 'EM',
|
|
18
|
+
ESTRANGEIRA: 'ESTRANGEIRA',
|
|
19
|
+
EXCLUIR: 'EXCLUIR',
|
|
20
|
+
FALSO: 'FALSO',
|
|
21
|
+
IDENTIDADE: 'IDENTIDADE',
|
|
22
|
+
IDENTIFICADOR: 'IDENTIFICADOR',
|
|
23
|
+
IGUAL: 'IGUAL',
|
|
24
|
+
INCREMENTO: 'INCREMENTO',
|
|
25
|
+
INSERIR: 'INSERIR',
|
|
26
|
+
INTEIRO: 'INTEIRO',
|
|
27
|
+
LOGICO: 'LOGICO',
|
|
28
|
+
MAIOR: 'MAIOR',
|
|
29
|
+
MAIOR_IGUAL: 'MAIOR_IGUAL',
|
|
30
|
+
MEDIA: 'MEDIA',
|
|
31
|
+
MENOR: 'MENOR',
|
|
32
|
+
MENOR_IGUAL: 'MENOR_IGUAL',
|
|
33
|
+
NAO: 'NAO',
|
|
34
|
+
NULO: 'NULO',
|
|
35
|
+
NUMERO: 'NUMERO',
|
|
36
|
+
ONDE: 'ONDE',
|
|
37
|
+
ORDENAR: 'ORDENAR',
|
|
38
|
+
PARA: 'PARA',
|
|
39
|
+
PARENTESE_DIREITO: 'PARENTESE_DIREITO',
|
|
40
|
+
PARENTESE_ESQUERDO: 'PARENTESE_ESQUERDO',
|
|
41
|
+
PONTO_VIRGULA: 'PONTO_VIRGULA',
|
|
42
|
+
POR: 'POR',
|
|
43
|
+
PRIMARIA: 'PRIMARIA',
|
|
44
|
+
REFERENCIA: 'REFERENCIA',
|
|
45
|
+
RENOMEAR: 'RENOMEAR',
|
|
46
|
+
REMOVER: 'REMOVER',
|
|
47
|
+
RESTRICAO: 'RESTRICAO',
|
|
48
|
+
SE: 'SE',
|
|
49
|
+
SELECIONAR: 'SELECIONAR',
|
|
50
|
+
TABELA: 'TABELA',
|
|
51
|
+
TEXTO: 'TEXTO',
|
|
52
|
+
TUDO: 'TUDO',
|
|
53
|
+
UNICA: 'UNICA',
|
|
54
|
+
VALORES: 'VALORES',
|
|
55
|
+
VERDADEIRO: 'VERDADEIRO',
|
|
56
|
+
VIRGULA: 'VIRGULA',
|
|
57
|
+
VISAO: 'VISAO'
|
|
58
|
+
};
|
|
40
59
|
//# sourceMappingURL=tipos-de-simbolos.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tipos-de-simbolos.js","sourceRoot":"","sources":["../../../../fontes/comum/fontes/tipos-de-simbolos.ts"],"names":[],"mappings":";;AAAA,kBAAe;IACX,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,EAAE,EAAE,IAAI;IACR,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;IACpB,CAAC,EAAE,GAAG;IACN,KAAK,EAAE,OAAO;IACd,EAAE,EAAE,IAAI;IACR,WAAW,EAAE,aAAa;IAC1B,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,UAAU,EAAE,YAAY;IACxB,aAAa,EAAE,eAAe;IAC9B,KAAK,EAAE,OAAO;IACd,UAAU,EAAE,YAAY;IACxB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,aAAa;IAC1B,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,aAAa;IAC1B,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,iBAAiB,EAAE,mBAAmB;IACtC,kBAAkB,EAAE,oBAAoB;IACxC,aAAa,EAAE,eAAe;IAC9B,GAAG,EAAE,KAAK;IACV,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,YAAY;IACxB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,EAAE,EAAE,IAAI;IACR,UAAU,EAAE,YAAY;IACxB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,YAAY;IACxB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;CACjB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Alterar, Atualizar, Comando, Criar, Excluir, Inserir, Selecionar } from '../comandos';
|
|
2
|
+
import { Coluna } from '../construtos';
|
|
3
|
+
/**
|
|
4
|
+
* Este tradutor traduz sentenças em SQL ANSI, e a ideia é poder
|
|
5
|
+
* utilizar para outros tradutores futuros, com pequenas nuances em
|
|
6
|
+
* alguns comandos quando for o caso.
|
|
7
|
+
*/
|
|
8
|
+
export declare class TradutorSqlAnsi {
|
|
9
|
+
tamanhoIndentacao: number;
|
|
10
|
+
constructor(tamanhoIndentacao?: number);
|
|
11
|
+
protected traduzirOperador(operador: string): boolean | "=";
|
|
12
|
+
protected traduzirTipoDeDados(tipo: string): "INTEGER" | "BOOLEAN" | "INT" | "VARCHAR";
|
|
13
|
+
protected traduzirTipoDeRestricao(tipo: string): "PRIMARY KEY" | "FOREIGN KEY" | "UNIQUE";
|
|
14
|
+
protected traduzirColunaComTipo(coluna: Coluna): string;
|
|
15
|
+
protected traduzirComandoAtualizar(comandoAtualizar: Atualizar): string;
|
|
16
|
+
protected traduzirComandoCriar(comandoCriar: Criar): string;
|
|
17
|
+
protected traduzirComandoExcluir(comandoExcluir: Excluir): string;
|
|
18
|
+
protected traduzirComandoInserir(comandoInserir: Inserir): string;
|
|
19
|
+
protected traduzirComandoSelecionar(comandoSelecionar: Selecionar): string;
|
|
20
|
+
private logicaManipulacaoColunas;
|
|
21
|
+
private traduzirTipoEntidade;
|
|
22
|
+
protected traduzirComandoAlterar(comandoAlterar: Alterar): string;
|
|
23
|
+
dicionarioComandos: {
|
|
24
|
+
Alterar: any;
|
|
25
|
+
Atualizar: any;
|
|
26
|
+
Criar: any;
|
|
27
|
+
Excluir: any;
|
|
28
|
+
Inserir: any;
|
|
29
|
+
Selecionar: any;
|
|
30
|
+
};
|
|
31
|
+
traduzir(comandos: Comando[]): string;
|
|
32
|
+
}
|
|
@@ -1,161 +1,239 @@
|
|
|
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.
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
resultado += `
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
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.TradutorSqlAnsi = void 0;
|
|
7
|
+
const construtos_1 = require("../construtos");
|
|
8
|
+
const restricao_1 = require("../construtos/restricao");
|
|
9
|
+
const tipos_de_simbolos_1 = __importDefault(require("../tipos-de-simbolos"));
|
|
10
|
+
/**
|
|
11
|
+
* Este tradutor traduz sentenças em SQL ANSI, e a ideia é poder
|
|
12
|
+
* utilizar para outros tradutores futuros, com pequenas nuances em
|
|
13
|
+
* alguns comandos quando for o caso.
|
|
14
|
+
*/
|
|
15
|
+
class TradutorSqlAnsi {
|
|
16
|
+
constructor(tamanhoIndentacao = 4) {
|
|
17
|
+
this.dicionarioComandos = {
|
|
18
|
+
Alterar: this.traduzirComandoAlterar.bind(this),
|
|
19
|
+
Atualizar: this.traduzirComandoAtualizar.bind(this),
|
|
20
|
+
Criar: this.traduzirComandoCriar.bind(this),
|
|
21
|
+
Excluir: this.traduzirComandoExcluir.bind(this),
|
|
22
|
+
Inserir: this.traduzirComandoInserir.bind(this),
|
|
23
|
+
Selecionar: this.traduzirComandoSelecionar.bind(this)
|
|
24
|
+
};
|
|
25
|
+
this.tamanhoIndentacao = tamanhoIndentacao;
|
|
26
|
+
}
|
|
27
|
+
traduzirOperador(operador) {
|
|
28
|
+
switch (operador) {
|
|
29
|
+
case tipos_de_simbolos_1.default.IGUAL:
|
|
30
|
+
return '=';
|
|
31
|
+
case tipos_de_simbolos_1.default.VERDADEIRO:
|
|
32
|
+
return true;
|
|
33
|
+
case tipos_de_simbolos_1.default.FALSO:
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
traduzirTipoDeDados(tipo) {
|
|
38
|
+
switch (tipo) {
|
|
39
|
+
case 'INTEIRO':
|
|
40
|
+
return 'INTEGER';
|
|
41
|
+
case 'LOGICO':
|
|
42
|
+
return 'BOOLEAN';
|
|
43
|
+
case 'NUMERO':
|
|
44
|
+
return 'INT';
|
|
45
|
+
case 'TEXTO':
|
|
46
|
+
return 'VARCHAR';
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
traduzirTipoDeRestricao(tipo) {
|
|
50
|
+
switch (tipo) {
|
|
51
|
+
case 'CHAVE_PRIMARIA':
|
|
52
|
+
return 'PRIMARY KEY';
|
|
53
|
+
case 'CHAVE_ESTRANGEIRA':
|
|
54
|
+
return 'FOREIGN KEY';
|
|
55
|
+
case 'ÚNICA':
|
|
56
|
+
return 'UNIQUE';
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
traduzirColunaComTipo(coluna) {
|
|
60
|
+
let resultado = `${' '.repeat(this.tamanhoIndentacao)}${coluna.nomeColuna} ${this.traduzirTipoDeDados(coluna.tipo)}`;
|
|
61
|
+
if (coluna.tamanho) {
|
|
62
|
+
resultado += `(${coluna.tamanho.lexema}) `;
|
|
63
|
+
}
|
|
64
|
+
if (coluna.nulo) {
|
|
65
|
+
resultado += `NULL `;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
resultado += `NOT NULL `;
|
|
69
|
+
}
|
|
70
|
+
return resultado;
|
|
71
|
+
}
|
|
72
|
+
traduzirComandoAtualizar(comandoAtualizar) {
|
|
73
|
+
let resultado = 'UPDATE ';
|
|
74
|
+
resultado += `${comandoAtualizar.tabela}\nSET `;
|
|
75
|
+
for (const valorAtualizacao of comandoAtualizar.colunasEValores) {
|
|
76
|
+
if (valorAtualizacao.direita.tipo === tipos_de_simbolos_1.default.TEXTO) {
|
|
77
|
+
resultado += `${valorAtualizacao.esquerda.lexema} = '${valorAtualizacao.direita.lexema}', `;
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
if ([tipos_de_simbolos_1.default.VERDADEIRO, tipos_de_simbolos_1.default.FALSO].includes(valorAtualizacao.direita.tipo)) {
|
|
81
|
+
resultado += `${valorAtualizacao.esquerda.lexema} = ${this.traduzirOperador(valorAtualizacao.direita.tipo)}, `;
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
resultado += `${valorAtualizacao.esquerda.lexema} = ${valorAtualizacao.direita.lexema}, `;
|
|
85
|
+
}
|
|
86
|
+
resultado = resultado.slice(0, -2);
|
|
87
|
+
resultado += `\nWHERE `;
|
|
88
|
+
if (comandoAtualizar.condicoes.length > 0) {
|
|
89
|
+
for (const condicao of comandoAtualizar.condicoes) {
|
|
90
|
+
resultado += `${condicao.esquerda.lexema} ${this.traduzirOperador(condicao.operador)} ${condicao.direita} AND `;
|
|
91
|
+
}
|
|
92
|
+
resultado = resultado.slice(0, -5);
|
|
93
|
+
}
|
|
94
|
+
return resultado;
|
|
95
|
+
}
|
|
96
|
+
traduzirComandoCriar(comandoCriar) {
|
|
97
|
+
let resultado = 'CREATE TABLE ';
|
|
98
|
+
resultado += `${comandoCriar.nomeEntidade} (\n`;
|
|
99
|
+
for (const coluna of comandoCriar.colunas) {
|
|
100
|
+
resultado += this.traduzirColunaComTipo(coluna);
|
|
101
|
+
if (coluna.chavePrimaria) {
|
|
102
|
+
resultado += 'PRIMARY KEY ';
|
|
103
|
+
if (coluna.autoIncremento) {
|
|
104
|
+
resultado += 'AUTOINCREMENT ';
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
resultado = resultado.slice(0, -1);
|
|
108
|
+
resultado += ',\n';
|
|
109
|
+
}
|
|
110
|
+
resultado = resultado.slice(0, -2);
|
|
111
|
+
resultado += `\n)`;
|
|
112
|
+
return resultado;
|
|
113
|
+
}
|
|
114
|
+
traduzirComandoExcluir(comandoExcluir) {
|
|
115
|
+
let resultado = 'DELETE FROM ';
|
|
116
|
+
resultado += `${comandoExcluir.tabela}`;
|
|
117
|
+
// Condições
|
|
118
|
+
if (comandoExcluir.condicoes.length > 0) {
|
|
119
|
+
resultado += '\nWHERE ';
|
|
120
|
+
for (const condicao of comandoExcluir.condicoes) {
|
|
121
|
+
resultado += `${condicao.esquerda.lexema} ${this.traduzirOperador(condicao.operador)} ${condicao.direita} AND `;
|
|
122
|
+
}
|
|
123
|
+
resultado = resultado.slice(0, -5);
|
|
124
|
+
}
|
|
125
|
+
return resultado;
|
|
126
|
+
}
|
|
127
|
+
traduzirComandoInserir(comandoInserir) {
|
|
128
|
+
let resultado = 'INSERT INTO ';
|
|
129
|
+
resultado += `${comandoInserir.tabela} (`;
|
|
130
|
+
for (const coluna of comandoInserir.colunas) {
|
|
131
|
+
resultado += `${coluna}, `;
|
|
132
|
+
}
|
|
133
|
+
resultado = resultado.slice(0, -2);
|
|
134
|
+
resultado += `)\nVALUES (`;
|
|
135
|
+
for (const valor of comandoInserir.valores) {
|
|
136
|
+
switch (valor.tipo) {
|
|
137
|
+
case tipos_de_simbolos_1.default.FALSO:
|
|
138
|
+
resultado += 'FALSE, ';
|
|
139
|
+
break;
|
|
140
|
+
case tipos_de_simbolos_1.default.TEXTO:
|
|
141
|
+
resultado += `'${valor.literal}', `;
|
|
142
|
+
break;
|
|
143
|
+
case tipos_de_simbolos_1.default.VERDADEIRO:
|
|
144
|
+
resultado += 'TRUE, ';
|
|
145
|
+
break;
|
|
146
|
+
default:
|
|
147
|
+
resultado += `${valor.literal}, `;
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
resultado = resultado.slice(0, -2);
|
|
152
|
+
resultado += `)`;
|
|
153
|
+
return resultado;
|
|
154
|
+
}
|
|
155
|
+
traduzirComandoSelecionar(comandoSelecionar) {
|
|
156
|
+
let resultado = 'SELECT ';
|
|
157
|
+
// Colunas
|
|
158
|
+
if (comandoSelecionar.tudo) {
|
|
159
|
+
resultado += '*';
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
for (const coluna of comandoSelecionar.colunas) {
|
|
163
|
+
resultado += coluna + ', ';
|
|
164
|
+
}
|
|
165
|
+
resultado = resultado.slice(0, -2);
|
|
166
|
+
}
|
|
167
|
+
resultado += `\nFROM ${comandoSelecionar.tabela}`;
|
|
168
|
+
// Condições
|
|
169
|
+
if (comandoSelecionar.condicoes.length > 0) {
|
|
170
|
+
resultado += '\nWHERE ';
|
|
171
|
+
for (const condicao of comandoSelecionar.condicoes) {
|
|
172
|
+
resultado += `${condicao.esquerda.lexema} ${this.traduzirOperador(condicao.operador)} ${condicao.direita} AND `;
|
|
173
|
+
}
|
|
174
|
+
resultado = resultado.slice(0, -5);
|
|
175
|
+
}
|
|
176
|
+
return resultado;
|
|
177
|
+
}
|
|
178
|
+
logicaManipulacaoColunas(elemento) {
|
|
179
|
+
if (elemento instanceof construtos_1.Coluna) {
|
|
180
|
+
let formatacaoColuna = `COLUMN ${elemento.nomeColuna} ${this.traduzirTipoDeDados(elemento.tipo)}`;
|
|
181
|
+
if (elemento.tipo === 'TEXTO') {
|
|
182
|
+
formatacaoColuna += `(${elemento.tamanho.lexema})`;
|
|
183
|
+
}
|
|
184
|
+
formatacaoColuna += ` `;
|
|
185
|
+
return formatacaoColuna;
|
|
186
|
+
}
|
|
187
|
+
if (elemento instanceof restricao_1.Restricao) {
|
|
188
|
+
let formatacaoRestricao = `CONSTRAINT ${elemento.nome} ${this.traduzirTipoDeRestricao(elemento.tipo)} (`;
|
|
189
|
+
for (const coluna of elemento.colunas) {
|
|
190
|
+
formatacaoRestricao += coluna + ', ';
|
|
191
|
+
}
|
|
192
|
+
formatacaoRestricao = formatacaoRestricao.slice(0, -2);
|
|
193
|
+
formatacaoRestricao += `) REFERENCES ${elemento.tabelaReferenciada} (`;
|
|
194
|
+
for (const colunaReferenciada of elemento.colunasReferenciadas) {
|
|
195
|
+
formatacaoRestricao += colunaReferenciada + ', ';
|
|
196
|
+
}
|
|
197
|
+
formatacaoRestricao = formatacaoRestricao.slice(0, -2);
|
|
198
|
+
formatacaoRestricao += `) `;
|
|
199
|
+
return formatacaoRestricao;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
traduzirTipoEntidade(tipoEntidade) {
|
|
203
|
+
switch (tipoEntidade.toUpperCase()) {
|
|
204
|
+
case 'TABELA':
|
|
205
|
+
return 'TABLE';
|
|
206
|
+
case 'VISÃO':
|
|
207
|
+
case 'VISAO':
|
|
208
|
+
return 'VIEW';
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
traduzirComandoAlterar(comandoAlterar) {
|
|
212
|
+
let resultado = `ALTER ${this.traduzirTipoEntidade(comandoAlterar.tipoEntidade)} ${comandoAlterar.nomeEntidade} `;
|
|
213
|
+
for (const operacao of comandoAlterar.operacoes) {
|
|
214
|
+
switch (operacao.tipo) {
|
|
215
|
+
case 'ADICIONAR':
|
|
216
|
+
resultado += `ADD ${this.logicaManipulacaoColunas(operacao.elemento)}`;
|
|
217
|
+
break;
|
|
218
|
+
case 'ALTERAR':
|
|
219
|
+
resultado += 'INTEGER';
|
|
220
|
+
break;
|
|
221
|
+
case 'EXCLUIR':
|
|
222
|
+
resultado += 'BIT';
|
|
223
|
+
break;
|
|
224
|
+
case 'RENOMEAR':
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return resultado;
|
|
229
|
+
}
|
|
230
|
+
traduzir(comandos) {
|
|
231
|
+
let resultado = '';
|
|
232
|
+
for (const comando of comandos.filter((c) => c)) {
|
|
233
|
+
resultado += `${this.dicionarioComandos[comando.constructor.name](comando)} \n`;
|
|
234
|
+
}
|
|
235
|
+
return resultado;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
exports.TradutorSqlAnsi = TradutorSqlAnsi;
|
|
161
239
|
//# sourceMappingURL=index.js.map
|