prettyprinter

This commit is contained in:
trochas
2025-04-02 15:04:39 +02:00
parent 52a5c00f74
commit 4da495479f
7 changed files with 349 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
// Generated from /home/tuanvu/Desktop/M1/S8/PDS/tp2-vsl-pds/src/main/antlr/VSLLexer.g by ANTLR 4.13.1
// Generated from c:/Users/Thibaut/Documents/Git/PDS/tp2-vsl-pds/src/main/antlr/VSLLexer.g by ANTLR 4.13.1
package TP2;

View File

@@ -1,4 +1,4 @@
// Generated from /home/tuanvu/Desktop/M1/S8/PDS/tp2-vsl-pds/src/main/antlr/VSLParser.g by ANTLR 4.13.1
// Generated from c:/Users/Thibaut/Documents/Git/PDS/tp2-vsl-pds/src/main/antlr/VSLParser.g by ANTLR 4.13.1
package TP2;
import TP2.asd.Program.*;

View File

@@ -0,0 +1,166 @@
// Generated from c:/Users/Thibaut/Documents/Git/PDS/tp2-vsl-pds/src/main/antlr/VSLParser.g by ANTLR 4.13.1
package TP2;
import TP2.asd.Program.*;
import TP2.asd.*;
import TP2.asd.Interface.*;
import TP2.asd.Eval.*;
import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.tree.ErrorNode;
import org.antlr.v4.runtime.tree.TerminalNode;
/**
* This class provides an empty implementation of {@link VSLParserListener},
* which can be extended to create a listener which only needs to handle a subset
* of the available methods.
*/
@SuppressWarnings("CheckReturnValue")
public class VSLParserBaseListener implements VSLParserListener {
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterProgram(VSLParser.ProgramContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitProgram(VSLParser.ProgramContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterFunction(VSLParser.FunctionContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitFunction(VSLParser.FunctionContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterPrototype(VSLParser.PrototypeContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitPrototype(VSLParser.PrototypeContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterList_instr(VSLParser.List_instrContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitList_instr(VSLParser.List_instrContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterInstruction(VSLParser.InstructionContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitInstruction(VSLParser.InstructionContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterExpression(VSLParser.ExpressionContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitExpression(VSLParser.ExpressionContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterTd_expression(VSLParser.Td_expressionContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitTd_expression(VSLParser.Td_expressionContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterLit(VSLParser.LitContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitLit(VSLParser.LitContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterIdent(VSLParser.IdentContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitIdent(VSLParser.IdentContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterType(VSLParser.TypeContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitType(VSLParser.TypeContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterEveryRule(ParserRuleContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitEveryRule(ParserRuleContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void visitTerminal(TerminalNode node) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void visitErrorNode(ErrorNode node) { }
}

View File

@@ -0,0 +1,116 @@
// Generated from c:/Users/Thibaut/Documents/Git/PDS/tp2-vsl-pds/src/main/antlr/VSLParser.g by ANTLR 4.13.1
package TP2;
import TP2.asd.Program.*;
import TP2.asd.*;
import TP2.asd.Interface.*;
import TP2.asd.Eval.*;
import org.antlr.v4.runtime.tree.ParseTreeListener;
/**
* This interface defines a complete listener for a parse tree produced by
* {@link VSLParser}.
*/
public interface VSLParserListener extends ParseTreeListener {
/**
* Enter a parse tree produced by {@link VSLParser#program}.
* @param ctx the parse tree
*/
void enterProgram(VSLParser.ProgramContext ctx);
/**
* Exit a parse tree produced by {@link VSLParser#program}.
* @param ctx the parse tree
*/
void exitProgram(VSLParser.ProgramContext ctx);
/**
* Enter a parse tree produced by {@link VSLParser#function}.
* @param ctx the parse tree
*/
void enterFunction(VSLParser.FunctionContext ctx);
/**
* Exit a parse tree produced by {@link VSLParser#function}.
* @param ctx the parse tree
*/
void exitFunction(VSLParser.FunctionContext ctx);
/**
* Enter a parse tree produced by {@link VSLParser#prototype}.
* @param ctx the parse tree
*/
void enterPrototype(VSLParser.PrototypeContext ctx);
/**
* Exit a parse tree produced by {@link VSLParser#prototype}.
* @param ctx the parse tree
*/
void exitPrototype(VSLParser.PrototypeContext ctx);
/**
* Enter a parse tree produced by {@link VSLParser#list_instr}.
* @param ctx the parse tree
*/
void enterList_instr(VSLParser.List_instrContext ctx);
/**
* Exit a parse tree produced by {@link VSLParser#list_instr}.
* @param ctx the parse tree
*/
void exitList_instr(VSLParser.List_instrContext ctx);
/**
* Enter a parse tree produced by {@link VSLParser#instruction}.
* @param ctx the parse tree
*/
void enterInstruction(VSLParser.InstructionContext ctx);
/**
* Exit a parse tree produced by {@link VSLParser#instruction}.
* @param ctx the parse tree
*/
void exitInstruction(VSLParser.InstructionContext ctx);
/**
* Enter a parse tree produced by {@link VSLParser#expression}.
* @param ctx the parse tree
*/
void enterExpression(VSLParser.ExpressionContext ctx);
/**
* Exit a parse tree produced by {@link VSLParser#expression}.
* @param ctx the parse tree
*/
void exitExpression(VSLParser.ExpressionContext ctx);
/**
* Enter a parse tree produced by {@link VSLParser#td_expression}.
* @param ctx the parse tree
*/
void enterTd_expression(VSLParser.Td_expressionContext ctx);
/**
* Exit a parse tree produced by {@link VSLParser#td_expression}.
* @param ctx the parse tree
*/
void exitTd_expression(VSLParser.Td_expressionContext ctx);
/**
* Enter a parse tree produced by {@link VSLParser#lit}.
* @param ctx the parse tree
*/
void enterLit(VSLParser.LitContext ctx);
/**
* Exit a parse tree produced by {@link VSLParser#lit}.
* @param ctx the parse tree
*/
void exitLit(VSLParser.LitContext ctx);
/**
* Enter a parse tree produced by {@link VSLParser#ident}.
* @param ctx the parse tree
*/
void enterIdent(VSLParser.IdentContext ctx);
/**
* Exit a parse tree produced by {@link VSLParser#ident}.
* @param ctx the parse tree
*/
void exitIdent(VSLParser.IdentContext ctx);
/**
* Enter a parse tree produced by {@link VSLParser#type}.
* @param ctx the parse tree
*/
void enterType(VSLParser.TypeContext ctx);
/**
* Exit a parse tree produced by {@link VSLParser#type}.
* @param ctx the parse tree
*/
void exitType(VSLParser.TypeContext ctx);
}