Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Construto de comentário #678

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions fontes/analisador-semantico/analisador-semantico-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
TipoDe,
Unario,
Vetor,
Comentario,
} from '../construtos';
import {
Declaracao,
Expand Down Expand Up @@ -54,7 +55,6 @@ import {
Retorna,
Sustar,
} from '../declaracoes';
import { DeleguaFuncao } from '../estruturas';
import { AnalisadorSemanticoInterface } from '../interfaces/analisador-semantico-interface';
import { RetornoAnalisadorSemantico } from '../interfaces/retornos/retorno-analisador-semantico';
import { ContinuarQuebra, RetornoQuebra, SustarQuebra } from '../quebras';
Expand All @@ -65,16 +65,9 @@ import { ContinuarQuebra, RetornoQuebra, SustarQuebra } from '../quebras';
* simplesmente passa por ele (`return Promise.resolve()`).
*/
export abstract class AnalisadorSemanticoBase implements AnalisadorSemanticoInterface {

abstract analisar(declaracoes: Declaracao[]): RetornoAnalisadorSemantico;

visitarDeclaracaoTendoComo(declaracao: TendoComo): Promise<any> {
return Promise.resolve();
}

visitarDeclaracaoInicioAlgoritmo(declaracao: InicioAlgoritmo): Promise<any> {
return Promise.resolve();
}

visitarDeclaracaoAleatorio(declaracao: Aleatorio): Promise<any> {
return Promise.resolve();
}
Expand All @@ -87,6 +80,10 @@ export abstract class AnalisadorSemanticoBase implements AnalisadorSemanticoInte
return Promise.resolve();
}

visitarDeclaracaoComentario(declaracao: Comentario): void | Promise<any> {
return Promise.resolve();
}

visitarDeclaracaoConst(declaracao: Const): Promise<any> {
return Promise.resolve();
}
Expand Down Expand Up @@ -127,6 +124,10 @@ export abstract class AnalisadorSemanticoBase implements AnalisadorSemanticoInte
return Promise.resolve();
}

visitarDeclaracaoInicioAlgoritmo(declaracao: InicioAlgoritmo): Promise<any> {
return Promise.resolve();
}

visitarDeclaracaoPara(declaracao: Para): Promise<any> {
return Promise.resolve();
}
Expand All @@ -139,6 +140,10 @@ export abstract class AnalisadorSemanticoBase implements AnalisadorSemanticoInte
return Promise.resolve();
}

visitarDeclaracaoTendoComo(declaracao: TendoComo): Promise<any> {
return Promise.resolve();
}

visitarDeclaracaoTente(declaracao: Tente): Promise<any> {
return Promise.resolve();
}
Expand Down
25 changes: 1 addition & 24 deletions fontes/analisador-semantico/analisador-semantico.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,31 @@ import {
Binario,
Chamada,
Construto,
ExpressaoRegular,
FimPara,
FormatacaoEscrita,
FuncaoConstruto,
Literal,
Logico,
Super,
TipoDe,
Tupla,
Variavel,
Vetor,
} from '../construtos';
import {
Aleatorio,
Bloco,
CabecalhoPrograma,
Classe,
Const,
ConstMultiplo,
Continua,
Declaracao,
Enquanto,
Escolha,
Escreva,
EscrevaMesmaLinha,
Expressao,
Falhar,
Fazer,
FuncaoDeclaracao,
Importar,
Leia,
LeiaMultiplo,
Para,
ParaCada,
Retorna,
Se,
Sustar,
Tente,
Var,
VarMultiplo,
} from '../declaracoes';
import { InicioAlgoritmo } from '../declaracoes/inicio-algoritmo';
import { SimboloInterface } from '../interfaces';
import { AnalisadorSemanticoInterface } from '../interfaces/analisador-semantico-interface';
import { DiagnosticoAnalisadorSemantico, DiagnosticoSeveridade } from '../interfaces/erros';
import { RetornoAnalisadorSemantico } from '../interfaces/retornos/retorno-analisador-semantico';
import { TipoDadosElementar } from '../tipo-dados-elementar';
import { ContinuarQuebra, RetornoQuebra, SustarQuebra } from '../quebras';
import { RetornoQuebra } from '../quebras';
import { AnalisadorSemanticoBase } from './analisador-semantico-base';
import { PilhaVariaveis } from './pilha-variaveis';

Expand Down
Loading
Loading