This commit is contained in:
tuvu
2025-02-11 13:25:08 +01:00
parent b087f2ddbe
commit b2fe10ea8b
4 changed files with 15 additions and 11 deletions

View File

@@ -1,10 +1,16 @@
# TP1 PDS - Traducteur RDF/Turtle vers RDF/Ntriples
Ce projet VSCode contient tout le nécessaire pour commencer à programmer le traducteur.
Réalisé par Thibaut ROCHAS et Tuan Minh VU
Vous pouvez forker ce dépôt, mais devez impérativement garder votre dépôt privé.
Ce fichier `README.md` doit être complété au fur et à mesure de votre avancement.
## Implémentation du ASD
```
turtle ::= Turtle(phrase*)
phrase ::= Phrase(entity, aff*)
aff ::= Aff(entity, complement*)
complement ::= Complement(Entity)
| Complement_Text(String)
entity ::= Entity(String)
```
## Compatibilité

View File

@@ -13,7 +13,6 @@ options {
}
// Whitespaces are ignored.
fragment WS: (' ' | '\n' | '\t' | '\r' | '\u000C');
WSS: WS+ { skip(); };

View File

@@ -13,7 +13,7 @@ public class ASD_Turtle implements TurtleASD {
public String toString(){
String str = "";
for (PhraseImp phrase : this.phrases) {
str+= phrase.toString();
str = str.concat(phrase.toString());
}
return str;
}
@@ -22,7 +22,7 @@ public class ASD_Turtle implements TurtleASD {
public String toString(){
String str = "<" + this.entity.toString() + ">\n";
for (int i =0; i < this.affs.size(); i++ ){
str += affs.get(i).toString();
str =str.concat(affs.get(i).toString()) ;
if (i < this.affs.size() - 1) {
str += ";\n";
}
@@ -33,9 +33,9 @@ public class ASD_Turtle implements TurtleASD {
}
record AffectationImp(EntityImp entity, List<Complement> complements) implements Affectation{
public String toString(){
String str= "<" + this.entity.toString() + ">";
String str= "\t<" + this.entity.toString() + ">";
for (int i =0; i < this.complements.size(); i++) {
str += (this.complements.get(i));
str = str.concat(this.complements.get(i).toString());
if (i < this.complements.size() - 1) {
str += ",";
}

View File

@@ -16,6 +16,7 @@ public class Main {
/**
* Buils example AST and illustrates the translator.
*
LC : '<'
;
RC : '>'
@@ -46,11 +47,9 @@ public class Main {
morec : V comp
|
;
*/
public static void manualAST() {
//Ridoux <type> <personne>, <professeur>;
//System.out.println("Ridoux <type> <personne>, <professeur>;");
EntityImp Ridoux = new EntityImp("Ridoux");
EntityImp type = new EntityImp("type");
EntityImp personne = new EntityImp("personne");