update ads to ntriples

This commit is contained in:
tuvu
2025-02-12 16:27:04 +01:00
parent e110d3fa86
commit 8faeb45832
4 changed files with 51 additions and 38 deletions

View File

@@ -17,8 +17,8 @@ complement ::= Complement(String)
turtle ::= Turtle(phrase*)
phrase ::= Phrase(entity, aff*)
aff ::= Aff(entity, complement*)
phrase ::= Phrase(String, aff*)
aff ::= Aff(String, complement*)
complement ::= Complement(Entity)
| Complement_Text(String)
entity ::= Entity(String)

View File

@@ -37,7 +37,18 @@ complement ent String H
entity val String S
|TAD |Nom d'attribut |Type | Polarité
|----------------|-----------------|---------------------|---------|
|turtle |val |list(Phrase) |S
|phrase |sujet_p |String |H
|phrase |affs |list(Aff) |S
|aff |sujet_a |String |H
|aff |vebre_a |String |H
|aff |comps |list(comp) |S
|complement |sujet_c |String |H
|complement |verbe_c |String |H
|complement |comp_c |String |H/S
|Entity |val |String |S
```

View File

@@ -8,10 +8,44 @@ options {
package TP1;
}
@members {
@members {
}
LC : '<'
;
RC : '>'
;
P: '.'
;
V: ','
;
SEMI: ';'
;
G: '"'
;
prog : bloc EOF
;
bloc : sujet listvc P
;
sujet : LC entity RC
;
listvc : LC vc RC more
;
more : SEMI listvc
|
;
vc : LC verbe RC listc
;
listc : LC comp RC morec
;
morec : V comp
|
;
entity : ID
;
verbe : ID
;
comp : ID
;
// Whitespaces are ignored.
fragment WS: (' ' | '\n' | '\t' | '\r' | '\u000C');

View File

@@ -15,38 +15,6 @@ import TP1.ASD_Turtle.*;
public class Main {
/**
* Buils example AST and illustrates the translator.
*
LC : '<'
;
RC : '>'
;
P: '.'
;
V: ','
;
SEMI: ';'
;
G: '"'
;
prog : bloc EOF
;
bloc : sujet listvc P
;
sujet : LC entity RC
;
listvc : LC vc RC more
;
more : SEMI listvc
|
;
vc : LC verbe RC listc
;
listc : LC comp RC morec
;
morec : V comp
|
;
*/
public static void manualAST() {
//Ridoux <type> <personne>, <professeur>;