Skip to content

Commit

Permalink
- Atualização do núcleo de Delégua para a versão 0.25.13;
Browse files Browse the repository at this point in the history
- Alguma organização do projeto.
  • Loading branch information
leonelsanchesdasilva committed Oct 22, 2023
1 parent b3e440a commit 60e22fc
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 36 deletions.
64 changes: 40 additions & 24 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,6 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Lexador JSON",
"skipFiles": ["<node_internals>/**", "node_modules/**"],
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"args": [
"${workspaceFolder}${pathSeparator}teste-json.ts"
],
"runtimeExecutable": "node",
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"]
},
{
"type": "node",
"request": "launch",
Expand Down Expand Up @@ -466,15 +453,28 @@
{
"type": "node",
"request": "launch",
"name": "Portugol IPT > Olá mundo",
"name": "Lexador JSON",
"skipFiles": ["<node_internals>/**", "node_modules/**"],
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"args": [
"${workspaceFolder}${pathSeparator}teste-json.ts"
],
"runtimeExecutable": "node",
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"]
},
{
"type": "node",
"request": "launch",
"name": "Mapler > Olá Mundo",
"skipFiles": ["<node_internals>/**", "node_modules/**"],
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"args": [
"${workspaceFolder}${pathSeparator}execucao.ts",
"--dialeto",
"portugol-ipt",
"./exemplos/dialetos/portugol-ipt/ola-mundo.alg"
"mapler",
"./exemplos/dialetos/mapler/ola-mundo.mapler"
],
"runtimeExecutable": "node",
"runtimeArgs": [
Expand All @@ -486,15 +486,15 @@
{
"type": "node",
"request": "launch",
"name": "Portugol Studio > Número digitado",
"name": "Portugol IPT > Olá mundo",
"skipFiles": ["<node_internals>/**", "node_modules/**"],
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"args": [
"${workspaceFolder}${pathSeparator}execucao.ts",
"--dialeto",
"portugol-studio",
"./exemplos/dialetos/portugol-studio/numero-digitado.por"
"portugol-ipt",
"./exemplos/dialetos/portugol-ipt/ola-mundo.alg"
],
"runtimeExecutable": "node",
"runtimeArgs": [
Expand All @@ -506,15 +506,15 @@
{
"type": "node",
"request": "launch",
"name": "Portugol Studio > Olá mundo",
"name": "Portugol Studio > Número digitado",
"skipFiles": ["<node_internals>/**", "node_modules/**"],
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"args": [
"${workspaceFolder}${pathSeparator}execucao.ts",
"--dialeto",
"portugol-studio",
"./exemplos/dialetos/portugol-studio/ola-mundo.por"
"./exemplos/dialetos/portugol-studio/numero-digitado.por"
],
"runtimeExecutable": "node",
"runtimeArgs": [
Expand All @@ -526,15 +526,15 @@
{
"type": "node",
"request": "launch",
"name": "Mapler > Olá Mundo",
"name": "Portugol Studio > Olá mundo",
"skipFiles": ["<node_internals>/**", "node_modules/**"],
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"args": [
"${workspaceFolder}${pathSeparator}execucao.ts",
"--dialeto",
"mapler",
"./exemplos/dialetos/mapler/ola-mundo.mapler"
"portugol-studio",
"./exemplos/dialetos/portugol-studio/ola-mundo.por"
],
"runtimeExecutable": "node",
"runtimeArgs": [
Expand Down Expand Up @@ -676,6 +676,22 @@
"runtimeExecutable": "node",
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"]
},
{
"type": "node",
"request": "launch",
"name": "VisuAlg > Negativos",
"skipFiles": ["<node_internals>/**", "node_modules/**"],
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"args": [
"${workspaceFolder}${pathSeparator}execucao.ts",
"--dialeto",
"visualg",
"./exemplos/dialetos/visualg/negativos.alg"
],
"runtimeExecutable": "node",
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"]
},
{
"type": "node",
"request": "launch",
Expand Down
2 changes: 1 addition & 1 deletion execucao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Command } from 'commander';
const principal = async () => {
const analisadorArgumentos = new Command();
analisadorArgumentos;
let codigoOuNomeArquivo: string;
let codigoOuNomeArquivo: string | undefined = undefined;

analisadorArgumentos
.helpOption('-h, --ajuda', 'Exibe a ajuda para o comando.')
Expand Down
27 changes: 27 additions & 0 deletions exemplos/dialetos/visualg/negativos.alg
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
algoritmo "negativos"

var

n, i: inteiro
vet: vetor [0..9] de inteiro

inicio

escreval("Quantos numeros voce vai digitar? ")
leia(n)

para i de 0 ate n-1 faca
escreval("Digite um numero: ")
leia(vet[i])
fimpara

escreval(" ")
escreval("NUMEROS NEGATIVOS")

para i de 0 ate n-1 faca
se (vet[i] < 0) entao
escreval(vet[i])
fimse
fimpara

fimalgoritmo
10 changes: 5 additions & 5 deletions fontes/delegua.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ import { NucleoTraducao } from './nucleo-traducao';
* correspondente à operação solicitada e observar a execução.
*/
export class Delegua implements DeleguaInterface {
lexador: LexadorInterface<any>;
avaliadorSintatico: AvaliadorSintaticoInterface<any, any>;
importador: ImportadorInterface<any, any>;
lexador: LexadorInterface<any> | undefined;
avaliadorSintatico: AvaliadorSintaticoInterface<any, any> | undefined;
importador: ImportadorInterface<any, any> | undefined;

funcaoDeRetorno: Function;
funcaoDeRetornoMesmaLinha: Function;

constructor(
funcaoDeRetorno: Function = null,
funcaoDeRetornoMesmaLinha: Function = null
funcaoDeRetorno?: Function,
funcaoDeRetornoMesmaLinha?: Function
) {
this.funcaoDeRetorno = funcaoDeRetorno || console.log;
// `process.stdout.write.bind(process.stdout)` é necessário por causa de
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"testes:servidor-depuracao": "ts-node ./fontes/depuracao/servidor-depuracao.ts"
},
"dependencies": {
"@designliquido/delegua": "0.25.12",
"@designliquido/delegua": "0.25.13",
"chalk": "4.1.2",
"commander": "^9.4.1",
"json-colorizer": "^2.2.2",
Expand Down
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
"outDir": "dist",
"module": "CommonJS",
"target": "es2017",
"mapRoot": "dist",
"rootDir": ".",
"allowJs": true,
"strict": false,
"allowJs": false,
"sourceMap": true,
"declaration": true,
"esModuleInterop": true,
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,10 @@
resolved "https://registry.yarnpkg.com/@designliquido/delegua-tempo/-/delegua-tempo-0.0.1.tgz#964834d127354857cda1c388f5de9327735b6747"
integrity sha512-/O1/eXlTXPTWSZGZ862i6uHHKCW0cmP6KnOV29zK4d4hgn03QjcNDeFKVC9L9vz3OJ6pPY0d/S8ANJkgBnnoaQ==

"@designliquido/[email protected].12":
version "0.25.12"
resolved "https://registry.yarnpkg.com/@designliquido/delegua/-/delegua-0.25.12.tgz#cb76ac0ff7305f3438ea118b6d47cf64de1a5a7d"
integrity sha512-/pIPBJX+1cu9bSb88q8sHEs5TWUhVA6L/B//up4avgSc2tjmzhTR3sWKWg+hjTtrqTDgmhdsSzA2//arObJj3Q==
"@designliquido/[email protected].13":
version "0.25.13"
resolved "https://registry.yarnpkg.com/@designliquido/delegua/-/delegua-0.25.13.tgz#02cb5e371b08c0025f42833969a5e2fcb51b19b2"
integrity sha512-kKdZenbNODJ9iqiBhoXoxiSgSozh/mSK+uKIBGYpl7mR1T8sG/eqIBaik2qDtrOiBp6tngHKVArVZ4qVut/dzA==
dependencies:
antlr4ts "^0.5.0-alpha.4"
browser-process-hrtime "^1.0.0"
Expand Down

0 comments on commit 60e22fc

Please sign in to comment.