pretty printer mais en mieu

This commit is contained in:
trochas
2025-02-07 16:10:10 +01:00
parent 35eff0771e
commit 99ebde8b04

View File

@@ -9,12 +9,29 @@ public class ASD_Turtle implements TurtleASD {
sealed interface Complement{}
sealed interface Entity{}
record TurtleImp(List<PhraseImp> phrases) implements Turtle{}
record TurtleImp(List<PhraseImp> phrases) implements Turtle{
public String toString(){
String str = "";
for (PhraseImp phrase : this.phrases) {
str+= phrase.toString();
}
return str;
}
}
record PhraseImp(EntityImp entity, List<AffectationImp> affs) implements Phrase{}
record AffectationImp(EntityImp entity, List<Complement> complements) implements Affectation{}
record Complement_EntityImp(EntityImp entity) implements Complement{}
record Complement_TextImp(String string) implements Complement{}
record EntityImp(String string) implements Entity{}
record Complement_TextImp(String string) implements Complement{
public String toString(){
return " \" " + this.string + " \"";
}
}
record EntityImp(String string) implements Entity{
public String toString(){
return this.string;
}
}
public void prettyPrinter(TurtleImp t){
for (PhraseImp phrase : t.phrases) {