@designliquido/lincones-sqlite 0.1.1 → 0.2.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.
- package/fontes/avaliador-sintatico/avaliador-sintatico.d.ts +1 -1
- package/fontes/comum/babel.config.d.ts +5 -0
- package/fontes/comum/babel.config.js +7 -0
- package/fontes/comum/babel.config.js.map +1 -0
- package/fontes/comum/fontes/avaliador-sintatico/avaliador-sintatico-base.d.ts +8 -5
- package/fontes/comum/fontes/avaliador-sintatico/avaliador-sintatico-base.js +81 -21
- package/fontes/comum/fontes/avaliador-sintatico/avaliador-sintatico-base.js.map +1 -1
- package/fontes/comum/fontes/avaliador-sintatico/avaliador-sintatico-sql-ansi.d.ts +7 -0
- package/fontes/comum/fontes/avaliador-sintatico/avaliador-sintatico-sql-ansi.js +12 -0
- package/fontes/comum/fontes/avaliador-sintatico/avaliador-sintatico-sql-ansi.js.map +1 -0
- package/fontes/comum/fontes/avaliador-sintatico/index.d.ts +1 -0
- package/fontes/comum/fontes/avaliador-sintatico/index.js +1 -0
- package/fontes/comum/fontes/avaliador-sintatico/index.js.map +1 -1
- package/fontes/comum/fontes/comandos/atualizar.d.ts +3 -9
- package/fontes/comum/fontes/comandos/atualizar.js.map +1 -1
- package/fontes/comum/fontes/comandos/criar.d.ts +2 -1
- package/fontes/comum/fontes/comandos/criar.js +2 -1
- package/fontes/comum/fontes/comandos/criar.js.map +1 -1
- package/fontes/comum/fontes/comandos/excluir.d.ts +3 -2
- package/fontes/comum/fontes/comandos/excluir.js.map +1 -1
- package/fontes/comum/fontes/comandos/inserir.d.ts +3 -3
- package/fontes/comum/fontes/comandos/inserir.js.map +1 -1
- package/fontes/comum/fontes/construtos/coluna-e-valor.d.ts +8 -0
- package/fontes/comum/fontes/construtos/coluna-e-valor.js +16 -0
- package/fontes/comum/fontes/construtos/coluna-e-valor.js.map +1 -0
- package/fontes/comum/fontes/construtos/coluna.d.ts +3 -1
- package/fontes/comum/fontes/construtos/coluna.js +21 -1
- package/fontes/comum/fontes/construtos/coluna.js.map +1 -1
- package/fontes/comum/fontes/construtos/condicao.d.ts +6 -4
- package/fontes/comum/fontes/construtos/condicao.js +11 -1
- package/fontes/comum/fontes/construtos/condicao.js.map +1 -1
- package/fontes/comum/fontes/construtos/construto.d.ts +3 -0
- package/fontes/comum/fontes/construtos/construto.js +7 -0
- package/fontes/comum/fontes/construtos/construto.js.map +1 -0
- package/fontes/comum/fontes/construtos/index.d.ts +8 -0
- package/fontes/comum/fontes/construtos/index.js +8 -0
- package/fontes/comum/fontes/construtos/index.js.map +1 -1
- package/fontes/comum/fontes/construtos/literal.d.ts +7 -0
- package/fontes/comum/fontes/construtos/literal.js +16 -0
- package/fontes/comum/fontes/construtos/literal.js.map +1 -0
- package/fontes/comum/fontes/construtos/operacao-alteracao-tabela.d.ts +3 -1
- package/fontes/comum/fontes/construtos/operacao-alteracao-tabela.js +6 -1
- package/fontes/comum/fontes/construtos/operacao-alteracao-tabela.js.map +1 -1
- package/fontes/comum/fontes/construtos/parametro-anonimo.d.ts +4 -0
- package/fontes/comum/fontes/construtos/parametro-anonimo.js +11 -0
- package/fontes/comum/fontes/construtos/parametro-anonimo.js.map +1 -0
- package/fontes/comum/fontes/construtos/parametro-nomeado.d.ts +6 -0
- package/fontes/comum/fontes/construtos/parametro-nomeado.js +15 -0
- package/fontes/comum/fontes/construtos/parametro-nomeado.js.map +1 -0
- package/fontes/comum/fontes/construtos/referencia-coluna.d.ts +6 -0
- package/fontes/comum/fontes/construtos/referencia-coluna.js +15 -0
- package/fontes/comum/fontes/construtos/referencia-coluna.js.map +1 -0
- package/fontes/comum/fontes/construtos/restricao.d.ts +3 -1
- package/fontes/comum/fontes/construtos/restricao.js +24 -1
- package/fontes/comum/fontes/construtos/restricao.js.map +1 -1
- package/fontes/comum/fontes/index.d.ts +7 -0
- package/fontes/comum/{index.js → fontes/index.js} +7 -8
- package/fontes/comum/fontes/index.js.map +1 -0
- package/fontes/comum/fontes/lexador/index.d.ts +1 -0
- package/fontes/comum/fontes/lexador/index.js +1 -0
- package/fontes/comum/fontes/lexador/index.js.map +1 -1
- package/fontes/comum/fontes/lexador/lexador-base.d.ts +26 -0
- package/fontes/comum/fontes/lexador/lexador-base.js +211 -0
- package/fontes/comum/fontes/lexador/lexador-base.js.map +1 -0
- package/fontes/comum/fontes/lexador/lexador-sql-ansi.d.ts +11 -0
- package/fontes/comum/fontes/lexador/lexador-sql-ansi.js +47 -0
- package/fontes/comum/fontes/lexador/lexador-sql-ansi.js.map +1 -0
- package/fontes/comum/fontes/lexador/lexador.d.ts +2 -23
- package/fontes/comum/fontes/lexador/lexador.js +5 -198
- package/fontes/comum/fontes/lexador/lexador.js.map +1 -1
- package/fontes/comum/fontes/lexador/palavras-reservadas/index.d.ts +2 -0
- package/fontes/comum/fontes/lexador/palavras-reservadas/index.js +19 -0
- package/fontes/comum/fontes/lexador/palavras-reservadas/index.js.map +1 -0
- package/fontes/comum/fontes/{palavras-reservadas.d.ts → lexador/palavras-reservadas/lincones.d.ts} +1 -0
- package/fontes/comum/fontes/{palavras-reservadas.js → lexador/palavras-reservadas/lincones.js} +3 -2
- package/fontes/comum/fontes/lexador/palavras-reservadas/lincones.js.map +1 -0
- package/fontes/comum/fontes/lexador/palavras-reservadas/sql.d.ts +37 -0
- package/fontes/comum/fontes/lexador/palavras-reservadas/sql.js +43 -0
- package/fontes/comum/fontes/lexador/palavras-reservadas/sql.js.map +1 -0
- package/fontes/comum/fontes/{tipos-de-simbolos.d.ts → tipos-de-simbolos/index.d.ts} +3 -0
- package/fontes/comum/fontes/{tipos-de-simbolos.js → tipos-de-simbolos/index.js} +4 -1
- package/fontes/comum/fontes/tipos-de-simbolos/index.js.map +1 -0
- package/fontes/comum/fontes/tradutor/index.d.ts +2 -32
- package/fontes/comum/fontes/tradutor/index.js +15 -235
- package/fontes/comum/fontes/tradutor/index.js.map +1 -1
- package/fontes/comum/fontes/tradutor/tradutor-reverso-sql-ansi.d.ts +7 -0
- package/fontes/comum/fontes/tradutor/tradutor-reverso-sql-ansi.js +12 -0
- package/fontes/comum/fontes/tradutor/tradutor-reverso-sql-ansi.js.map +1 -0
- package/fontes/comum/fontes/tradutor/tradutor-sql-ansi.d.ts +33 -0
- package/fontes/comum/fontes/tradutor/tradutor-sql-ansi.js +246 -0
- package/fontes/comum/fontes/tradutor/tradutor-sql-ansi.js.map +1 -0
- package/fontes/comum/testes/avaliador-sintatico.test.js +85 -14
- package/fontes/comum/testes/avaliador-sintatico.test.js.map +1 -1
- package/fontes/comum/testes/construtos.test.js +52 -0
- package/fontes/comum/testes/construtos.test.js.map +1 -0
- package/fontes/comum/testes/lexador-sql-ansi.test.d.ts +1 -0
- package/fontes/comum/testes/lexador-sql-ansi.test.js +83 -0
- package/fontes/comum/testes/lexador-sql-ansi.test.js.map +1 -0
- package/fontes/comum/testes/tradutor-sql-ansi.test.d.ts +1 -0
- package/fontes/comum/testes/{tradutor.test.js → tradutor-sql-ansi.test.js} +29 -25
- package/fontes/comum/testes/tradutor-sql-ansi.test.js.map +1 -0
- package/fontes/infraestrutura/cliente-sqlite.d.ts +1 -1
- package/fontes/infraestrutura/cliente-sqlite.js +10 -9
- package/fontes/infraestrutura/cliente-sqlite.js.map +1 -1
- package/fontes/lincones-sqlite.d.ts +4 -3
- package/fontes/lincones-sqlite.js +5 -4
- package/fontes/lincones-sqlite.js.map +1 -1
- package/fontes/tradutor/index.d.ts +2 -6
- package/fontes/tradutor/index.js +2 -87
- package/fontes/tradutor/index.js.map +1 -1
- package/package.json +1 -1
- package/fontes/comum/fontes/palavras-reservadas.js.map +0 -1
- package/fontes/comum/fontes/tipos-de-simbolos.js.map +0 -1
- package/fontes/comum/index.d.ts +0 -8
- package/fontes/comum/index.js.map +0 -1
- package/fontes/comum/testes/tradutor.test.js.map +0 -1
- /package/fontes/comum/testes/{tradutor.test.d.ts → construtos.test.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"condicao.js","sourceRoot":"","sources":["../../../../../fontes/comum/fontes/construtos/condicao.ts"],"names":[],"mappings":";;;AAAA,MAAa,
|
|
1
|
+
{"version":3,"file":"condicao.js","sourceRoot":"","sources":["../../../../../fontes/comum/fontes/construtos/condicao.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAExC,MAAa,QAAS,SAAQ,qBAAS;IAKnC,YACI,QAAmB,EACnB,QAAqE,EACrE,OAAkB;QAElB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAED,QAAQ;QACJ,IAAI,OAAO,GAAG,WAAW,CAAC;QAE1B,OAAO,IAAI,sBAAsB,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC;QAC5D,OAAO,IAAI,aAAa,IAAI,CAAC,QAAQ,EAAE,CAAC;QACxC,OAAO,IAAI,qBAAqB,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;QAC1D,OAAO,IAAI,GAAG,CAAC;QAEf,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AA1BD,4BA0BC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"construto.js","sourceRoot":"","sources":["../../../../../fontes/comum/fontes/construtos/construto.ts"],"names":[],"mappings":";;;AAAA,MAAsB,SAAS;CAE9B;AAFD,8BAEC"}
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
export * from './coluna';
|
|
2
|
+
export * from './coluna-e-valor';
|
|
2
3
|
export * from './condicao';
|
|
4
|
+
export * from './construto';
|
|
5
|
+
export * from './literal';
|
|
6
|
+
export * from './operacao-alteracao-tabela';
|
|
7
|
+
export * from './parametro-anonimo';
|
|
8
|
+
export * from './parametro-nomeado';
|
|
9
|
+
export * from './referencia-coluna';
|
|
10
|
+
export * from './restricao';
|
|
@@ -15,5 +15,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./coluna"), exports);
|
|
18
|
+
__exportStar(require("./coluna-e-valor"), exports);
|
|
18
19
|
__exportStar(require("./condicao"), exports);
|
|
20
|
+
__exportStar(require("./construto"), exports);
|
|
21
|
+
__exportStar(require("./literal"), exports);
|
|
22
|
+
__exportStar(require("./operacao-alteracao-tabela"), exports);
|
|
23
|
+
__exportStar(require("./parametro-anonimo"), exports);
|
|
24
|
+
__exportStar(require("./parametro-nomeado"), exports);
|
|
25
|
+
__exportStar(require("./referencia-coluna"), exports);
|
|
26
|
+
__exportStar(require("./restricao"), exports);
|
|
19
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../fontes/comum/fontes/construtos/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,6CAA2B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../fontes/comum/fontes/construtos/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,mDAAiC;AACjC,6CAA2B;AAC3B,8CAA4B;AAC5B,4CAA0B;AAC1B,8DAA4C;AAC5C,sDAAoC;AACpC,sDAAoC;AACpC,sDAAoC;AACpC,8CAA4B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Construto } from "./construto";
|
|
2
|
+
export declare class Literal extends Construto {
|
|
3
|
+
valor: any;
|
|
4
|
+
tipoPresumido: 'INTEIRO' | 'LOGICO' | 'NUMERO' | 'TEXTO';
|
|
5
|
+
constructor(valor: any, tipoPresumido?: 'INTEIRO' | 'LOGICO' | 'NUMERO' | 'TEXTO');
|
|
6
|
+
toString(): string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Literal = void 0;
|
|
4
|
+
const construto_1 = require("./construto");
|
|
5
|
+
class Literal extends construto_1.Construto {
|
|
6
|
+
constructor(valor, tipoPresumido = 'TEXTO') {
|
|
7
|
+
super();
|
|
8
|
+
this.valor = valor;
|
|
9
|
+
this.tipoPresumido = tipoPresumido;
|
|
10
|
+
}
|
|
11
|
+
toString() {
|
|
12
|
+
return `<Literal valor=${String(this.valor)} tipo presumido=${this.tipoPresumido}>`;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.Literal = Literal;
|
|
16
|
+
//# sourceMappingURL=literal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"literal.js","sourceRoot":"","sources":["../../../../../fontes/comum/fontes/construtos/literal.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAExC,MAAa,OAAQ,SAAQ,qBAAS;IAIlC,YAAY,KAAU,EAAE,gBAA2D,OAAO;QACtF,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACvC,CAAC;IAED,QAAQ;QACJ,OAAO,kBAAkB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,IAAI,CAAC,aAAa,GAAG,CAAC;IACxF,CAAC;CACJ;AAbD,0BAaC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Coluna } from "./coluna";
|
|
2
|
+
import { Construto } from "./construto";
|
|
2
3
|
import { Restricao } from "./restricao";
|
|
3
|
-
export declare class OperacaoAlteracaoTabela {
|
|
4
|
+
export declare class OperacaoAlteracaoTabela extends Construto {
|
|
4
5
|
tipo: 'ADICIONAR' | 'ALTERAR' | 'EXCLUIR' | 'RENOMEAR';
|
|
5
6
|
elemento: Coluna | Restricao;
|
|
6
7
|
constructor(tipo: string, elemento: Coluna | Restricao);
|
|
8
|
+
toString(): string;
|
|
7
9
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OperacaoAlteracaoTabela = void 0;
|
|
4
|
-
|
|
4
|
+
const construto_1 = require("./construto");
|
|
5
|
+
class OperacaoAlteracaoTabela extends construto_1.Construto {
|
|
5
6
|
constructor(tipo, elemento) {
|
|
7
|
+
super();
|
|
6
8
|
const tipoOperacaoResolvido = tipo.toUpperCase();
|
|
7
9
|
if (!['ADICIONAR', 'ALTERAR', 'EXCLUIR', 'RENOMEAR'].includes(tipoOperacaoResolvido)) {
|
|
8
10
|
throw new Error(`Tipo de operação de alteração de tabela inválido: ${tipoOperacaoResolvido}`);
|
|
@@ -10,6 +12,9 @@ class OperacaoAlteracaoTabela {
|
|
|
10
12
|
this.tipo = tipoOperacaoResolvido;
|
|
11
13
|
this.elemento = elemento;
|
|
12
14
|
}
|
|
15
|
+
toString() {
|
|
16
|
+
return `<OperaçãoAlteraçãoTabela tipo=${this.tipo} elemento=${this.elemento.toString()}>`;
|
|
17
|
+
}
|
|
13
18
|
}
|
|
14
19
|
exports.OperacaoAlteracaoTabela = OperacaoAlteracaoTabela;
|
|
15
20
|
//# sourceMappingURL=operacao-alteracao-tabela.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operacao-alteracao-tabela.js","sourceRoot":"","sources":["../../../../../fontes/comum/fontes/construtos/operacao-alteracao-tabela.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"operacao-alteracao-tabela.js","sourceRoot":"","sources":["../../../../../fontes/comum/fontes/construtos/operacao-alteracao-tabela.ts"],"names":[],"mappings":";;;AACA,2CAAwC;AAGxC,MAAa,uBAAwB,SAAQ,qBAAS;IAIlD,YACI,IAAY,EACZ,QAA4B;QAE5B,KAAK,EAAE,CAAC;QACR,MAAM,qBAAqB,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACjD,IAAI,CAAC,CAAC,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,CAAC;YACnF,MAAM,IAAI,KAAK,CAAC,qDAAqD,qBAAqB,EAAE,CAAC,CAAC;QAClG,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,qBAAyE,CAAC;QACtF,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAED,QAAQ;QACJ,OAAO,iCAAiC,IAAI,CAAC,IAAI,aAAa,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC;IAC9F,CAAC;CACJ;AArBD,0DAqBC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ParametroAnonimo = void 0;
|
|
4
|
+
const construto_1 = require("./construto");
|
|
5
|
+
class ParametroAnonimo extends construto_1.Construto {
|
|
6
|
+
toString() {
|
|
7
|
+
return `<ParâmetroAnônimo>`;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.ParametroAnonimo = ParametroAnonimo;
|
|
11
|
+
//# sourceMappingURL=parametro-anonimo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parametro-anonimo.js","sourceRoot":"","sources":["../../../../../fontes/comum/fontes/construtos/parametro-anonimo.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAExC,MAAa,gBAAiB,SAAQ,qBAAS;IAC3C,QAAQ;QACJ,OAAO,oBAAoB,CAAC;IAChC,CAAC;CACJ;AAJD,4CAIC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ParametroNomeado = void 0;
|
|
4
|
+
const construto_1 = require("./construto");
|
|
5
|
+
class ParametroNomeado extends construto_1.Construto {
|
|
6
|
+
constructor(nome) {
|
|
7
|
+
super();
|
|
8
|
+
this.nome = nome;
|
|
9
|
+
}
|
|
10
|
+
toString() {
|
|
11
|
+
return `<ParâmetroNomeado nome=${this.nome}>`;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.ParametroNomeado = ParametroNomeado;
|
|
15
|
+
//# sourceMappingURL=parametro-nomeado.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parametro-nomeado.js","sourceRoot":"","sources":["../../../../../fontes/comum/fontes/construtos/parametro-nomeado.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAExC,MAAa,gBAAiB,SAAQ,qBAAS;IAG3C,YAAY,IAAY;QACpB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,QAAQ;QACJ,OAAO,0BAA0B,IAAI,CAAC,IAAI,GAAG,CAAC;IAClD,CAAC;CACJ;AAXD,4CAWC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReferenciaColuna = void 0;
|
|
4
|
+
const construto_1 = require("./construto");
|
|
5
|
+
class ReferenciaColuna extends construto_1.Construto {
|
|
6
|
+
constructor(nomeColuna) {
|
|
7
|
+
super();
|
|
8
|
+
this.nomeColuna = nomeColuna;
|
|
9
|
+
}
|
|
10
|
+
toString() {
|
|
11
|
+
return `<ReferênciaColuna nome da coluna=${this.nomeColuna}>`;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.ReferenciaColuna = ReferenciaColuna;
|
|
15
|
+
//# sourceMappingURL=referencia-coluna.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referencia-coluna.js","sourceRoot":"","sources":["../../../../../fontes/comum/fontes/construtos/referencia-coluna.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAExC,MAAa,gBAAiB,SAAQ,qBAAS;IAG3C,YAAY,UAAkB;QAC1B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IACjC,CAAC;IAED,QAAQ;QACJ,OAAO,oCAAoC,IAAI,CAAC,UAAU,GAAG,CAAC;IAClE,CAAC;CACJ;AAXD,4CAWC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { Construto } from "./construto";
|
|
1
2
|
/**
|
|
2
3
|
* Uma restrição cria uma regra em uma tabela ou visão, que trabalha com uma ou mais colunas
|
|
3
4
|
* da mesma tabela e/ou de outras tabelass relacionadas.
|
|
4
5
|
*/
|
|
5
|
-
export declare class Restricao {
|
|
6
|
+
export declare class Restricao extends Construto {
|
|
6
7
|
nome: string;
|
|
7
8
|
tipo: 'CHAVE_PRIMARIA' | 'CHAVE_ESTRANGEIRA' | 'ÚNICA';
|
|
8
9
|
tabela: string;
|
|
@@ -10,4 +11,5 @@ export declare class Restricao {
|
|
|
10
11
|
tabelaReferenciada?: string;
|
|
11
12
|
colunasReferenciadas?: string[];
|
|
12
13
|
constructor(nome: string, tipo: 'CHAVE_PRIMARIA' | 'CHAVE_ESTRANGEIRA' | 'ÚNICA', tabela: string, colunas: string[], tabelaReferenciada?: string, colunasReferenciadas?: string[]);
|
|
14
|
+
toString(): string;
|
|
13
15
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Restricao = void 0;
|
|
4
|
+
const construto_1 = require("./construto");
|
|
4
5
|
/**
|
|
5
6
|
* Uma restrição cria uma regra em uma tabela ou visão, que trabalha com uma ou mais colunas
|
|
6
7
|
* da mesma tabela e/ou de outras tabelass relacionadas.
|
|
7
8
|
*/
|
|
8
|
-
class Restricao {
|
|
9
|
+
class Restricao extends construto_1.Construto {
|
|
9
10
|
constructor(nome, tipo, tabela, colunas, tabelaReferenciada, colunasReferenciadas) {
|
|
11
|
+
super();
|
|
10
12
|
this.nome = nome;
|
|
11
13
|
this.tipo = tipo;
|
|
12
14
|
this.tabela = tabela;
|
|
@@ -14,6 +16,27 @@ class Restricao {
|
|
|
14
16
|
this.tabelaReferenciada = tabelaReferenciada;
|
|
15
17
|
this.colunasReferenciadas = colunasReferenciadas;
|
|
16
18
|
}
|
|
19
|
+
toString() {
|
|
20
|
+
let retorno = `<Restrição nome=${this.nome} tabela=${this.tabela} colunas=[`;
|
|
21
|
+
for (const coluna of this.colunas) {
|
|
22
|
+
retorno += coluna + `, `;
|
|
23
|
+
}
|
|
24
|
+
retorno = retorno.slice(0, -2);
|
|
25
|
+
retorno += `]`;
|
|
26
|
+
if (this.tabelaReferenciada) {
|
|
27
|
+
retorno += ` tabela referenciada=${this.tabelaReferenciada}`;
|
|
28
|
+
}
|
|
29
|
+
if (this.colunasReferenciadas) {
|
|
30
|
+
retorno += ` colunas referenciadas=[`;
|
|
31
|
+
for (const coluna of this.colunasReferenciadas) {
|
|
32
|
+
retorno += coluna + `, `;
|
|
33
|
+
}
|
|
34
|
+
retorno = retorno.slice(0, -2);
|
|
35
|
+
retorno += `]`;
|
|
36
|
+
}
|
|
37
|
+
retorno += `>`;
|
|
38
|
+
return retorno;
|
|
39
|
+
}
|
|
17
40
|
}
|
|
18
41
|
exports.Restricao = Restricao;
|
|
19
42
|
//# sourceMappingURL=restricao.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restricao.js","sourceRoot":"","sources":["../../../../../fontes/comum/fontes/construtos/restricao.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,MAAa,
|
|
1
|
+
{"version":3,"file":"restricao.js","sourceRoot":"","sources":["../../../../../fontes/comum/fontes/construtos/restricao.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAExC;;;GAGG;AACH,MAAa,SAAU,SAAQ,qBAAS;IAQpC,YACI,IAAY,EACZ,IAAsD,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this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./
|
|
20
|
-
__exportStar(require("./
|
|
21
|
-
__exportStar(require("./
|
|
22
|
-
__exportStar(require("./
|
|
23
|
-
__exportStar(require("./
|
|
24
|
-
__exportStar(require("./fontes/tradutor"), exports);
|
|
17
|
+
__exportStar(require("./avaliador-sintatico"), exports);
|
|
18
|
+
__exportStar(require("./comandos"), exports);
|
|
19
|
+
__exportStar(require("./construtos"), exports);
|
|
20
|
+
__exportStar(require("./interfaces"), exports);
|
|
21
|
+
__exportStar(require("./lexador"), exports);
|
|
22
|
+
__exportStar(require("./tipos-de-simbolos"), exports);
|
|
23
|
+
__exportStar(require("./tradutor"), exports);
|
|
25
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../fontes/comum/fontes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,6CAA2B;AAC3B,+CAA6B;AAC7B,+CAA6B;AAC7B,4CAA0B;AAC1B,sDAAoC;AACpC,6CAA2B"}
|
|
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./lexador"), exports);
|
|
18
|
+
__exportStar(require("./lexador-sql-ansi"), exports);
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../fontes/comum/fontes/lexador/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../fontes/comum/fontes/lexador/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,qDAAmC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SimboloInterface } from '../interfaces';
|
|
2
|
+
import { RetornoLexador } from '../interfaces/retornos';
|
|
3
|
+
export declare abstract class LexadorBase {
|
|
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
|
+
abstract mapear(codigo: string[]): RetornoLexador;
|
|
26
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
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.LexadorBase = void 0;
|
|
7
|
+
const simbolo_1 = require("./simbolo");
|
|
8
|
+
const lincones_1 = __importDefault(require("./palavras-reservadas/lincones"));
|
|
9
|
+
const tipos_de_simbolos_1 = __importDefault(require("../tipos-de-simbolos"));
|
|
10
|
+
class LexadorBase {
|
|
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 lincones_1.default
|
|
118
|
+
? lincones_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.avancar();
|
|
135
|
+
break;
|
|
136
|
+
case '"':
|
|
137
|
+
this.avancar();
|
|
138
|
+
this.analisarTexto('"');
|
|
139
|
+
this.avancar();
|
|
140
|
+
break;
|
|
141
|
+
case "'":
|
|
142
|
+
this.avancar();
|
|
143
|
+
this.analisarTexto("'");
|
|
144
|
+
this.avancar();
|
|
145
|
+
break;
|
|
146
|
+
case '(':
|
|
147
|
+
this.adicionarSimbolo(tipos_de_simbolos_1.default.PARENTESE_ESQUERDO, '(');
|
|
148
|
+
this.avancar();
|
|
149
|
+
break;
|
|
150
|
+
case ')':
|
|
151
|
+
this.adicionarSimbolo(tipos_de_simbolos_1.default.PARENTESE_DIREITO, ')');
|
|
152
|
+
this.avancar();
|
|
153
|
+
break;
|
|
154
|
+
case ',':
|
|
155
|
+
this.adicionarSimbolo(tipos_de_simbolos_1.default.VIRGULA, ',');
|
|
156
|
+
this.avancar();
|
|
157
|
+
break;
|
|
158
|
+
case '=':
|
|
159
|
+
this.adicionarSimbolo(tipos_de_simbolos_1.default.IGUAL, '=');
|
|
160
|
+
this.avancar();
|
|
161
|
+
break;
|
|
162
|
+
case '*':
|
|
163
|
+
this.adicionarSimbolo(tipos_de_simbolos_1.default.TUDO, '*');
|
|
164
|
+
this.avancar();
|
|
165
|
+
break;
|
|
166
|
+
case '<':
|
|
167
|
+
this.avancar();
|
|
168
|
+
if (this.simboloAtual() === '=') {
|
|
169
|
+
this.adicionarSimbolo(tipos_de_simbolos_1.default.MENOR_IGUAL);
|
|
170
|
+
this.avancar();
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
this.adicionarSimbolo(tipos_de_simbolos_1.default.MENOR);
|
|
174
|
+
}
|
|
175
|
+
break;
|
|
176
|
+
case '>':
|
|
177
|
+
this.avancar();
|
|
178
|
+
if (this.simboloAtual() === '=') {
|
|
179
|
+
this.adicionarSimbolo(tipos_de_simbolos_1.default.MAIOR_IGUAL);
|
|
180
|
+
this.avancar();
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
this.adicionarSimbolo(tipos_de_simbolos_1.default.MAIOR);
|
|
184
|
+
}
|
|
185
|
+
break;
|
|
186
|
+
case ':':
|
|
187
|
+
this.adicionarSimbolo(tipos_de_simbolos_1.default.DOIS_PONTOS, ':');
|
|
188
|
+
this.avancar();
|
|
189
|
+
break;
|
|
190
|
+
case '?':
|
|
191
|
+
this.adicionarSimbolo(tipos_de_simbolos_1.default.INTERROGACAO, '?');
|
|
192
|
+
this.avancar();
|
|
193
|
+
break;
|
|
194
|
+
default:
|
|
195
|
+
if (this.eDigito(caractere))
|
|
196
|
+
this.analisarNumero();
|
|
197
|
+
else if (this.eAlfabeto(caractere))
|
|
198
|
+
this.identificarPalavraChave();
|
|
199
|
+
else {
|
|
200
|
+
this.erros.push({
|
|
201
|
+
linha: this.linha + 1,
|
|
202
|
+
caractere: caractere,
|
|
203
|
+
mensagem: 'Caractere inesperado.'
|
|
204
|
+
});
|
|
205
|
+
this.avancar();
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
exports.LexadorBase = LexadorBase;
|
|
211
|
+
//# sourceMappingURL=lexador-base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lexador-base.js","sourceRoot":"","sources":["../../../../../fontes/comum/fontes/lexador/lexador-base.ts"],"names":[],"mappings":";;;;;;AAAA,uCAAoC;AAIpC,8EAAgE;AAChE,6EAAmD;AAEnD,MAAsB,WAAW;IAQ7B,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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AAK,CAAC,IAAI,CAAC;wBACZ,KAAK,EAAE,IAAI,CAAC,KAAK,GAAG,CAAC;wBACrB,SAAS,EAAE,SAAS;wBACpB,QAAQ,EAAE,uBAAuB;qBACpC,CAAC,CAAC;oBACH,IAAI,CAAC,OAAO,EAAE,CAAC;gBACnB,CAAC;QACT,CAAC;IACL,CAAC;CAGJ;AA3PD,kCA2PC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RetornoLexador } from "../interfaces/retornos";
|
|
2
|
+
import { LexadorBase } from "./lexador-base";
|
|
3
|
+
/**
|
|
4
|
+
* O Lexador SQL ANSI transforma código SQL ANSI em um
|
|
5
|
+
* vetor de símbolos, a serem passados para o avaliador sintático
|
|
6
|
+
* correspondente.
|
|
7
|
+
*/
|
|
8
|
+
export declare class LexadorSqlAnsi extends LexadorBase {
|
|
9
|
+
identificarPalavraChave(): void;
|
|
10
|
+
mapear(codigo: string[]): RetornoLexador;
|
|
11
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
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.LexadorSqlAnsi = void 0;
|
|
7
|
+
const lexador_base_1 = require("./lexador-base");
|
|
8
|
+
const sql_1 = __importDefault(require("./palavras-reservadas/sql"));
|
|
9
|
+
const tipos_de_simbolos_1 = __importDefault(require("../tipos-de-simbolos"));
|
|
10
|
+
/**
|
|
11
|
+
* O Lexador SQL ANSI transforma código SQL ANSI em um
|
|
12
|
+
* vetor de símbolos, a serem passados para o avaliador sintático
|
|
13
|
+
* correspondente.
|
|
14
|
+
*/
|
|
15
|
+
class LexadorSqlAnsi extends lexador_base_1.LexadorBase {
|
|
16
|
+
identificarPalavraChave() {
|
|
17
|
+
while (this.eAlfabetoOuDigito(this.simboloAtual())) {
|
|
18
|
+
this.avancar();
|
|
19
|
+
}
|
|
20
|
+
const codigo = this.codigo[this.linha].substring(this.inicioSimbolo, this.atual).toLowerCase();
|
|
21
|
+
const tipo = codigo in sql_1.default
|
|
22
|
+
? sql_1.default[codigo]
|
|
23
|
+
: tipos_de_simbolos_1.default.IDENTIFICADOR;
|
|
24
|
+
this.adicionarSimbolo(tipo);
|
|
25
|
+
}
|
|
26
|
+
mapear(codigo) {
|
|
27
|
+
this.inicioSimbolo = 0;
|
|
28
|
+
this.atual = 0;
|
|
29
|
+
this.linha = 0;
|
|
30
|
+
this.codigo = codigo || [''];
|
|
31
|
+
this.simbolos = [];
|
|
32
|
+
this.erros = [];
|
|
33
|
+
for (let iterador = 0; iterador < this.codigo.length; iterador++) {
|
|
34
|
+
this.codigo[iterador] += '\0';
|
|
35
|
+
}
|
|
36
|
+
while (!this.eFinalDoCodigo()) {
|
|
37
|
+
this.inicioSimbolo = this.atual;
|
|
38
|
+
this.analisarToken();
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
simbolos: this.simbolos,
|
|
42
|
+
erros: this.erros
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.LexadorSqlAnsi = LexadorSqlAnsi;
|
|
47
|
+
//# sourceMappingURL=lexador-sql-ansi.js.map
|