@designliquido/delegua-node 0.22.7 → 0.24.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/README.md +1 -1
- package/bin/package.json +2 -2
- package/execucao.js +8 -8
- package/execucao.js.map +1 -1
- package/fontes/delegua.d.ts +11 -92
- package/fontes/delegua.js +24 -433
- package/fontes/delegua.js.map +1 -1
- package/fontes/depuracao/servidor-depuracao.d.ts +3 -3
- package/fontes/depuracao/servidor-depuracao.js +10 -10
- package/fontes/depuracao/servidor-depuracao.js.map +1 -1
- package/fontes/importador/importador-javascript.d.ts +14 -0
- package/fontes/importador/importador-javascript.js +60 -0
- package/fontes/importador/importador-javascript.js.map +1 -0
- package/fontes/importador/importador.d.ts +7 -6
- package/fontes/importador/importador.js +1 -8
- package/fontes/importador/importador.js.map +1 -1
- package/fontes/importador/retorno-importador.d.ts +3 -3
- package/fontes/interfaces/delegua-interface.d.ts +4 -22
- package/fontes/interfaces/importador-interface.d.ts +2 -2
- package/fontes/interfaces/nucleo-execucao-interface.d.ts +12 -0
- package/fontes/interfaces/nucleo-execucao-interface.js +3 -0
- package/fontes/interfaces/nucleo-execucao-interface.js.map +1 -0
- package/fontes/interpretador/dialetos/interpretador-birl-com-depuracao-importacao.d.ts +4 -3
- package/fontes/interpretador/dialetos/interpretador-birl-com-depuracao-importacao.js +1 -1
- package/fontes/interpretador/dialetos/interpretador-birl-com-depuracao-importacao.js.map +1 -1
- package/fontes/interpretador/dialetos/interpretador-mapler-com-depuracao-importacao.d.ts +4 -3
- package/fontes/interpretador/dialetos/interpretador-mapler-com-depuracao-importacao.js +1 -1
- package/fontes/interpretador/dialetos/interpretador-mapler-com-depuracao-importacao.js.map +1 -1
- package/fontes/interpretador/dialetos/interpretador-visualg-com-depuracao-importacao.d.ts +4 -3
- package/fontes/interpretador/dialetos/interpretador-visualg-com-depuracao-importacao.js +1 -1
- package/fontes/interpretador/dialetos/interpretador-visualg-com-depuracao-importacao.js.map +1 -1
- package/fontes/interpretador/interpretador-com-depuracao-importacao.d.ts +4 -3
- package/fontes/interpretador/interpretador-com-depuracao-importacao.js +1 -1
- package/fontes/interpretador/interpretador-com-depuracao-importacao.js.map +1 -1
- package/fontes/interpretador/interpretador.d.ts +4 -3
- package/fontes/interpretador/interpretador.js +1 -1
- package/fontes/interpretador/interpretador.js.map +1 -1
- package/fontes/nucleo-comum.d.ts +12 -0
- package/fontes/nucleo-comum.js +49 -0
- package/fontes/nucleo-comum.js.map +1 -0
- package/fontes/nucleo-execucao.d.ts +66 -0
- package/fontes/nucleo-execucao.js +309 -0
- package/fontes/nucleo-execucao.js.map +1 -0
- package/fontes/nucleo-traducao.d.ts +29 -0
- package/fontes/nucleo-traducao.js +108 -0
- package/fontes/nucleo-traducao.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LexadorJavaScript } from "@designliquido/delegua/fontes/lexador/traducao/lexador-javascript";
|
|
2
|
+
import { AvaliadorSintaticoJavaScript } from "@designliquido/delegua/fontes/avaliador-sintatico/traducao/avaliador-sintatico-javascript";
|
|
3
|
+
import { ImportadorInterface } from "../interfaces";
|
|
4
|
+
import { RetornoImportador } from "./retorno-importador";
|
|
5
|
+
import { Statement, Directive, ModuleDeclaration } from 'estree';
|
|
6
|
+
export declare class ImportadorJavaScript implements ImportadorInterface<(Statement | Directive | ModuleDeclaration), (Statement | Directive | ModuleDeclaration)> {
|
|
7
|
+
diretorioBase: string;
|
|
8
|
+
conteudoArquivosAbertos: {
|
|
9
|
+
[identificador: string]: string[];
|
|
10
|
+
};
|
|
11
|
+
lexador: LexadorJavaScript;
|
|
12
|
+
avaliadorSintatico: AvaliadorSintaticoJavaScript;
|
|
13
|
+
importar(caminhoRelativoArquivo: string, importacaoInicial: boolean): RetornoImportador<(Statement | Directive | ModuleDeclaration), (Statement | Directive | ModuleDeclaration)>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.ImportadorJavaScript = void 0;
|
|
30
|
+
const sistemaArquivos = __importStar(require("fs"));
|
|
31
|
+
const caminho = __importStar(require("path"));
|
|
32
|
+
const sistemaOperacional = __importStar(require("os"));
|
|
33
|
+
const cyrb53_1 = __importDefault(require("@designliquido/delegua/fontes/depuracao/cyrb53"));
|
|
34
|
+
class ImportadorJavaScript {
|
|
35
|
+
importar(caminhoRelativoArquivo, importacaoInicial) {
|
|
36
|
+
const nomeArquivo = caminho.basename(caminhoRelativoArquivo);
|
|
37
|
+
let caminhoAbsolutoArquivo = caminho.resolve(this.diretorioBase, caminhoRelativoArquivo);
|
|
38
|
+
if (importacaoInicial) {
|
|
39
|
+
caminhoAbsolutoArquivo = caminho.resolve(caminhoRelativoArquivo);
|
|
40
|
+
}
|
|
41
|
+
const hashArquivo = (0, cyrb53_1.default)(caminhoAbsolutoArquivo.toLowerCase());
|
|
42
|
+
const dadosDoArquivo = sistemaArquivos.readFileSync(caminhoAbsolutoArquivo);
|
|
43
|
+
const conteudoDoArquivo = dadosDoArquivo.toString().replace(sistemaOperacional.EOL, '\n').split('\n');
|
|
44
|
+
for (let linha = 0; linha < conteudoDoArquivo.length; linha++) {
|
|
45
|
+
conteudoDoArquivo[linha] += '\0';
|
|
46
|
+
}
|
|
47
|
+
const retornoLexador = this.lexador.mapear(conteudoDoArquivo, hashArquivo);
|
|
48
|
+
const retornoAvaliadorSintatico = this.avaliadorSintatico.analisar(retornoLexador, hashArquivo);
|
|
49
|
+
// TODO: Verificar se vai ser necessário.
|
|
50
|
+
// this.arquivosAbertos[hashArquivo] = caminho.resolve(caminhoRelativoArquivo);
|
|
51
|
+
return {
|
|
52
|
+
nomeArquivo,
|
|
53
|
+
hashArquivo,
|
|
54
|
+
retornoLexador,
|
|
55
|
+
retornoAvaliadorSintatico,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.ImportadorJavaScript = ImportadorJavaScript;
|
|
60
|
+
//# sourceMappingURL=importador-javascript.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"importador-javascript.js","sourceRoot":"","sources":["../../../fontes/importador/importador-javascript.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AACtC,8CAAgC;AAChC,uDAAyC;AAEzC,4FAAoE;AASpE,MAAa,oBAAoB;IAM7B,QAAQ,CAAC,sBAA8B,EAAE,iBAA0B;QAC/D,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC;QAC7D,IAAI,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,sBAAsB,CAAC,CAAC;QACzF,IAAI,iBAAiB,EAAE;YACnB,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;SACpE;QAED,MAAM,WAAW,GAAG,IAAA,gBAAM,EAAC,sBAAsB,CAAC,WAAW,EAAE,CAAC,CAAC;QACjE,MAAM,cAAc,GAAW,eAAe,CAAC,YAAY,CAAC,sBAAsB,CAAC,CAAC;QACpF,MAAM,iBAAiB,GAAa,cAAc,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,kBAAkB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAEhH,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,iBAAiB,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YAC3D,iBAAiB,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC;SACpC;QAED,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC;QAC3E,MAAM,yBAAyB,GAAG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;QAChG,yCAAyC;QACzC,+EAA+E;QAE/E,OAAO;YACH,WAAW;YACX,WAAW;YACX,cAAc;YACd,yBAAyB;SACmF,CAAC;IACrH,CAAC;CAEJ;AAlCD,oDAkCC"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { AvaliadorSintaticoInterface, LexadorInterface } from '@designliquido/delegua/fontes/interfaces';
|
|
1
|
+
import { AvaliadorSintaticoInterface, LexadorInterface, SimboloInterface } from '@designliquido/delegua/fontes/interfaces';
|
|
2
2
|
import { RetornoImportador } from './retorno-importador';
|
|
3
3
|
import { ImportadorInterface } from '../interfaces';
|
|
4
|
+
import { Declaracao } from '@designliquido/delegua/fontes/declaracoes';
|
|
4
5
|
/**
|
|
5
6
|
* O Importador é responsável por manusear arquivos. Coordena as fases de lexação, avaliação sintática,
|
|
6
7
|
* cataloga informações do arquivo no núcleo da linguagem (através das referências `arquivosAbertos` e
|
|
7
8
|
* `conteudoArquivosAbertos`) e aponta erros caso ocorram.
|
|
8
9
|
*
|
|
9
10
|
*/
|
|
10
|
-
export declare class Importador implements ImportadorInterface {
|
|
11
|
+
export declare class Importador implements ImportadorInterface<SimboloInterface, Declaracao> {
|
|
11
12
|
diretorioBase: string;
|
|
12
|
-
lexador: LexadorInterface
|
|
13
|
-
avaliadorSintatico: AvaliadorSintaticoInterface
|
|
13
|
+
lexador: LexadorInterface<SimboloInterface>;
|
|
14
|
+
avaliadorSintatico: AvaliadorSintaticoInterface<SimboloInterface, Declaracao>;
|
|
14
15
|
arquivosAbertos: {
|
|
15
16
|
[identificador: string]: string;
|
|
16
17
|
};
|
|
@@ -18,10 +19,10 @@ export declare class Importador implements ImportadorInterface {
|
|
|
18
19
|
[identificador: string]: string[];
|
|
19
20
|
};
|
|
20
21
|
depuracao: boolean;
|
|
21
|
-
constructor(lexador: LexadorInterface
|
|
22
|
+
constructor(lexador: LexadorInterface<SimboloInterface>, avaliadorSintatico: AvaliadorSintaticoInterface<SimboloInterface, Declaracao>, arquivosAbertos: {
|
|
22
23
|
[identificador: string]: string;
|
|
23
24
|
}, conteudoArquivosAbertos: {
|
|
24
25
|
[identificador: string]: string[];
|
|
25
26
|
}, depuracao: boolean);
|
|
26
|
-
importar(caminhoRelativoArquivo: string, importacaoInicial?: boolean
|
|
27
|
+
importar(caminhoRelativoArquivo: string, importacaoInicial?: boolean): RetornoImportador<SimboloInterface, Declaracao>;
|
|
27
28
|
}
|
|
@@ -46,7 +46,7 @@ class Importador {
|
|
|
46
46
|
this.conteudoArquivosAbertos = conteudoArquivosAbertos;
|
|
47
47
|
this.depuracao = depuracao;
|
|
48
48
|
}
|
|
49
|
-
importar(caminhoRelativoArquivo, importacaoInicial = false
|
|
49
|
+
importar(caminhoRelativoArquivo, importacaoInicial = false) {
|
|
50
50
|
const nomeArquivo = caminho.basename(caminhoRelativoArquivo);
|
|
51
51
|
let caminhoAbsolutoArquivo = caminho.resolve(this.diretorioBase, caminhoRelativoArquivo);
|
|
52
52
|
if (importacaoInicial) {
|
|
@@ -63,13 +63,6 @@ class Importador {
|
|
|
63
63
|
}
|
|
64
64
|
const dadosDoArquivo = sistemaArquivos.readFileSync(caminhoAbsolutoArquivo);
|
|
65
65
|
const conteudoDoArquivo = dadosDoArquivo.toString().replace(sistemaOperacional.EOL, '\n').split('\n');
|
|
66
|
-
if (retornarConteudoArquivo) {
|
|
67
|
-
return {
|
|
68
|
-
conteudoArquivo: conteudoDoArquivo,
|
|
69
|
-
nomeArquivo,
|
|
70
|
-
hashArquivo,
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
66
|
for (let linha = 0; linha < conteudoDoArquivo.length; linha++) {
|
|
74
67
|
conteudoDoArquivo[linha] += '\0';
|
|
75
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"importador.js","sourceRoot":"","sources":["../../../fontes/importador/importador.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AACtC,8CAAgC;AAChC,uDAAyC;AAEzC,4FAAoE;
|
|
1
|
+
{"version":3,"file":"importador.js","sourceRoot":"","sources":["../../../fontes/importador/importador.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AACtC,8CAAgC;AAChC,uDAAyC;AAEzC,4FAAoE;AAQpE;;;;;GAKG;AACH,MAAa,UAAU;IAQnB,YACI,OAA2C,EAC3C,kBAA6E,EAC7E,eAAoD,EACpD,uBAA8D,EAC9D,SAAkB;QAZtB,kBAAa,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AM,yBAAyB,GAAG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;QAChG,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;QAE5E,IAAI,IAAI,CAAC,SAAS,EAAE;YAChB,IAAI,CAAC,uBAAuB,CAAC,WAAW,CAAC,GAAG,iBAAiB,CAAC;SACjE;QAED,OAAO;YACH,WAAW;YACX,WAAW;YACX,cAAc;YACd,yBAAyB;SACuB,CAAC;IACzD,CAAC;CACJ;AAjED,gCAiEC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { RetornoAvaliadorSintatico } from '@designliquido/delegua/fontes/interfaces/retornos/retorno-avaliador-sintatico';
|
|
2
2
|
import { RetornoLexador } from '@designliquido/delegua/fontes/interfaces/retornos/retorno-lexador';
|
|
3
|
-
export interface RetornoImportador {
|
|
3
|
+
export interface RetornoImportador<TSimbolo, TDeclaracao> {
|
|
4
4
|
conteudoArquivo: string[];
|
|
5
5
|
nomeArquivo: string;
|
|
6
6
|
hashArquivo: number;
|
|
7
|
-
retornoLexador: RetornoLexador
|
|
8
|
-
retornoAvaliadorSintatico: RetornoAvaliadorSintatico
|
|
7
|
+
retornoLexador: RetornoLexador<TSimbolo>;
|
|
8
|
+
retornoAvaliadorSintatico: RetornoAvaliadorSintatico<TDeclaracao>;
|
|
9
9
|
}
|
|
@@ -1,24 +1,6 @@
|
|
|
1
|
-
import { RetornoImportador } from '../importador';
|
|
2
|
-
import { AvaliadorSintaticoInterface, InterpretadorComDepuracaoInterface, InterpretadorInterface, LexadorInterface, RetornoExecucaoInterface, SimboloInterface } from '@designliquido/delegua/fontes/interfaces';
|
|
3
|
-
import { ImportadorInterface } from './importador-interface';
|
|
4
1
|
export interface DeleguaInterface {
|
|
5
|
-
dialeto: string
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
conteudoArquivosAbertos: {
|
|
10
|
-
[identificador: string]: string[];
|
|
11
|
-
};
|
|
12
|
-
funcaoDeRetorno: Function;
|
|
13
|
-
interpretador: InterpretadorInterface | InterpretadorComDepuracaoInterface;
|
|
14
|
-
lexador: LexadorInterface;
|
|
15
|
-
avaliadorSintatico: AvaliadorSintaticoInterface;
|
|
16
|
-
importador: ImportadorInterface;
|
|
17
|
-
versao(): string;
|
|
18
|
-
carregarArquivo(caminhoRelativoArquivo: string): void;
|
|
19
|
-
executar(retornoImportador: RetornoImportador): Promise<RetornoExecucaoInterface>;
|
|
20
|
-
executarUmaLinha(linha: string): Promise<RetornoExecucaoInterface>;
|
|
21
|
-
reportar(linha: number, onde: any, mensagem: string): void;
|
|
22
|
-
erro(simbolo: SimboloInterface, mensagemDeErro: string): void;
|
|
23
|
-
erroEmTempoDeExecucao(erro: any): void;
|
|
2
|
+
executarCodigoComoArgumento(codigo: string, dialeto: string, performance: boolean): Promise<void>;
|
|
3
|
+
executarCodigoPorArquivo(caminhoRelativoArquivo: string, dialeto: string, performance: boolean): Promise<any>;
|
|
4
|
+
iniciarLair(dialeto: string): Promise<void>;
|
|
5
|
+
traduzirArquivo(caminhoRelativoArquivo: string, comandoTraducao: string, gerarArquivoSaida: boolean): void;
|
|
24
6
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { RetornoImportador } from '../importador';
|
|
2
|
-
export interface ImportadorInterface {
|
|
2
|
+
export interface ImportadorInterface<TSimbolo, TDeclaracao> {
|
|
3
3
|
diretorioBase: string;
|
|
4
4
|
conteudoArquivosAbertos: {
|
|
5
5
|
[identificador: string]: string[];
|
|
6
6
|
};
|
|
7
|
-
importar(caminhoRelativoArquivo: string, importacaoInicial: boolean
|
|
7
|
+
importar(caminhoRelativoArquivo: string, importacaoInicial: boolean): RetornoImportador<TSimbolo, TDeclaracao>;
|
|
8
8
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InterpretadorInterface, RetornoExecucaoInterface } from "@designliquido/delegua/fontes/interfaces";
|
|
2
|
+
export interface NucleoExecucaoInterface {
|
|
3
|
+
arquivosAbertos: {
|
|
4
|
+
[identificador: string]: string;
|
|
5
|
+
};
|
|
6
|
+
conteudoArquivosAbertos: {
|
|
7
|
+
[identificador: string]: string[];
|
|
8
|
+
};
|
|
9
|
+
funcaoDeRetorno: Function;
|
|
10
|
+
interpretador: InterpretadorInterface;
|
|
11
|
+
executarUmaLinha(linha: string): Promise<RetornoExecucaoInterface>;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nucleo-execucao-interface.js","sourceRoot":"","sources":["../../../fontes/interfaces/nucleo-execucao-interface.ts"],"names":[],"mappings":""}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { InterpretadorBirl } from "@designliquido/delegua/fontes/interpretador/dialetos";
|
|
2
2
|
import { ImportadorInterface } from "../../interfaces";
|
|
3
|
-
import { Importar } from "@designliquido/delegua/fontes/declaracoes";
|
|
3
|
+
import { Declaracao, Importar } from "@designliquido/delegua/fontes/declaracoes";
|
|
4
4
|
import { DeleguaModulo } from "@designliquido/delegua/fontes/estruturas";
|
|
5
|
+
import { SimboloInterface } from '@designliquido/delegua/fontes/interfaces';
|
|
5
6
|
export declare class InterpretadorBirlImportacao extends InterpretadorBirl {
|
|
6
|
-
importador: ImportadorInterface
|
|
7
|
-
constructor(importador: ImportadorInterface, diretorioBase: string, funcaoDeRetorno: Function, funcaoDeRetornoMesmaLinha: Function);
|
|
7
|
+
importador: ImportadorInterface<SimboloInterface, Declaracao>;
|
|
8
|
+
constructor(importador: ImportadorInterface<SimboloInterface, Declaracao>, diretorioBase: string, funcaoDeRetorno: Function, funcaoDeRetornoMesmaLinha: Function);
|
|
8
9
|
visitarDeclaracaoImportar(declaracao: Importar): Promise<DeleguaModulo>;
|
|
9
10
|
}
|
|
@@ -50,7 +50,7 @@ class InterpretadorBirlImportacao extends dialetos_1.InterpretadorBirl {
|
|
|
50
50
|
return null;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
const conteudoImportacao = this.importador.importar(caminhoRelativo, false
|
|
53
|
+
const conteudoImportacao = this.importador.importar(caminhoRelativo, false);
|
|
54
54
|
const retornoInterpretador = await this.interpretar(conteudoImportacao.retornoAvaliadorSintatico.declaracoes, true);
|
|
55
55
|
const funcoesChamaveis = this.pilhaEscoposExecucao.obterTodasDeleguaFuncao();
|
|
56
56
|
const declaracoesClasse = this.pilhaEscoposExecucao.obterTodasDeclaracaoClasse();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interpretador-birl-com-depuracao-importacao.js","sourceRoot":"","sources":["../../../../fontes/interpretador/dialetos/interpretador-birl-com-depuracao-importacao.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAgC;AAEhC,mFAAyF;AAGzF,yEAAyE;AAEzE,2GAAyE;
|
|
1
|
+
{"version":3,"file":"interpretador-birl-com-depuracao-importacao.js","sourceRoot":"","sources":["../../../../fontes/interpretador/dialetos/interpretador-birl-com-depuracao-importacao.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAgC;AAEhC,mFAAyF;AAGzF,yEAAyE;AAEzE,2GAAyE;AAGzE,MAAa,2BAA4B,SAAQ,4BAAiB;IAG9D,YACI,UAA6D,EAC7D,aAAqB,EACrB,eAAyB,EACzB,yBAAmC;QAEnC,KAAK,CAAC,aAAa,EAAE,eAAe,EAAE,yBAAyB,CAAC,CAAC;QACjE,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IACjC,CAAC;IAED,mBAAmB;IACnB,KAAK,CAAC,yBAAyB,CAAC,UAAoB;QAChD,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC/D,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,eAAe,C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K,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,uBAAuB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACrD,UAAU,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC;SACtG;QAED,OAAO,UAAU,CAAC;IACtB,CAAC;CACJ;AAxDD,kEAwDC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Importar } from "@designliquido/delegua/fontes/declaracoes";
|
|
1
|
+
import { Declaracao, Importar } from "@designliquido/delegua/fontes/declaracoes";
|
|
2
2
|
import { DeleguaModulo } from "@designliquido/delegua/fontes/estruturas";
|
|
3
3
|
import { InterpretadorMaplerComDepuracao } from "@designliquido/delegua/fontes/interpretador/dialetos/mapler/interpretador-mapler-com-depuracao";
|
|
4
4
|
import { ImportadorInterface } from "../../interfaces";
|
|
5
|
+
import { SimboloInterface } from "@designliquido/delegua/fontes/interfaces";
|
|
5
6
|
export declare class InterpretadorMaplerComDepuracaoImportacao extends InterpretadorMaplerComDepuracao {
|
|
6
|
-
importador: ImportadorInterface
|
|
7
|
-
constructor(importador: ImportadorInterface, diretorioBase: string, funcaoDeRetorno: Function, funcaoDeRetornoMesmaLinha: Function);
|
|
7
|
+
importador: ImportadorInterface<SimboloInterface, Declaracao>;
|
|
8
|
+
constructor(importador: ImportadorInterface<SimboloInterface, Declaracao>, diretorioBase: string, funcaoDeRetorno: Function, funcaoDeRetornoMesmaLinha: Function);
|
|
8
9
|
/**
|
|
9
10
|
* Importa um arquivo como módulo.
|
|
10
11
|
* @param declaracao A declaração de importação.
|
|
@@ -15,7 +15,7 @@ class InterpretadorMaplerComDepuracaoImportacao extends interpretador_mapler_com
|
|
|
15
15
|
*/
|
|
16
16
|
async visitarDeclaracaoImportar(declaracao) {
|
|
17
17
|
const caminhoRelativo = await this.avaliar(declaracao.caminho);
|
|
18
|
-
const conteudoImportacao = this.importador.importar(caminhoRelativo, false
|
|
18
|
+
const conteudoImportacao = this.importador.importar(caminhoRelativo, false);
|
|
19
19
|
const retornoInterpretador = await this.interpretar(conteudoImportacao.retornoAvaliadorSintatico.declaracoes, true);
|
|
20
20
|
const funcoesChamaveis = this.pilhaEscoposExecucao.obterTodasDeleguaFuncao();
|
|
21
21
|
const novoModulo = new estruturas_1.DeleguaModulo();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interpretador-mapler-com-depuracao-importacao.js","sourceRoot":"","sources":["../../../../fontes/interpretador/dialetos/interpretador-mapler-com-depuracao-importacao.ts"],"names":[],"mappings":";;;AACA,yEAAyE;AACzE,uJAAiJ;
|
|
1
|
+
{"version":3,"file":"interpretador-mapler-com-depuracao-importacao.js","sourceRoot":"","sources":["../../../../fontes/interpretador/dialetos/interpretador-mapler-com-depuracao-importacao.ts"],"names":[],"mappings":";;;AACA,yEAAyE;AACzE,uJAAiJ;AAIjJ,MAAa,yCAA0C,SAAQ,oEAA+B;IAG1F,YACI,UAA6D,EAC7D,aAAqB,EACrB,eAAyB,EACzB,yBAAmC;QAEnC,KAAK,CAAC,aAAa,EAAE,eAAe,EAAE,yBAAyB,CAAC,CAAC;QACjE,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,yBAAyB,CAAC,UAAoB;QAChD,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAE/D,MAAM,kBAAkB,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;QAC5E,MAAM,oBAAoB,GAAG,MAAM,IAAI,CAAC,WAAW,CAC/C,kBAAkB,CAAC,yBAAyB,CAAC,WAAW,EACxD,IAAI,CACP,CAAC;QAEF,MAAM,gBAAgB,GAAG,IAAI,CAAC,oBAAoB,CAAC,uBAAuB,EAAE,CAAC;QAE7E,MAAM,UAAU,GAAG,IAAI,0BAAa,EAAE,CAAC;QAEvC,MAAM,sBAAsB,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC7D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,sBAAsB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACpD,UAAU,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC;SACnG;QAED,OAAO,UAAU,CAAC;IACtB,CAAC;CACJ;AAtCD,8FAsCC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Importar } from "@designliquido/delegua/fontes/declaracoes";
|
|
1
|
+
import { Declaracao, Importar } from "@designliquido/delegua/fontes/declaracoes";
|
|
2
2
|
import { DeleguaModulo } from "@designliquido/delegua/fontes/estruturas";
|
|
3
3
|
import { InterpretadorVisuAlgComDepuracao } from "@designliquido/delegua/fontes/interpretador/dialetos";
|
|
4
4
|
import { ImportadorInterface } from "../../interfaces";
|
|
5
|
+
import { SimboloInterface } from '@designliquido/delegua/fontes/interfaces';
|
|
5
6
|
export declare class InterpretadorVisuAlgComDepuracaoImportacao extends InterpretadorVisuAlgComDepuracao {
|
|
6
|
-
importador: ImportadorInterface
|
|
7
|
-
constructor(importador: ImportadorInterface, diretorioBase: string, funcaoDeRetorno: Function, funcaoDeRetornoMesmaLinha: Function);
|
|
7
|
+
importador: ImportadorInterface<SimboloInterface, Declaracao>;
|
|
8
|
+
constructor(importador: ImportadorInterface<SimboloInterface, Declaracao>, diretorioBase: string, funcaoDeRetorno: Function, funcaoDeRetornoMesmaLinha: Function);
|
|
8
9
|
/**
|
|
9
10
|
* Importa um arquivo como módulo.
|
|
10
11
|
* @param declaracao A declaração de importação.
|
|
@@ -55,7 +55,7 @@ class InterpretadorVisuAlgComDepuracaoImportacao extends dialetos_1.Interpretado
|
|
|
55
55
|
return null;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
const conteudoImportacao = this.importador.importar(caminhoRelativo, false
|
|
58
|
+
const conteudoImportacao = this.importador.importar(caminhoRelativo, false);
|
|
59
59
|
const retornoInterpretador = await this.interpretar(conteudoImportacao.retornoAvaliadorSintatico.declaracoes, true);
|
|
60
60
|
const funcoesChamaveis = this.pilhaEscoposExecucao.obterTodasDeleguaFuncao();
|
|
61
61
|
const declaracoesClasse = this.pilhaEscoposExecucao.obterTodasDeclaracaoClasse();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interpretador-visualg-com-depuracao-importacao.js","sourceRoot":"","sources":["../../../../fontes/interpretador/dialetos/interpretador-visualg-com-depuracao-importacao.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAgC;AAGhC,yEAAyE;AACzE,mFAAwG;AAGxG,2GAAyE;
|
|
1
|
+
{"version":3,"file":"interpretador-visualg-com-depuracao-importacao.js","sourceRoot":"","sources":["../../../../fontes/interpretador/dialetos/interpretador-visualg-com-depuracao-importacao.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAgC;AAGhC,yEAAyE;AACzE,mFAAwG;AAGxG,2GAAyE;AAGzE,MAAa,0CAA2C,SAAQ,2CAAgC;IAG5F,YACI,UAA6D,EAC7D,aAAqB,EACrB,eAAyB,EACzB,yBAAmC;QAEnC,KAAK,CAAC,aAAa,EAAE,eAAe,EAAE,yBAAyB,CAAC,CAAC;QACjE,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,yBAAyB,CAAC,UAAoB;QAChD,mBAAmB;QACnB,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC/D,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAA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AAC,CAAC;QAC/D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,uBAAuB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACrD,UAAU,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC;SACtG;QAED,OAAO,UAAU,CAAC;IACtB,CAAC;CACJ;AA7DD,gGA6DC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Importar } from "@designliquido/delegua/fontes/declaracoes";
|
|
1
|
+
import { Declaracao, Importar } from "@designliquido/delegua/fontes/declaracoes";
|
|
2
2
|
import { DeleguaModulo } from "@designliquido/delegua/fontes/estruturas";
|
|
3
3
|
import { InterpretadorComDepuracao } from "@designliquido/delegua/fontes/interpretador";
|
|
4
4
|
import { ImportadorInterface } from "../interfaces";
|
|
5
|
+
import { SimboloInterface } from '@designliquido/delegua/fontes/interfaces';
|
|
5
6
|
export declare class InterpretadorComDepuracaoImportacao extends InterpretadorComDepuracao {
|
|
6
|
-
importador: ImportadorInterface
|
|
7
|
-
constructor(importador: ImportadorInterface, diretorioBase: string, funcaoDeRetorno: Function, funcaoDeRetornoMesmaLinha: Function);
|
|
7
|
+
importador: ImportadorInterface<SimboloInterface, Declaracao>;
|
|
8
|
+
constructor(importador: ImportadorInterface<SimboloInterface, Declaracao>, diretorioBase: string, funcaoDeRetorno: Function, funcaoDeRetornoMesmaLinha: Function);
|
|
8
9
|
/**
|
|
9
10
|
* Importa um arquivo como módulo.
|
|
10
11
|
* @param declaracao A declaração de importação.
|
|
@@ -54,7 +54,7 @@ class InterpretadorComDepuracaoImportacao extends interpretador_1.InterpretadorC
|
|
|
54
54
|
return null;
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
const conteudoImportacao = this.importador.importar(caminhoRelativo, false
|
|
57
|
+
const conteudoImportacao = this.importador.importar(caminhoRelativo, false);
|
|
58
58
|
const retornoInterpretador = await this.interpretar(conteudoImportacao.retornoAvaliadorSintatico.declaracoes, true);
|
|
59
59
|
const funcoesChamaveis = this.pilhaEscoposExecucao.obterTodasDeleguaFuncao();
|
|
60
60
|
const declaracoesClasse = this.pilhaEscoposExecucao.obterTodasDeclaracaoClasse();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interpretador-com-depuracao-importacao.js","sourceRoot":"","sources":["../../../fontes/interpretador/interpretador-com-depuracao-importacao.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAgC;AAGhC,yEAAyE;AACzE,+EAAwF;AAGxF,0GAAwE;
|
|
1
|
+
{"version":3,"file":"interpretador-com-depuracao-importacao.js","sourceRoot":"","sources":["../../../fontes/interpretador/interpretador-com-depuracao-importacao.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAgC;AAGhC,yEAAyE;AACzE,+EAAwF;AAGxF,0GAAwE;AAGxE,MAAa,mCAAoC,SAAQ,yCAAyB;IAG9E,YACI,UAA6D,EAC7D,aAAqB,EACrB,eAAyB,EACzB,yBAAmC;QAEnC,KAAK,CAAC,aAAa,EAAE,eAAe,EAAE,yBAAyB,CAAC,CAAC;QACjE,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,yBAAyB,CAAC,UAAoB;QAChD,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC/D,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;QACvE,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QAEnD,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;YACpC,IAAI;gBACA,OAAO,MAAM,I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uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC;SACtG;QAED,OAAO,UAAU,CAAC;IACtB,CAAC;CACJ;AA5DD,kFA4DC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { Importar } from '@designliquido/delegua/fontes/declaracoes';
|
|
1
|
+
import { Declaracao, Importar } from '@designliquido/delegua/fontes/declaracoes';
|
|
2
2
|
import { DeleguaModulo } from '@designliquido/delegua/fontes/estruturas';
|
|
3
3
|
import { ImportadorInterface } from '../interfaces/importador-interface';
|
|
4
4
|
import { InterpretadorBase } from '@designliquido/delegua/fontes/interpretador/interpretador-base';
|
|
5
|
+
import { SimboloInterface } from '@designliquido/delegua/fontes/interfaces';
|
|
5
6
|
/**
|
|
6
7
|
* O Interpretador visita todos os elementos complexos gerados pelo avaliador sintático (_parser_),
|
|
7
8
|
* e de fato executa a lógica de programação descrita no código.
|
|
8
9
|
*/
|
|
9
10
|
export declare class Interpretador extends InterpretadorBase {
|
|
10
|
-
importador: ImportadorInterface
|
|
11
|
-
constructor(importador: ImportadorInterface, diretorioBase: string, performance?: boolean, funcaoDeRetorno?: Function, funcaoDeRetornoMesmaLinha?: Function);
|
|
11
|
+
importador: ImportadorInterface<SimboloInterface, Declaracao>;
|
|
12
|
+
constructor(importador: ImportadorInterface<SimboloInterface, Declaracao>, diretorioBase: string, performance?: boolean, funcaoDeRetorno?: Function, funcaoDeRetornoMesmaLinha?: Function);
|
|
12
13
|
/**
|
|
13
14
|
* Importa um arquivo como módulo.
|
|
14
15
|
* @param declaracao A declaração de importação.
|
|
@@ -58,7 +58,7 @@ class Interpretador extends interpretador_base_1.InterpretadorBase {
|
|
|
58
58
|
return null;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
const conteudoImportacao = this.importador.importar(caminhoRelativo, false
|
|
61
|
+
const conteudoImportacao = this.importador.importar(caminhoRelativo, false);
|
|
62
62
|
const retornoInterpretador = await this.interpretar(conteudoImportacao.retornoAvaliadorSintatico.declaracoes, true);
|
|
63
63
|
const funcoesChamaveis = this.pilhaEscoposExecucao.obterTodasDeleguaFuncao();
|
|
64
64
|
const declaracoesClasse = this.pilhaEscoposExecucao.obterTodasDeclaracaoClasse();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interpretador.js","sourceRoot":"","sources":["../../../fontes/interpretador/interpretador.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAgC;AAGhC,yEAAyE;AAGzE,uGAAmG;AAEnG,0GAAwE;
|
|
1
|
+
{"version":3,"file":"interpretador.js","sourceRoot":"","sources":["../../../fontes/interpretador/interpretador.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAgC;AAGhC,yEAAyE;AAGzE,uGAAmG;AAEnG,0GAAwE;AAIxE;;;GAGG;AACH,MAAa,aAAc,SAAQ,sCAAiB;IAGhD,YACI,UAA6D,EAC7D,aAAqB,EACrB,WAAW,GAAG,KAAK,EACnB,kBAA4B,IAAI,EAChC,4BAAsC,IAAI;QAE1C,KAAK,CAAC,aAAa,EAAE,WAAW,EAAE,eAAe,EAAE,yBAAyB,CAAC,CAAC;QAC9E,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,yBAAyB,CAAC,UAAoB;QAChD,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC/D,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;QACvE,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QAEnD,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;YACpC,IAAI;gBACA,OAAO,MAAM,IAAA,0CAAsB,EAAC,eAAe,CAAC,CAAC;aACxD;YAAC,O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AAO,UAAU,CAAC;IACtB,CAAC;CACJ;AA7DD,sCA6DC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SimboloInterface } from "@designliquido/delegua/fontes/interfaces";
|
|
2
|
+
import { RetornoImportador } from "./importador";
|
|
3
|
+
export declare abstract class NucleoComum {
|
|
4
|
+
/**
|
|
5
|
+
* Verifica erros nas etapas de lexação e avaliação sintática.
|
|
6
|
+
* @param retornoImportador Um objeto que implementa a interface RetornoImportador.
|
|
7
|
+
* @returns Verdadeiro se há erros. Falso caso contrário.
|
|
8
|
+
*/
|
|
9
|
+
protected afericaoErros(retornoImportador: RetornoImportador<any, any>): boolean;
|
|
10
|
+
protected reportar(linha: number, onde: any, mensagem: string): void;
|
|
11
|
+
protected erro(simbolo: SimboloInterface, mensagemDeErro: string): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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.NucleoComum = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const delegua_1 = __importDefault(require("@designliquido/delegua/fontes/tipos-de-simbolos/delegua"));
|
|
9
|
+
class NucleoComum {
|
|
10
|
+
/**
|
|
11
|
+
* Verifica erros nas etapas de lexação e avaliação sintática.
|
|
12
|
+
* @param retornoImportador Um objeto que implementa a interface RetornoImportador.
|
|
13
|
+
* @returns Verdadeiro se há erros. Falso caso contrário.
|
|
14
|
+
*/
|
|
15
|
+
afericaoErros(retornoImportador) {
|
|
16
|
+
if (retornoImportador.retornoLexador.erros.length > 0) {
|
|
17
|
+
for (const erroLexador of retornoImportador.retornoLexador.erros) {
|
|
18
|
+
this.reportar(erroLexador.linha, ` no '${erroLexador.caractere}'`, erroLexador.mensagem);
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
if (retornoImportador.retornoAvaliadorSintatico.erros.length > 0) {
|
|
23
|
+
for (const erroAvaliadorSintatico of retornoImportador.retornoAvaliadorSintatico.erros) {
|
|
24
|
+
this.erro(erroAvaliadorSintatico.simbolo, erroAvaliadorSintatico.message);
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
reportar(linha, onde, mensagem) {
|
|
31
|
+
/* if (this.nomeArquivo)
|
|
32
|
+
console.error(
|
|
33
|
+
chalk.red(`[Arquivo: ${this.nomeArquivo}] [Linha: ${linha}]`) + ` Erro${onde}: ${mensagem}`
|
|
34
|
+
);
|
|
35
|
+
else */
|
|
36
|
+
console.error(chalk_1.default.red(`[Linha: ${linha}]`) + ` Erro${onde}: ${mensagem}`);
|
|
37
|
+
}
|
|
38
|
+
erro(simbolo, mensagemDeErro) {
|
|
39
|
+
const _simbolo = simbolo || { tipo: delegua_1.default.EOF, linha: -1, lexema: '(indefinido)' };
|
|
40
|
+
if (_simbolo.tipo === delegua_1.default.EOF) {
|
|
41
|
+
this.reportar(Number(_simbolo.linha), ' no final do código', mensagemDeErro);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
this.reportar(Number(_simbolo.linha), ` no '${_simbolo.lexema}'`, mensagemDeErro);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.NucleoComum = NucleoComum;
|
|
49
|
+
//# sourceMappingURL=nucleo-comum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nucleo-comum.js","sourceRoot":"","sources":["../../fontes/nucleo-comum.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,sGAAsF;AAKtF,MAAsB,WAAW;IAC7B;;;;OAIG;IACO,aAAa,CAAC,iBAA8C;QAClE,IAAI,iBAAiB,CAAC,cAAc,CAAC,KA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C,MAAM,GAAG,EAAE,cAAc,CAAC,CAAC;SACrF;IACL,CAAC;CACJ;AAzCD,kCAyCC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { AvaliadorSintaticoInterface, InterpretadorInterface, LexadorInterface, RetornoExecucaoInterface } from "@designliquido/delegua/fontes/interfaces";
|
|
2
|
+
import { RetornoImportador } from "./importador";
|
|
3
|
+
import { ImportadorInterface } from "./interfaces";
|
|
4
|
+
import { ServidorDepuracao } from './depuracao';
|
|
5
|
+
import { NucleoExecucaoInterface } from './interfaces/nucleo-execucao-interface';
|
|
6
|
+
import { NucleoComum } from './nucleo-comum';
|
|
7
|
+
export declare class NucleoExecucao extends NucleoComum implements NucleoExecucaoInterface {
|
|
8
|
+
interpretador: InterpretadorInterface;
|
|
9
|
+
lexador: LexadorInterface<any>;
|
|
10
|
+
avaliadorSintatico: AvaliadorSintaticoInterface<any, any>;
|
|
11
|
+
importador: ImportadorInterface<any, any>;
|
|
12
|
+
servidorDepuracao: ServidorDepuracao;
|
|
13
|
+
dialeto: string;
|
|
14
|
+
modoDepuracao: boolean;
|
|
15
|
+
arquivosAbertos: {
|
|
16
|
+
[identificador: string]: string;
|
|
17
|
+
};
|
|
18
|
+
conteudoArquivosAbertos: {
|
|
19
|
+
[identificador: string]: string[];
|
|
20
|
+
};
|
|
21
|
+
dialetos: {
|
|
22
|
+
[identificador: string]: string;
|
|
23
|
+
};
|
|
24
|
+
funcaoDeRetorno: Function;
|
|
25
|
+
funcaoDeRetornoMesmaLinha: Function;
|
|
26
|
+
constructor(funcaoDeRetorno?: Function, funcaoDeRetornoMesmaLinha?: Function);
|
|
27
|
+
configurarDialeto(dialeto?: string, performance?: boolean, depurador?: boolean): void;
|
|
28
|
+
executarCodigoComoArgumento(codigo: string): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Execução por arquivo.
|
|
31
|
+
* @param caminhoRelativoArquivo O caminho no sistema operacional do arquivo a ser aberto.
|
|
32
|
+
*/
|
|
33
|
+
carregarEExecutarArquivo(caminhoRelativoArquivo: string): Promise<any>;
|
|
34
|
+
/**
|
|
35
|
+
* LAIR (Leia-Avalie-Imprima-Repita) é o modo em que Delégua executa em modo console,
|
|
36
|
+
* ou seja, esperando como entrada linhas de código fornecidas pelo usuário.
|
|
37
|
+
*/
|
|
38
|
+
iniciarLairDelegua(): void;
|
|
39
|
+
versao(): string;
|
|
40
|
+
/**
|
|
41
|
+
* A execução do código de fato.
|
|
42
|
+
* @param retornoImportador Dados retornados do Importador, como o retorno do Lexador, do Avaliador
|
|
43
|
+
* Sintático e respectivos erros.
|
|
44
|
+
* @param manterAmbiente Indicação se ambiente deve ser mantido ou não. Normalmente verdadeiro
|
|
45
|
+
* para LAIR, falso para execução por arquivo.
|
|
46
|
+
* @returns Um objeto com o resultado da execução.
|
|
47
|
+
*/
|
|
48
|
+
executar(retornoImportador: RetornoImportador<any, any>, manterAmbiente?: boolean): Promise<RetornoExecucaoInterface>;
|
|
49
|
+
/**
|
|
50
|
+
* Executa uma linha. Usado pelo modo LAIR e pelo servidor de depuração, quando recebe um comando 'avaliar'.
|
|
51
|
+
* @param linha A linha a ser avaliada.
|
|
52
|
+
* @returns O resultado da execução, com os retornos e respectivos erros, se houverem.
|
|
53
|
+
*/
|
|
54
|
+
executarUmaLinha(linha: string): Promise<RetornoExecucaoInterface>;
|
|
55
|
+
/**
|
|
56
|
+
* Instancia um servidor de depuração, normalmente recebendo requisições na porta 7777.
|
|
57
|
+
*/
|
|
58
|
+
iniciarDepuracao(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Pede ao servidor de depuração que finalize a execução.
|
|
61
|
+
* Se não for feito, o servidor de depuração mantém um _stream_ aberto e nunca finaliza.
|
|
62
|
+
* Mais informações: https://stackoverflow.com/a/47456805/1314276
|
|
63
|
+
*/
|
|
64
|
+
finalizarDepuracao(): void;
|
|
65
|
+
protected erroEmTempoDeExecucao(erro: any): void;
|
|
66
|
+
}
|