FEAT: toujours meilleur

This commit is contained in:
Guillotin Damien 2022-01-18 12:08:49 +01:00
parent 4023fa8a2b
commit 8d09b1d362
22 changed files with 409 additions and 346 deletions

View file

@ -65,13 +65,6 @@ def : getNombreInit() : Integer =
->asSequence() ->asSequence()
->iterate(o; res : Integer = self.tailleInventaire | res - o.getNombreInit() * o.taille); ->iterate(o; res : Integer = self.tailleInventaire | res - o.getNombreInit() * o.taille);
-- Obtenir la place d'un chemin (in / out)
helper context game!Chemin
def: getPlaceOf(s : String): petrinet!Place =
petrinet!Place.allInstances()
->select(p | p.name = s)
->asSequence()
->first();
helper context game!Lieu helper context game!Lieu
def: getPlace(): petrinet!Place = def: getPlace(): petrinet!Place =
@ -194,7 +187,7 @@ rule Chemin2PetriNet {
index <- 0; index <- 0;
for (condVis in c.visible.condition) { for (condVis in c.visible.condition) {
for (condOuv in c.ouvert.condition) { for (condOuv in c.ouvert.condition) {
thisModule.newChemin(c, index, condVis.union(condOuv)); thisModule.newChemin(c, index, condVis.conditionTest.union(condOuv.conditionTest));
index <- index + 1; index <- index + 1;
} }
} }
@ -208,13 +201,13 @@ rule newChemin(c : game!Chemin, index : Integer, conditions : game!ConditionTest
network <- ''.getJeu()), network <- ''.getJeu()),
arcIn: petrinet!Arc( arcIn: petrinet!Arc(
place <- c.getPlaceOf('lieu_' + c.lieuIn.name), place <- ('lieu_' + c.lieuIn.name).getPlace(),
transition <- t, transition <- t,
outgoing <- false, outgoing <- false,
weight <- 1), weight <- 1),
arcOut: petrinet!Arc( arcOut: petrinet!Arc(
place <- c.getPlaceOf('lieu_' + c.lieuOut.name), place <- ('lieu_' + c.lieuOut.name).getPlace(),
transition <- t, transition <- t,
outgoing <- true, outgoing <- true,
weight <- 1) weight <- 1)
@ -237,19 +230,29 @@ rule Interaction2PetriNet {
using { using {
index : Integer = 0; index : Integer = 0;
} }
do {
index <- 0;
for (condVis in i.getPersonne().visible.condition) {
thisModule.newInteraction(i, index, condVis.conditionTest);
index <- index + 1;
}
}
}
rule newInteraction(i : game!Interaction, index : Integer, conditions : game!ConditionTest) {
to to
t: petrinet!Transition( t: petrinet!Transition(
name <- 'interaction_' + i.name + '_' + i.getPersonne().name, name <- 'interaction_' + i.name + '_' + i.getPersonne().name + '_' + index.toString(),
network <- ''.getJeu()), network <- ''.getJeu()),
arcOut: petrinet!Arc( arcIn: petrinet!Arc(
place <- i.getPersonne(), place <- ('personne_' + i.getPersonne().name).getPlace(),
transition <- t, transition <- t,
outgoing <- true, outgoing <- true,
weight <- 1), weight <- 1),
arcIn: petrinet!Arc( arcOut: petrinet!Arc(
place <- i.getPersonne().getLieu().getPlace(), place <- ('lieu_' + i.getPersonne().getLieu().name).getPlace(),
transition <- t, transition <- t,
outgoing <- false, outgoing <- false,
weight <- 1) weight <- 1)
@ -260,38 +263,36 @@ rule Interaction2PetriNet {
for (o in i.objetsRecus) { for (o in i.objetsRecus) {
thisModule.recuObjet(t, o.name); thisModule.recuObjet(t, o.name);
} }
for (c in i.connaissances) { for (con in i.connaissances) {
thisModule.recuConn(t, c.name); thisModule.recuConn(t, con.name);
}
index <- 0;
for (condV in i.getPersonne().visible.condition) {
thisModule.Condition2PetriNet(('interaction_' + i.name + '_' + i.getPersonne().name).getTransition(), condV);
index <- index + 1;
} }
thisModule.Condition2PetriNet(t, conditions);
} }
} }
rule Condition2PetriNet(t : petrinet!Transition, c : game!Condition) { rule Condition2PetriNet(t : petrinet!Transition, c : game!Condition) {
do { do {
for (cond in c) { for (cond in c) {
if (cond.oclIsKindOf(game!ConditionObjet)) { if (cond.oclIsKindOf(game!ConditionObjet)) {
if (cond.comparateur = '==') { if (cond.comparateur = '==') {
thisModule.readObjetEga(t, cond.objet, cond.nombre); thisModule.readObjetEga(t, cond.objet.name, cond.nombre);
} else if (cond.comparateur = '>') { } else if (cond.comparateur = '>') {
thisModule.readObjetSup(t, cond.objet, cond.nombre); thisModule.readObjetSup(t, cond.objet.name, cond.nombre);
} else if (cond.comparateur = '>=') { } else if (cond.comparateur = '>=') {
thisModule.readObjetSup(t, cond.objet, cond.nombre - 1); thisModule.readObjetSup(t, cond.objet.name, cond.nombre - 1);
} else if (cond.comparateur = '<') { } else if (cond.comparateur = '<') {
thisModule.readObjetInf(t, cond.objet, cond.nombre); thisModule.readObjetInf(t, cond.objet.name, cond.nombre);
} else if (cond.comparateur = '<=') { } else if (cond.comparateur = '<=') {
thisModule.readObjetInf(t, cond.objet, cond.nombre + 1); thisModule.readObjetInf(t, cond.objet.name, cond.nombre + 1);
} }
} else { } else if (cond.oclIsKindOf(game!ConditionConnaissance)) {
if (cond.negation = '!') { if (cond.negation = '!') {
thisModule.readConnNeg(t, cond.connaissance); thisModule.readConnNeg(t, cond.connaissance.name);
} else { } else {
thisModule.readConn(t, cond.connaissance); thisModule.readConn(t, cond.connaissance.name);
} }
} else {
} }
} }
} }
@ -299,6 +300,19 @@ rule Condition2PetriNet(t : petrinet!Transition, c : game!Condition) {
rule Action2PetriNet { rule Action2PetriNet {
from a: game!Action from a: game!Action
using {
index : Integer = 0;
}
do {
index <- 0;
for (condVis in a.visible.condition) {
thisModule.newAction(a, index, condVis.conditionTest);
index <- index + 1;
}
}
}
rule newAction(a : game!Action, index : Integer, conditions : game!ConditionTest) {
to to
t: petrinet!Transition( t: petrinet!Transition(
name <- 'action_' + a.name, name <- 'action_' + a.name,

View file

@ -0,0 +1,15 @@
net jeu
pl taille (0)
pl objet_tentative (3)
pl objet_tentative_neg (0)
pl connaissance_Reussite (0)
pl connaissance_Reussite_neg (1)
pl personne_Sphinx (0)
pl lieu_Enigme (1)
pl lieu_Succes (0)
pl lieu_Echec (0)
tr chemin_Win lieu_Enigme*1 connaissance_Reussite*1 -> lieu_Succes*1 connaissance_Reussite*1
tr chemin_Loose lieu_Enigme*1 objet_tentative*0 objet_tentative_neg*3 -> lieu_Echec*1 objet_tentative*0 objet_tentative_neg*3
tr interaction_Parler_Sphinx lieu_Enigme*1 connaissance_Reussite_neg*1 objet_tentative*1 -> personne_Sphinx*1 connaissance_Reussite_neg*1 objet_tentative*1
tr action_Reponse_1 personne_Sphinx*1 connaissance_Reussite_neg*1 -> lieu_Enigme*1 connaissance_Reussite*1
tr action_Reponse_2 personne_Sphinx*1 objet_tentative*1 -> lieu_Enigme*1 objet_tentative_neg*1 taille*1

View file

@ -8,8 +8,8 @@ pl personne_Sphinx (0)
pl lieu_Enigme (1) pl lieu_Enigme (1)
pl lieu_Succes (0) pl lieu_Succes (0)
pl lieu_Echec (0) pl lieu_Echec (0)
tr chemin_Win lieu_Enigme*1 connaissance_Reussite*1 -> lieu_Succes*1 connaissance_Reussite*1 tr chemin_Win_0 lieu_Enigme*1 connaissance_Reussite*1 -> lieu_Succes*1 connaissance_Reussite*1
tr chemin_Loose lieu_Enigme*1 objet_tentative*0 objet_tentative_neg*3 -> lieu_Echec*1 objet_tentative*0 objet_tentative_neg*3 tr chemin_Loose_0 lieu_Enigme*1 objet_tentative*0 objet_tentative_neg*3 -> lieu_Echec*1 objet_tentative*0 objet_tentative_neg*3
tr interaction_Parler_Sphinx lieu_Enigme*1 connaissance_Reussite_neg*1 objet_tentative*1 -> personne_Sphinx*1 connaissance_Reussite_neg*1 objet_tentative*1 tr interaction_Parler_Sphinx_0 lieu_Enigme*1 connaissance_Reussite_neg*1 objet_tentative*1 -> personne_Sphinx*1 connaissance_Reussite_neg*1 objet_tentative*1
tr action_Reponse_1 personne_Sphinx*1 connaissance_Reussite_neg*1 -> lieu_Enigme*1 connaissance_Reussite*1 tr action_Reponse_1 personne_Sphinx*1 connaissance_Reussite_neg*1 -> lieu_Enigme*1 connaissance_Reussite*1
tr action_Reponse_2 personne_Sphinx*1 objet_tentative*1 -> lieu_Enigme*1 objet_tentative_neg*1 taille*1 tr action_Reponse_2 personne_Sphinx*1 objet_tentative*1 -> lieu_Enigme*1 objet_tentative_neg*1 taille*1

View file

@ -8208,9 +8208,13 @@ rule__ConditionConnaissance__ConnaissanceAssignment_1
} }
: :
( (
{ before(grammarAccess.getConditionConnaissanceAccess().getConnaissanceIDTerminalRuleCall_1_0()); } { before(grammarAccess.getConditionConnaissanceAccess().getConnaissanceConnaissanceCrossReference_1_0()); }
(
{ before(grammarAccess.getConditionConnaissanceAccess().getConnaissanceConnaissanceIDTerminalRuleCall_1_0_1()); }
RULE_ID RULE_ID
{ after(grammarAccess.getConditionConnaissanceAccess().getConnaissanceIDTerminalRuleCall_1_0()); } { after(grammarAccess.getConditionConnaissanceAccess().getConnaissanceConnaissanceIDTerminalRuleCall_1_0_1()); }
)
{ after(grammarAccess.getConditionConnaissanceAccess().getConnaissanceConnaissanceCrossReference_1_0()); }
) )
; ;
finally { finally {
@ -8223,9 +8227,13 @@ rule__ConditionObjet__ObjetAssignment_0
} }
: :
( (
{ before(grammarAccess.getConditionObjetAccess().getObjetIDTerminalRuleCall_0_0()); } { before(grammarAccess.getConditionObjetAccess().getObjetObjetCrossReference_0_0()); }
(
{ before(grammarAccess.getConditionObjetAccess().getObjetObjetIDTerminalRuleCall_0_0_1()); }
RULE_ID RULE_ID
{ after(grammarAccess.getConditionObjetAccess().getObjetIDTerminalRuleCall_0_0()); } { after(grammarAccess.getConditionObjetAccess().getObjetObjetIDTerminalRuleCall_0_0_1()); }
)
{ after(grammarAccess.getConditionObjetAccess().getObjetObjetCrossReference_0_0()); }
) )
; ;
finally { finally {

View file

@ -808,10 +808,10 @@ public class InternalGameLexer extends Lexer {
try { try {
int _type = RULE_COMPARATEUR; int _type = RULE_COMPARATEUR;
int _channel = DEFAULT_TOKEN_CHANNEL; int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalGame.g:8265:18: ( ( '<' | '>' | '==' | '<=' | '>=' | '!=' ) ) // InternalGame.g:8273:18: ( ( '<' | '>' | '==' | '<=' | '>=' | '!=' ) )
// InternalGame.g:8265:20: ( '<' | '>' | '==' | '<=' | '>=' | '!=' ) // InternalGame.g:8273:20: ( '<' | '>' | '==' | '<=' | '>=' | '!=' )
{ {
// InternalGame.g:8265:20: ( '<' | '>' | '==' | '<=' | '>=' | '!=' ) // InternalGame.g:8273:20: ( '<' | '>' | '==' | '<=' | '>=' | '!=' )
int alt1=6; int alt1=6;
switch ( input.LA(1) ) { switch ( input.LA(1) ) {
case '<': case '<':
@ -855,21 +855,21 @@ public class InternalGameLexer extends Lexer {
switch (alt1) { switch (alt1) {
case 1 : case 1 :
// InternalGame.g:8265:21: '<' // InternalGame.g:8273:21: '<'
{ {
match('<'); match('<');
} }
break; break;
case 2 : case 2 :
// InternalGame.g:8265:25: '>' // InternalGame.g:8273:25: '>'
{ {
match('>'); match('>');
} }
break; break;
case 3 : case 3 :
// InternalGame.g:8265:29: '==' // InternalGame.g:8273:29: '=='
{ {
match("=="); match("==");
@ -877,7 +877,7 @@ public class InternalGameLexer extends Lexer {
} }
break; break;
case 4 : case 4 :
// InternalGame.g:8265:34: '<=' // InternalGame.g:8273:34: '<='
{ {
match("<="); match("<=");
@ -885,7 +885,7 @@ public class InternalGameLexer extends Lexer {
} }
break; break;
case 5 : case 5 :
// InternalGame.g:8265:39: '>=' // InternalGame.g:8273:39: '>='
{ {
match(">="); match(">=");
@ -893,7 +893,7 @@ public class InternalGameLexer extends Lexer {
} }
break; break;
case 6 : case 6 :
// InternalGame.g:8265:44: '!=' // InternalGame.g:8273:44: '!='
{ {
match("!="); match("!=");
@ -919,10 +919,10 @@ public class InternalGameLexer extends Lexer {
try { try {
int _type = RULE_BOOLEAN; int _type = RULE_BOOLEAN;
int _channel = DEFAULT_TOKEN_CHANNEL; int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalGame.g:8267:14: ( ( 'true' | 'false' ) ) // InternalGame.g:8275:14: ( ( 'true' | 'false' ) )
// InternalGame.g:8267:16: ( 'true' | 'false' ) // InternalGame.g:8275:16: ( 'true' | 'false' )
{ {
// InternalGame.g:8267:16: ( 'true' | 'false' ) // InternalGame.g:8275:16: ( 'true' | 'false' )
int alt2=2; int alt2=2;
int LA2_0 = input.LA(1); int LA2_0 = input.LA(1);
@ -940,7 +940,7 @@ public class InternalGameLexer extends Lexer {
} }
switch (alt2) { switch (alt2) {
case 1 : case 1 :
// InternalGame.g:8267:17: 'true' // InternalGame.g:8275:17: 'true'
{ {
match("true"); match("true");
@ -948,7 +948,7 @@ public class InternalGameLexer extends Lexer {
} }
break; break;
case 2 : case 2 :
// InternalGame.g:8267:24: 'false' // InternalGame.g:8275:24: 'false'
{ {
match("false"); match("false");
@ -974,10 +974,10 @@ public class InternalGameLexer extends Lexer {
try { try {
int _type = RULE_ID; int _type = RULE_ID;
int _channel = DEFAULT_TOKEN_CHANNEL; int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalGame.g:8269:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) // InternalGame.g:8277:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
// InternalGame.g:8269:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* // InternalGame.g:8277:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
{ {
// InternalGame.g:8269:11: ( '^' )? // InternalGame.g:8277:11: ( '^' )?
int alt3=2; int alt3=2;
int LA3_0 = input.LA(1); int LA3_0 = input.LA(1);
@ -986,7 +986,7 @@ public class InternalGameLexer extends Lexer {
} }
switch (alt3) { switch (alt3) {
case 1 : case 1 :
// InternalGame.g:8269:11: '^' // InternalGame.g:8277:11: '^'
{ {
match('^'); match('^');
@ -1004,7 +1004,7 @@ public class InternalGameLexer extends Lexer {
recover(mse); recover(mse);
throw mse;} throw mse;}
// InternalGame.g:8269:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* // InternalGame.g:8277:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
loop4: loop4:
do { do {
int alt4=2; int alt4=2;
@ -1053,10 +1053,10 @@ public class InternalGameLexer extends Lexer {
try { try {
int _type = RULE_INT; int _type = RULE_INT;
int _channel = DEFAULT_TOKEN_CHANNEL; int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalGame.g:8271:10: ( ( '0' .. '9' )+ ) // InternalGame.g:8279:10: ( ( '0' .. '9' )+ )
// InternalGame.g:8271:12: ( '0' .. '9' )+ // InternalGame.g:8279:12: ( '0' .. '9' )+
{ {
// InternalGame.g:8271:12: ( '0' .. '9' )+ // InternalGame.g:8279:12: ( '0' .. '9' )+
int cnt5=0; int cnt5=0;
loop5: loop5:
do { do {
@ -1070,7 +1070,7 @@ public class InternalGameLexer extends Lexer {
switch (alt5) { switch (alt5) {
case 1 : case 1 :
// InternalGame.g:8271:13: '0' .. '9' // InternalGame.g:8279:13: '0' .. '9'
{ {
matchRange('0','9'); matchRange('0','9');
@ -1102,10 +1102,10 @@ public class InternalGameLexer extends Lexer {
try { try {
int _type = RULE_STRING; int _type = RULE_STRING;
int _channel = DEFAULT_TOKEN_CHANNEL; int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalGame.g:8273:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) ) // InternalGame.g:8281:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) )
// InternalGame.g:8273:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) // InternalGame.g:8281:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
{ {
// InternalGame.g:8273:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) // InternalGame.g:8281:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
int alt8=2; int alt8=2;
int LA8_0 = input.LA(1); int LA8_0 = input.LA(1);
@ -1123,10 +1123,10 @@ public class InternalGameLexer extends Lexer {
} }
switch (alt8) { switch (alt8) {
case 1 : case 1 :
// InternalGame.g:8273:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' // InternalGame.g:8281:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"'
{ {
match('\"'); match('\"');
// InternalGame.g:8273:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* // InternalGame.g:8281:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )*
loop6: loop6:
do { do {
int alt6=3; int alt6=3;
@ -1142,7 +1142,7 @@ public class InternalGameLexer extends Lexer {
switch (alt6) { switch (alt6) {
case 1 : case 1 :
// InternalGame.g:8273:21: '\\\\' . // InternalGame.g:8281:21: '\\\\' .
{ {
match('\\'); match('\\');
matchAny(); matchAny();
@ -1150,7 +1150,7 @@ public class InternalGameLexer extends Lexer {
} }
break; break;
case 2 : case 2 :
// InternalGame.g:8273:28: ~ ( ( '\\\\' | '\"' ) ) // InternalGame.g:8281:28: ~ ( ( '\\\\' | '\"' ) )
{ {
if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
input.consume(); input.consume();
@ -1175,10 +1175,10 @@ public class InternalGameLexer extends Lexer {
} }
break; break;
case 2 : case 2 :
// InternalGame.g:8273:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' // InternalGame.g:8281:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
{ {
match('\''); match('\'');
// InternalGame.g:8273:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* // InternalGame.g:8281:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )*
loop7: loop7:
do { do {
int alt7=3; int alt7=3;
@ -1194,7 +1194,7 @@ public class InternalGameLexer extends Lexer {
switch (alt7) { switch (alt7) {
case 1 : case 1 :
// InternalGame.g:8273:54: '\\\\' . // InternalGame.g:8281:54: '\\\\' .
{ {
match('\\'); match('\\');
matchAny(); matchAny();
@ -1202,7 +1202,7 @@ public class InternalGameLexer extends Lexer {
} }
break; break;
case 2 : case 2 :
// InternalGame.g:8273:61: ~ ( ( '\\\\' | '\\'' ) ) // InternalGame.g:8281:61: ~ ( ( '\\\\' | '\\'' ) )
{ {
if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
input.consume(); input.consume();
@ -1245,12 +1245,12 @@ public class InternalGameLexer extends Lexer {
try { try {
int _type = RULE_ML_COMMENT; int _type = RULE_ML_COMMENT;
int _channel = DEFAULT_TOKEN_CHANNEL; int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalGame.g:8275:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) // InternalGame.g:8283:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
// InternalGame.g:8275:19: '/*' ( options {greedy=false; } : . )* '*/' // InternalGame.g:8283:19: '/*' ( options {greedy=false; } : . )* '*/'
{ {
match("/*"); match("/*");
// InternalGame.g:8275:24: ( options {greedy=false; } : . )* // InternalGame.g:8283:24: ( options {greedy=false; } : . )*
loop9: loop9:
do { do {
int alt9=2; int alt9=2;
@ -1275,7 +1275,7 @@ public class InternalGameLexer extends Lexer {
switch (alt9) { switch (alt9) {
case 1 : case 1 :
// InternalGame.g:8275:52: . // InternalGame.g:8283:52: .
{ {
matchAny(); matchAny();
@ -1305,12 +1305,12 @@ public class InternalGameLexer extends Lexer {
try { try {
int _type = RULE_SL_COMMENT; int _type = RULE_SL_COMMENT;
int _channel = DEFAULT_TOKEN_CHANNEL; int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalGame.g:8277:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) // InternalGame.g:8285:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
// InternalGame.g:8277:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? // InternalGame.g:8285:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
{ {
match("//"); match("//");
// InternalGame.g:8277:24: (~ ( ( '\\n' | '\\r' ) ) )* // InternalGame.g:8285:24: (~ ( ( '\\n' | '\\r' ) ) )*
loop10: loop10:
do { do {
int alt10=2; int alt10=2;
@ -1323,7 +1323,7 @@ public class InternalGameLexer extends Lexer {
switch (alt10) { switch (alt10) {
case 1 : case 1 :
// InternalGame.g:8277:24: ~ ( ( '\\n' | '\\r' ) ) // InternalGame.g:8285:24: ~ ( ( '\\n' | '\\r' ) )
{ {
if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) {
input.consume(); input.consume();
@ -1343,7 +1343,7 @@ public class InternalGameLexer extends Lexer {
} }
} while (true); } while (true);
// InternalGame.g:8277:40: ( ( '\\r' )? '\\n' )? // InternalGame.g:8285:40: ( ( '\\r' )? '\\n' )?
int alt12=2; int alt12=2;
int LA12_0 = input.LA(1); int LA12_0 = input.LA(1);
@ -1352,9 +1352,9 @@ public class InternalGameLexer extends Lexer {
} }
switch (alt12) { switch (alt12) {
case 1 : case 1 :
// InternalGame.g:8277:41: ( '\\r' )? '\\n' // InternalGame.g:8285:41: ( '\\r' )? '\\n'
{ {
// InternalGame.g:8277:41: ( '\\r' )? // InternalGame.g:8285:41: ( '\\r' )?
int alt11=2; int alt11=2;
int LA11_0 = input.LA(1); int LA11_0 = input.LA(1);
@ -1363,7 +1363,7 @@ public class InternalGameLexer extends Lexer {
} }
switch (alt11) { switch (alt11) {
case 1 : case 1 :
// InternalGame.g:8277:41: '\\r' // InternalGame.g:8285:41: '\\r'
{ {
match('\r'); match('\r');
@ -1395,10 +1395,10 @@ public class InternalGameLexer extends Lexer {
try { try {
int _type = RULE_WS; int _type = RULE_WS;
int _channel = DEFAULT_TOKEN_CHANNEL; int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalGame.g:8279:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) // InternalGame.g:8287:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
// InternalGame.g:8279:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ // InternalGame.g:8287:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
{ {
// InternalGame.g:8279:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ // InternalGame.g:8287:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
int cnt13=0; int cnt13=0;
loop13: loop13:
do { do {
@ -1452,8 +1452,8 @@ public class InternalGameLexer extends Lexer {
try { try {
int _type = RULE_ANY_OTHER; int _type = RULE_ANY_OTHER;
int _channel = DEFAULT_TOKEN_CHANNEL; int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalGame.g:8281:16: ( . ) // InternalGame.g:8289:16: ( . )
// InternalGame.g:8281:18: . // InternalGame.g:8289:18: .
{ {
matchAny(); matchAny();

View file

@ -1515,12 +1515,12 @@ public class InternalGameParser extends AbstractInternalContentAssistParser {
{ {
int LA1_3 = input.LA(2); int LA1_3 = input.LA(2);
if ( (LA1_3==RULE_COMPARATEUR) ) { if ( (LA1_3==EOF||LA1_3==15||LA1_3==17||(LA1_3>=19 && LA1_3<=20)||(LA1_3>=22 && LA1_3<=23)||LA1_3==25||(LA1_3>=27 && LA1_3<=28)||(LA1_3>=32 && LA1_3<=34)||LA1_3==38||LA1_3==41||LA1_3==43||(LA1_3>=45 && LA1_3<=46)) ) {
alt1=3;
}
else if ( (LA1_3==EOF||LA1_3==15||LA1_3==17||(LA1_3>=19 && LA1_3<=20)||(LA1_3>=22 && LA1_3<=23)||LA1_3==25||(LA1_3>=27 && LA1_3<=28)||(LA1_3>=32 && LA1_3<=34)||LA1_3==38||LA1_3==41||LA1_3==43||(LA1_3>=45 && LA1_3<=46)) ) {
alt1=2; alt1=2;
} }
else if ( (LA1_3==RULE_COMPARATEUR) ) {
alt1=3;
}
else { else {
NoViableAltException nvae = NoViableAltException nvae =
new NoViableAltException("", 1, 3, input); new NoViableAltException("", 1, 3, input);
@ -24160,21 +24160,29 @@ public class InternalGameParser extends AbstractInternalContentAssistParser {
// $ANTLR start "rule__ConditionConnaissance__ConnaissanceAssignment_1" // $ANTLR start "rule__ConditionConnaissance__ConnaissanceAssignment_1"
// InternalGame.g:8205:1: rule__ConditionConnaissance__ConnaissanceAssignment_1 : ( RULE_ID ) ; // InternalGame.g:8205:1: rule__ConditionConnaissance__ConnaissanceAssignment_1 : ( ( RULE_ID ) ) ;
public final void rule__ConditionConnaissance__ConnaissanceAssignment_1() throws RecognitionException { public final void rule__ConditionConnaissance__ConnaissanceAssignment_1() throws RecognitionException {
int stackSize = keepStackSize(); int stackSize = keepStackSize();
try { try {
// InternalGame.g:8209:1: ( ( RULE_ID ) ) // InternalGame.g:8209:1: ( ( ( RULE_ID ) ) )
// InternalGame.g:8210:2: ( RULE_ID ) // InternalGame.g:8210:2: ( ( RULE_ID ) )
{ {
// InternalGame.g:8210:2: ( RULE_ID ) // InternalGame.g:8210:2: ( ( RULE_ID ) )
// InternalGame.g:8211:3: RULE_ID // InternalGame.g:8211:3: ( RULE_ID )
{ {
before(grammarAccess.getConditionConnaissanceAccess().getConnaissanceIDTerminalRuleCall_1_0()); before(grammarAccess.getConditionConnaissanceAccess().getConnaissanceConnaissanceCrossReference_1_0());
// InternalGame.g:8212:3: ( RULE_ID )
// InternalGame.g:8213:4: RULE_ID
{
before(grammarAccess.getConditionConnaissanceAccess().getConnaissanceConnaissanceIDTerminalRuleCall_1_0_1());
match(input,RULE_ID,FOLLOW_2); match(input,RULE_ID,FOLLOW_2);
after(grammarAccess.getConditionConnaissanceAccess().getConnaissanceIDTerminalRuleCall_1_0()); after(grammarAccess.getConditionConnaissanceAccess().getConnaissanceConnaissanceIDTerminalRuleCall_1_0_1());
}
after(grammarAccess.getConditionConnaissanceAccess().getConnaissanceConnaissanceCrossReference_1_0());
} }
@ -24197,21 +24205,29 @@ public class InternalGameParser extends AbstractInternalContentAssistParser {
// $ANTLR start "rule__ConditionObjet__ObjetAssignment_0" // $ANTLR start "rule__ConditionObjet__ObjetAssignment_0"
// InternalGame.g:8220:1: rule__ConditionObjet__ObjetAssignment_0 : ( RULE_ID ) ; // InternalGame.g:8224:1: rule__ConditionObjet__ObjetAssignment_0 : ( ( RULE_ID ) ) ;
public final void rule__ConditionObjet__ObjetAssignment_0() throws RecognitionException { public final void rule__ConditionObjet__ObjetAssignment_0() throws RecognitionException {
int stackSize = keepStackSize(); int stackSize = keepStackSize();
try { try {
// InternalGame.g:8224:1: ( ( RULE_ID ) ) // InternalGame.g:8228:1: ( ( ( RULE_ID ) ) )
// InternalGame.g:8225:2: ( RULE_ID ) // InternalGame.g:8229:2: ( ( RULE_ID ) )
{ {
// InternalGame.g:8225:2: ( RULE_ID ) // InternalGame.g:8229:2: ( ( RULE_ID ) )
// InternalGame.g:8226:3: RULE_ID // InternalGame.g:8230:3: ( RULE_ID )
{ {
before(grammarAccess.getConditionObjetAccess().getObjetIDTerminalRuleCall_0_0()); before(grammarAccess.getConditionObjetAccess().getObjetObjetCrossReference_0_0());
// InternalGame.g:8231:3: ( RULE_ID )
// InternalGame.g:8232:4: RULE_ID
{
before(grammarAccess.getConditionObjetAccess().getObjetObjetIDTerminalRuleCall_0_0_1());
match(input,RULE_ID,FOLLOW_2); match(input,RULE_ID,FOLLOW_2);
after(grammarAccess.getConditionObjetAccess().getObjetIDTerminalRuleCall_0_0()); after(grammarAccess.getConditionObjetAccess().getObjetObjetIDTerminalRuleCall_0_0_1());
}
after(grammarAccess.getConditionObjetAccess().getObjetObjetCrossReference_0_0());
} }
@ -24234,17 +24250,17 @@ public class InternalGameParser extends AbstractInternalContentAssistParser {
// $ANTLR start "rule__ConditionObjet__ComparateurAssignment_1" // $ANTLR start "rule__ConditionObjet__ComparateurAssignment_1"
// InternalGame.g:8235:1: rule__ConditionObjet__ComparateurAssignment_1 : ( RULE_COMPARATEUR ) ; // InternalGame.g:8243:1: rule__ConditionObjet__ComparateurAssignment_1 : ( RULE_COMPARATEUR ) ;
public final void rule__ConditionObjet__ComparateurAssignment_1() throws RecognitionException { public final void rule__ConditionObjet__ComparateurAssignment_1() throws RecognitionException {
int stackSize = keepStackSize(); int stackSize = keepStackSize();
try { try {
// InternalGame.g:8239:1: ( ( RULE_COMPARATEUR ) ) // InternalGame.g:8247:1: ( ( RULE_COMPARATEUR ) )
// InternalGame.g:8240:2: ( RULE_COMPARATEUR ) // InternalGame.g:8248:2: ( RULE_COMPARATEUR )
{ {
// InternalGame.g:8240:2: ( RULE_COMPARATEUR ) // InternalGame.g:8248:2: ( RULE_COMPARATEUR )
// InternalGame.g:8241:3: RULE_COMPARATEUR // InternalGame.g:8249:3: RULE_COMPARATEUR
{ {
before(grammarAccess.getConditionObjetAccess().getComparateurCOMPARATEURTerminalRuleCall_1_0()); before(grammarAccess.getConditionObjetAccess().getComparateurCOMPARATEURTerminalRuleCall_1_0());
match(input,RULE_COMPARATEUR,FOLLOW_2); match(input,RULE_COMPARATEUR,FOLLOW_2);
@ -24271,17 +24287,17 @@ public class InternalGameParser extends AbstractInternalContentAssistParser {
// $ANTLR start "rule__ConditionObjet__NombreAssignment_2" // $ANTLR start "rule__ConditionObjet__NombreAssignment_2"
// InternalGame.g:8250:1: rule__ConditionObjet__NombreAssignment_2 : ( RULE_INT ) ; // InternalGame.g:8258:1: rule__ConditionObjet__NombreAssignment_2 : ( RULE_INT ) ;
public final void rule__ConditionObjet__NombreAssignment_2() throws RecognitionException { public final void rule__ConditionObjet__NombreAssignment_2() throws RecognitionException {
int stackSize = keepStackSize(); int stackSize = keepStackSize();
try { try {
// InternalGame.g:8254:1: ( ( RULE_INT ) ) // InternalGame.g:8262:1: ( ( RULE_INT ) )
// InternalGame.g:8255:2: ( RULE_INT ) // InternalGame.g:8263:2: ( RULE_INT )
{ {
// InternalGame.g:8255:2: ( RULE_INT ) // InternalGame.g:8263:2: ( RULE_INT )
// InternalGame.g:8256:3: RULE_INT // InternalGame.g:8264:3: RULE_INT
{ {
before(grammarAccess.getConditionObjetAccess().getNombreINTTerminalRuleCall_2_0()); before(grammarAccess.getConditionObjetAccess().getNombreINTTerminalRuleCall_2_0());
match(input,RULE_INT,FOLLOW_2); match(input,RULE_INT,FOLLOW_2);

View file

@ -211,10 +211,10 @@ public abstract class AbstractGameProposalProvider extends TerminalsProposalProv
// subclasses may override // subclasses may override
} }
public void completeConditionConnaissance_Connaissance(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { public void completeConditionConnaissance_Connaissance(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
} }
public void completeConditionObjet_Objet(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { public void completeConditionObjet_Objet(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
} }
public void completeConditionObjet_Comparateur(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { public void completeConditionObjet_Comparateur(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);

View file

@ -145,10 +145,10 @@
</eClassifiers> </eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ConditionConnaissance" eSuperTypes="#//ConditionTest"> <eClassifiers xsi:type="ecore:EClass" name="ConditionConnaissance" eSuperTypes="#//ConditionTest">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="negation" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="negation" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="connaissance" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> <eStructuralFeatures xsi:type="ecore:EReference" name="connaissance" eType="#//Connaissance"/>
</eClassifiers> </eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ConditionObjet" eSuperTypes="#//ConditionTest"> <eClassifiers xsi:type="ecore:EClass" name="ConditionObjet" eSuperTypes="#//ConditionTest">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="objet" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> <eStructuralFeatures xsi:type="ecore:EReference" name="objet" eType="#//Objet"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="comparateur" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="comparateur" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="nombre" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="nombre" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
</eClassifiers> </eClassifiers>

View file

@ -102,10 +102,10 @@
</genClasses> </genClasses>
<genClasses ecoreClass="Game.ecore#//ConditionConnaissance"> <genClasses ecoreClass="Game.ecore#//ConditionConnaissance">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Game.ecore#//ConditionConnaissance/negation"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Game.ecore#//ConditionConnaissance/negation"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Game.ecore#//ConditionConnaissance/connaissance"/> <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference Game.ecore#//ConditionConnaissance/connaissance"/>
</genClasses> </genClasses>
<genClasses ecoreClass="Game.ecore#//ConditionObjet"> <genClasses ecoreClass="Game.ecore#//ConditionObjet">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Game.ecore#//ConditionObjet/objet"/> <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference Game.ecore#//ConditionObjet/objet"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Game.ecore#//ConditionObjet/comparateur"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Game.ecore#//ConditionObjet/comparateur"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Game.ecore#//ConditionObjet/nombre"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Game.ecore#//ConditionObjet/nombre"/>
</genClasses> </genClasses>

View file

@ -46,25 +46,25 @@ public interface ConditionConnaissance extends ConditionTest
void setNegation(String value); void setNegation(String value);
/** /**
* Returns the value of the '<em><b>Connaissance</b></em>' attribute. * Returns the value of the '<em><b>Connaissance</b></em>' reference.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @return the value of the '<em>Connaissance</em>' attribute. * @return the value of the '<em>Connaissance</em>' reference.
* @see #setConnaissance(String) * @see #setConnaissance(Connaissance)
* @see fr.n7.game.xtext.game.GamePackage#getConditionConnaissance_Connaissance() * @see fr.n7.game.xtext.game.GamePackage#getConditionConnaissance_Connaissance()
* @model * @model
* @generated * @generated
*/ */
String getConnaissance(); Connaissance getConnaissance();
/** /**
* Sets the value of the '{@link fr.n7.game.xtext.game.ConditionConnaissance#getConnaissance <em>Connaissance</em>}' attribute. * Sets the value of the '{@link fr.n7.game.xtext.game.ConditionConnaissance#getConnaissance <em>Connaissance</em>}' reference.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @param value the new value of the '<em>Connaissance</em>' attribute. * @param value the new value of the '<em>Connaissance</em>' reference.
* @see #getConnaissance() * @see #getConnaissance()
* @generated * @generated
*/ */
void setConnaissance(String value); void setConnaissance(Connaissance value);
} // ConditionConnaissance } // ConditionConnaissance

View file

@ -25,26 +25,26 @@ package fr.n7.game.xtext.game;
public interface ConditionObjet extends ConditionTest public interface ConditionObjet extends ConditionTest
{ {
/** /**
* Returns the value of the '<em><b>Objet</b></em>' attribute. * Returns the value of the '<em><b>Objet</b></em>' reference.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @return the value of the '<em>Objet</em>' attribute. * @return the value of the '<em>Objet</em>' reference.
* @see #setObjet(String) * @see #setObjet(Objet)
* @see fr.n7.game.xtext.game.GamePackage#getConditionObjet_Objet() * @see fr.n7.game.xtext.game.GamePackage#getConditionObjet_Objet()
* @model * @model
* @generated * @generated
*/ */
String getObjet(); Objet getObjet();
/** /**
* Sets the value of the '{@link fr.n7.game.xtext.game.ConditionObjet#getObjet <em>Objet</em>}' attribute. * Sets the value of the '{@link fr.n7.game.xtext.game.ConditionObjet#getObjet <em>Objet</em>}' reference.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @param value the new value of the '<em>Objet</em>' attribute. * @param value the new value of the '<em>Objet</em>' reference.
* @see #getObjet() * @see #getObjet()
* @generated * @generated
*/ */
void setObjet(String value); void setObjet(Objet value);
/** /**
* Returns the value of the '<em><b>Comparateur</b></em>' attribute. * Returns the value of the '<em><b>Comparateur</b></em>' attribute.

View file

@ -948,7 +948,7 @@ public interface GamePackage extends EPackage
int CONDITION_CONNAISSANCE__NEGATION = CONDITION_TEST_FEATURE_COUNT + 0; int CONDITION_CONNAISSANCE__NEGATION = CONDITION_TEST_FEATURE_COUNT + 0;
/** /**
* The feature id for the '<em><b>Connaissance</b></em>' attribute. * The feature id for the '<em><b>Connaissance</b></em>' reference.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @generated * @generated
@ -976,7 +976,7 @@ public interface GamePackage extends EPackage
int CONDITION_OBJET = 17; int CONDITION_OBJET = 17;
/** /**
* The feature id for the '<em><b>Objet</b></em>' attribute. * The feature id for the '<em><b>Objet</b></em>' reference.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @generated * @generated
@ -1887,15 +1887,15 @@ public interface GamePackage extends EPackage
EAttribute getConditionConnaissance_Negation(); EAttribute getConditionConnaissance_Negation();
/** /**
* Returns the meta object for the attribute '{@link fr.n7.game.xtext.game.ConditionConnaissance#getConnaissance <em>Connaissance</em>}'. * Returns the meta object for the reference '{@link fr.n7.game.xtext.game.ConditionConnaissance#getConnaissance <em>Connaissance</em>}'.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Connaissance</em>'. * @return the meta object for the reference '<em>Connaissance</em>'.
* @see fr.n7.game.xtext.game.ConditionConnaissance#getConnaissance() * @see fr.n7.game.xtext.game.ConditionConnaissance#getConnaissance()
* @see #getConditionConnaissance() * @see #getConditionConnaissance()
* @generated * @generated
*/ */
EAttribute getConditionConnaissance_Connaissance(); EReference getConditionConnaissance_Connaissance();
/** /**
* Returns the meta object for class '{@link fr.n7.game.xtext.game.ConditionObjet <em>Condition Objet</em>}'. * Returns the meta object for class '{@link fr.n7.game.xtext.game.ConditionObjet <em>Condition Objet</em>}'.
@ -1908,15 +1908,15 @@ public interface GamePackage extends EPackage
EClass getConditionObjet(); EClass getConditionObjet();
/** /**
* Returns the meta object for the attribute '{@link fr.n7.game.xtext.game.ConditionObjet#getObjet <em>Objet</em>}'. * Returns the meta object for the reference '{@link fr.n7.game.xtext.game.ConditionObjet#getObjet <em>Objet</em>}'.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Objet</em>'. * @return the meta object for the reference '<em>Objet</em>'.
* @see fr.n7.game.xtext.game.ConditionObjet#getObjet() * @see fr.n7.game.xtext.game.ConditionObjet#getObjet()
* @see #getConditionObjet() * @see #getConditionObjet()
* @generated * @generated
*/ */
EAttribute getConditionObjet_Objet(); EReference getConditionObjet_Objet();
/** /**
* Returns the meta object for the attribute '{@link fr.n7.game.xtext.game.ConditionObjet#getComparateur <em>Comparateur</em>}'. * Returns the meta object for the attribute '{@link fr.n7.game.xtext.game.ConditionObjet#getComparateur <em>Comparateur</em>}'.
@ -2646,12 +2646,12 @@ public interface GamePackage extends EPackage
EAttribute CONDITION_CONNAISSANCE__NEGATION = eINSTANCE.getConditionConnaissance_Negation(); EAttribute CONDITION_CONNAISSANCE__NEGATION = eINSTANCE.getConditionConnaissance_Negation();
/** /**
* The meta object literal for the '<em><b>Connaissance</b></em>' attribute feature. * The meta object literal for the '<em><b>Connaissance</b></em>' reference feature.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @generated * @generated
*/ */
EAttribute CONDITION_CONNAISSANCE__CONNAISSANCE = eINSTANCE.getConditionConnaissance_Connaissance(); EReference CONDITION_CONNAISSANCE__CONNAISSANCE = eINSTANCE.getConditionConnaissance_Connaissance();
/** /**
* The meta object literal for the '{@link fr.n7.game.xtext.game.impl.ConditionObjetImpl <em>Condition Objet</em>}' class. * The meta object literal for the '{@link fr.n7.game.xtext.game.impl.ConditionObjetImpl <em>Condition Objet</em>}' class.
@ -2664,12 +2664,12 @@ public interface GamePackage extends EPackage
EClass CONDITION_OBJET = eINSTANCE.getConditionObjet(); EClass CONDITION_OBJET = eINSTANCE.getConditionObjet();
/** /**
* The meta object literal for the '<em><b>Objet</b></em>' attribute feature. * The meta object literal for the '<em><b>Objet</b></em>' reference feature.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @generated * @generated
*/ */
EAttribute CONDITION_OBJET__OBJET = eINSTANCE.getConditionObjet_Objet(); EReference CONDITION_OBJET__OBJET = eINSTANCE.getConditionObjet_Objet();
/** /**
* The meta object literal for the '<em><b>Comparateur</b></em>' attribute feature. * The meta object literal for the '<em><b>Comparateur</b></em>' attribute feature.

View file

@ -4,11 +4,13 @@
package fr.n7.game.xtext.game.impl; package fr.n7.game.xtext.game.impl;
import fr.n7.game.xtext.game.ConditionConnaissance; import fr.n7.game.xtext.game.ConditionConnaissance;
import fr.n7.game.xtext.game.Connaissance;
import fr.n7.game.xtext.game.GamePackage; import fr.n7.game.xtext.game.GamePackage;
import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.ENotificationImpl;
@ -49,24 +51,14 @@ public class ConditionConnaissanceImpl extends ConditionTestImpl implements Cond
protected String negation = NEGATION_EDEFAULT; protected String negation = NEGATION_EDEFAULT;
/** /**
* The default value of the '{@link #getConnaissance() <em>Connaissance</em>}' attribute. * The cached value of the '{@link #getConnaissance() <em>Connaissance</em>}' reference.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @see #getConnaissance() * @see #getConnaissance()
* @generated * @generated
* @ordered * @ordered
*/ */
protected static final String CONNAISSANCE_EDEFAULT = null; protected Connaissance connaissance;
/**
* The cached value of the '{@link #getConnaissance() <em>Connaissance</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getConnaissance()
* @generated
* @ordered
*/
protected String connaissance = CONNAISSANCE_EDEFAULT;
/** /**
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
@ -120,7 +112,27 @@ public class ConditionConnaissanceImpl extends ConditionTestImpl implements Cond
* @generated * @generated
*/ */
@Override @Override
public String getConnaissance() public Connaissance getConnaissance()
{
if (connaissance != null && connaissance.eIsProxy())
{
InternalEObject oldConnaissance = (InternalEObject)connaissance;
connaissance = (Connaissance)eResolveProxy(oldConnaissance);
if (connaissance != oldConnaissance)
{
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, GamePackage.CONDITION_CONNAISSANCE__CONNAISSANCE, oldConnaissance, connaissance));
}
}
return connaissance;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Connaissance basicGetConnaissance()
{ {
return connaissance; return connaissance;
} }
@ -131,9 +143,9 @@ public class ConditionConnaissanceImpl extends ConditionTestImpl implements Cond
* @generated * @generated
*/ */
@Override @Override
public void setConnaissance(String newConnaissance) public void setConnaissance(Connaissance newConnaissance)
{ {
String oldConnaissance = connaissance; Connaissance oldConnaissance = connaissance;
connaissance = newConnaissance; connaissance = newConnaissance;
if (eNotificationRequired()) if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GamePackage.CONDITION_CONNAISSANCE__CONNAISSANCE, oldConnaissance, connaissance)); eNotify(new ENotificationImpl(this, Notification.SET, GamePackage.CONDITION_CONNAISSANCE__CONNAISSANCE, oldConnaissance, connaissance));
@ -152,7 +164,8 @@ public class ConditionConnaissanceImpl extends ConditionTestImpl implements Cond
case GamePackage.CONDITION_CONNAISSANCE__NEGATION: case GamePackage.CONDITION_CONNAISSANCE__NEGATION:
return getNegation(); return getNegation();
case GamePackage.CONDITION_CONNAISSANCE__CONNAISSANCE: case GamePackage.CONDITION_CONNAISSANCE__CONNAISSANCE:
return getConnaissance(); if (resolve) return getConnaissance();
return basicGetConnaissance();
} }
return super.eGet(featureID, resolve, coreType); return super.eGet(featureID, resolve, coreType);
} }
@ -171,7 +184,7 @@ public class ConditionConnaissanceImpl extends ConditionTestImpl implements Cond
setNegation((String)newValue); setNegation((String)newValue);
return; return;
case GamePackage.CONDITION_CONNAISSANCE__CONNAISSANCE: case GamePackage.CONDITION_CONNAISSANCE__CONNAISSANCE:
setConnaissance((String)newValue); setConnaissance((Connaissance)newValue);
return; return;
} }
super.eSet(featureID, newValue); super.eSet(featureID, newValue);
@ -191,7 +204,7 @@ public class ConditionConnaissanceImpl extends ConditionTestImpl implements Cond
setNegation(NEGATION_EDEFAULT); setNegation(NEGATION_EDEFAULT);
return; return;
case GamePackage.CONDITION_CONNAISSANCE__CONNAISSANCE: case GamePackage.CONDITION_CONNAISSANCE__CONNAISSANCE:
setConnaissance(CONNAISSANCE_EDEFAULT); setConnaissance((Connaissance)null);
return; return;
} }
super.eUnset(featureID); super.eUnset(featureID);
@ -210,7 +223,7 @@ public class ConditionConnaissanceImpl extends ConditionTestImpl implements Cond
case GamePackage.CONDITION_CONNAISSANCE__NEGATION: case GamePackage.CONDITION_CONNAISSANCE__NEGATION:
return NEGATION_EDEFAULT == null ? negation != null : !NEGATION_EDEFAULT.equals(negation); return NEGATION_EDEFAULT == null ? negation != null : !NEGATION_EDEFAULT.equals(negation);
case GamePackage.CONDITION_CONNAISSANCE__CONNAISSANCE: case GamePackage.CONDITION_CONNAISSANCE__CONNAISSANCE:
return CONNAISSANCE_EDEFAULT == null ? connaissance != null : !CONNAISSANCE_EDEFAULT.equals(connaissance); return connaissance != null;
} }
return super.eIsSet(featureID); return super.eIsSet(featureID);
} }
@ -228,8 +241,6 @@ public class ConditionConnaissanceImpl extends ConditionTestImpl implements Cond
StringBuilder result = new StringBuilder(super.toString()); StringBuilder result = new StringBuilder(super.toString());
result.append(" (negation: "); result.append(" (negation: ");
result.append(negation); result.append(negation);
result.append(", connaissance: ");
result.append(connaissance);
result.append(')'); result.append(')');
return result.toString(); return result.toString();
} }

View file

@ -5,10 +5,12 @@ package fr.n7.game.xtext.game.impl;
import fr.n7.game.xtext.game.ConditionObjet; import fr.n7.game.xtext.game.ConditionObjet;
import fr.n7.game.xtext.game.GamePackage; import fr.n7.game.xtext.game.GamePackage;
import fr.n7.game.xtext.game.Objet;
import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.ENotificationImpl;
@ -30,24 +32,14 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl;
public class ConditionObjetImpl extends ConditionTestImpl implements ConditionObjet public class ConditionObjetImpl extends ConditionTestImpl implements ConditionObjet
{ {
/** /**
* The default value of the '{@link #getObjet() <em>Objet</em>}' attribute. * The cached value of the '{@link #getObjet() <em>Objet</em>}' reference.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @see #getObjet() * @see #getObjet()
* @generated * @generated
* @ordered * @ordered
*/ */
protected static final String OBJET_EDEFAULT = null; protected Objet objet;
/**
* The cached value of the '{@link #getObjet() <em>Objet</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getObjet()
* @generated
* @ordered
*/
protected String objet = OBJET_EDEFAULT;
/** /**
* The default value of the '{@link #getComparateur() <em>Comparateur</em>}' attribute. * The default value of the '{@link #getComparateur() <em>Comparateur</em>}' attribute.
@ -116,7 +108,27 @@ public class ConditionObjetImpl extends ConditionTestImpl implements ConditionOb
* @generated * @generated
*/ */
@Override @Override
public String getObjet() public Objet getObjet()
{
if (objet != null && objet.eIsProxy())
{
InternalEObject oldObjet = (InternalEObject)objet;
objet = (Objet)eResolveProxy(oldObjet);
if (objet != oldObjet)
{
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, GamePackage.CONDITION_OBJET__OBJET, oldObjet, objet));
}
}
return objet;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Objet basicGetObjet()
{ {
return objet; return objet;
} }
@ -127,9 +139,9 @@ public class ConditionObjetImpl extends ConditionTestImpl implements ConditionOb
* @generated * @generated
*/ */
@Override @Override
public void setObjet(String newObjet) public void setObjet(Objet newObjet)
{ {
String oldObjet = objet; Objet oldObjet = objet;
objet = newObjet; objet = newObjet;
if (eNotificationRequired()) if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GamePackage.CONDITION_OBJET__OBJET, oldObjet, objet)); eNotify(new ENotificationImpl(this, Notification.SET, GamePackage.CONDITION_OBJET__OBJET, oldObjet, objet));
@ -196,7 +208,8 @@ public class ConditionObjetImpl extends ConditionTestImpl implements ConditionOb
switch (featureID) switch (featureID)
{ {
case GamePackage.CONDITION_OBJET__OBJET: case GamePackage.CONDITION_OBJET__OBJET:
return getObjet(); if (resolve) return getObjet();
return basicGetObjet();
case GamePackage.CONDITION_OBJET__COMPARATEUR: case GamePackage.CONDITION_OBJET__COMPARATEUR:
return getComparateur(); return getComparateur();
case GamePackage.CONDITION_OBJET__NOMBRE: case GamePackage.CONDITION_OBJET__NOMBRE:
@ -216,7 +229,7 @@ public class ConditionObjetImpl extends ConditionTestImpl implements ConditionOb
switch (featureID) switch (featureID)
{ {
case GamePackage.CONDITION_OBJET__OBJET: case GamePackage.CONDITION_OBJET__OBJET:
setObjet((String)newValue); setObjet((Objet)newValue);
return; return;
case GamePackage.CONDITION_OBJET__COMPARATEUR: case GamePackage.CONDITION_OBJET__COMPARATEUR:
setComparateur((String)newValue); setComparateur((String)newValue);
@ -239,7 +252,7 @@ public class ConditionObjetImpl extends ConditionTestImpl implements ConditionOb
switch (featureID) switch (featureID)
{ {
case GamePackage.CONDITION_OBJET__OBJET: case GamePackage.CONDITION_OBJET__OBJET:
setObjet(OBJET_EDEFAULT); setObjet((Objet)null);
return; return;
case GamePackage.CONDITION_OBJET__COMPARATEUR: case GamePackage.CONDITION_OBJET__COMPARATEUR:
setComparateur(COMPARATEUR_EDEFAULT); setComparateur(COMPARATEUR_EDEFAULT);
@ -262,7 +275,7 @@ public class ConditionObjetImpl extends ConditionTestImpl implements ConditionOb
switch (featureID) switch (featureID)
{ {
case GamePackage.CONDITION_OBJET__OBJET: case GamePackage.CONDITION_OBJET__OBJET:
return OBJET_EDEFAULT == null ? objet != null : !OBJET_EDEFAULT.equals(objet); return objet != null;
case GamePackage.CONDITION_OBJET__COMPARATEUR: case GamePackage.CONDITION_OBJET__COMPARATEUR:
return COMPARATEUR_EDEFAULT == null ? comparateur != null : !COMPARATEUR_EDEFAULT.equals(comparateur); return COMPARATEUR_EDEFAULT == null ? comparateur != null : !COMPARATEUR_EDEFAULT.equals(comparateur);
case GamePackage.CONDITION_OBJET__NOMBRE: case GamePackage.CONDITION_OBJET__NOMBRE:
@ -282,9 +295,7 @@ public class ConditionObjetImpl extends ConditionTestImpl implements ConditionOb
if (eIsProxy()) return super.toString(); if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString()); StringBuilder result = new StringBuilder(super.toString());
result.append(" (objet: "); result.append(" (comparateur: ");
result.append(objet);
result.append(", comparateur: ");
result.append(comparateur); result.append(comparateur);
result.append(", nombre: "); result.append(", nombre: ");
result.append(nombre); result.append(nombre);

View file

@ -1125,9 +1125,9 @@ public class GamePackageImpl extends EPackageImpl implements GamePackage
* @generated * @generated
*/ */
@Override @Override
public EAttribute getConditionConnaissance_Connaissance() public EReference getConditionConnaissance_Connaissance()
{ {
return (EAttribute)conditionConnaissanceEClass.getEStructuralFeatures().get(1); return (EReference)conditionConnaissanceEClass.getEStructuralFeatures().get(1);
} }
/** /**
@ -1147,9 +1147,9 @@ public class GamePackageImpl extends EPackageImpl implements GamePackage
* @generated * @generated
*/ */
@Override @Override
public EAttribute getConditionObjet_Objet() public EReference getConditionObjet_Objet()
{ {
return (EAttribute)conditionObjetEClass.getEStructuralFeatures().get(0); return (EReference)conditionObjetEClass.getEStructuralFeatures().get(0);
} }
/** /**
@ -1302,10 +1302,10 @@ public class GamePackageImpl extends EPackageImpl implements GamePackage
conditionConnaissanceEClass = createEClass(CONDITION_CONNAISSANCE); conditionConnaissanceEClass = createEClass(CONDITION_CONNAISSANCE);
createEAttribute(conditionConnaissanceEClass, CONDITION_CONNAISSANCE__NEGATION); createEAttribute(conditionConnaissanceEClass, CONDITION_CONNAISSANCE__NEGATION);
createEAttribute(conditionConnaissanceEClass, CONDITION_CONNAISSANCE__CONNAISSANCE); createEReference(conditionConnaissanceEClass, CONDITION_CONNAISSANCE__CONNAISSANCE);
conditionObjetEClass = createEClass(CONDITION_OBJET); conditionObjetEClass = createEClass(CONDITION_OBJET);
createEAttribute(conditionObjetEClass, CONDITION_OBJET__OBJET); createEReference(conditionObjetEClass, CONDITION_OBJET__OBJET);
createEAttribute(conditionObjetEClass, CONDITION_OBJET__COMPARATEUR); createEAttribute(conditionObjetEClass, CONDITION_OBJET__COMPARATEUR);
createEAttribute(conditionObjetEClass, CONDITION_OBJET__NOMBRE); createEAttribute(conditionObjetEClass, CONDITION_OBJET__NOMBRE);
} }
@ -1441,10 +1441,10 @@ public class GamePackageImpl extends EPackageImpl implements GamePackage
initEClass(conditionConnaissanceEClass, ConditionConnaissance.class, "ConditionConnaissance", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(conditionConnaissanceEClass, ConditionConnaissance.class, "ConditionConnaissance", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getConditionConnaissance_Negation(), ecorePackage.getEString(), "negation", null, 0, 1, ConditionConnaissance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getConditionConnaissance_Negation(), ecorePackage.getEString(), "negation", null, 0, 1, ConditionConnaissance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getConditionConnaissance_Connaissance(), ecorePackage.getEString(), "connaissance", null, 0, 1, ConditionConnaissance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getConditionConnaissance_Connaissance(), this.getConnaissance(), null, "connaissance", null, 0, 1, ConditionConnaissance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(conditionObjetEClass, ConditionObjet.class, "ConditionObjet", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(conditionObjetEClass, ConditionObjet.class, "ConditionObjet", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getConditionObjet_Objet(), ecorePackage.getEString(), "objet", null, 0, 1, ConditionObjet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getConditionObjet_Objet(), this.getObjet(), null, "objet", null, 0, 1, ConditionObjet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getConditionObjet_Comparateur(), ecorePackage.getEString(), "comparateur", null, 0, 1, ConditionObjet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getConditionObjet_Comparateur(), ecorePackage.getEString(), "comparateur", null, 0, 1, ConditionObjet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getConditionObjet_Nombre(), ecorePackage.getEInt(), "nombre", null, 0, 1, ConditionObjet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getConditionObjet_Nombre(), ecorePackage.getEInt(), "nombre", null, 0, 1, ConditionObjet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

View file

@ -2171,19 +2171,14 @@ ruleConditionConnaissance returns [EObject current=null]
)? )?
( (
( (
lv_connaissance_1_0=RULE_ID
{
newLeafNode(lv_connaissance_1_0, grammarAccess.getConditionConnaissanceAccess().getConnaissanceIDTerminalRuleCall_1_0());
}
{ {
if ($current==null) { if ($current==null) {
$current = createModelElement(grammarAccess.getConditionConnaissanceRule()); $current = createModelElement(grammarAccess.getConditionConnaissanceRule());
} }
setWithLastConsumed( }
$current, otherlv_1=RULE_ID
"connaissance", {
lv_connaissance_1_0, newLeafNode(otherlv_1, grammarAccess.getConditionConnaissanceAccess().getConnaissanceConnaissanceCrossReference_1_0());
"org.eclipse.xtext.common.Terminals.ID");
} }
) )
) )
@ -2208,19 +2203,14 @@ ruleConditionObjet returns [EObject current=null]
( (
( (
( (
lv_objet_0_0=RULE_ID
{
newLeafNode(lv_objet_0_0, grammarAccess.getConditionObjetAccess().getObjetIDTerminalRuleCall_0_0());
}
{ {
if ($current==null) { if ($current==null) {
$current = createModelElement(grammarAccess.getConditionObjetRule()); $current = createModelElement(grammarAccess.getConditionObjetRule());
} }
setWithLastConsumed( }
$current, otherlv_0=RULE_ID
"objet", {
lv_objet_0_0, newLeafNode(otherlv_0, grammarAccess.getConditionObjetAccess().getObjetObjetCrossReference_0_0());
"org.eclipse.xtext.common.Terminals.ID");
} }
) )
) )

View file

@ -808,10 +808,10 @@ public class InternalGameLexer extends Lexer {
try { try {
int _type = RULE_COMPARATEUR; int _type = RULE_COMPARATEUR;
int _channel = DEFAULT_TOKEN_CHANNEL; int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalGame.g:2266:18: ( ( '<' | '>' | '==' | '<=' | '>=' | '!=' ) ) // InternalGame.g:2256:18: ( ( '<' | '>' | '==' | '<=' | '>=' | '!=' ) )
// InternalGame.g:2266:20: ( '<' | '>' | '==' | '<=' | '>=' | '!=' ) // InternalGame.g:2256:20: ( '<' | '>' | '==' | '<=' | '>=' | '!=' )
{ {
// InternalGame.g:2266:20: ( '<' | '>' | '==' | '<=' | '>=' | '!=' ) // InternalGame.g:2256:20: ( '<' | '>' | '==' | '<=' | '>=' | '!=' )
int alt1=6; int alt1=6;
switch ( input.LA(1) ) { switch ( input.LA(1) ) {
case '<': case '<':
@ -855,21 +855,21 @@ public class InternalGameLexer extends Lexer {
switch (alt1) { switch (alt1) {
case 1 : case 1 :
// InternalGame.g:2266:21: '<' // InternalGame.g:2256:21: '<'
{ {
match('<'); match('<');
} }
break; break;
case 2 : case 2 :
// InternalGame.g:2266:25: '>' // InternalGame.g:2256:25: '>'
{ {
match('>'); match('>');
} }
break; break;
case 3 : case 3 :
// InternalGame.g:2266:29: '==' // InternalGame.g:2256:29: '=='
{ {
match("=="); match("==");
@ -877,7 +877,7 @@ public class InternalGameLexer extends Lexer {
} }
break; break;
case 4 : case 4 :
// InternalGame.g:2266:34: '<=' // InternalGame.g:2256:34: '<='
{ {
match("<="); match("<=");
@ -885,7 +885,7 @@ public class InternalGameLexer extends Lexer {
} }
break; break;
case 5 : case 5 :
// InternalGame.g:2266:39: '>=' // InternalGame.g:2256:39: '>='
{ {
match(">="); match(">=");
@ -893,7 +893,7 @@ public class InternalGameLexer extends Lexer {
} }
break; break;
case 6 : case 6 :
// InternalGame.g:2266:44: '!=' // InternalGame.g:2256:44: '!='
{ {
match("!="); match("!=");
@ -919,10 +919,10 @@ public class InternalGameLexer extends Lexer {
try { try {
int _type = RULE_BOOLEAN; int _type = RULE_BOOLEAN;
int _channel = DEFAULT_TOKEN_CHANNEL; int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalGame.g:2268:14: ( ( 'true' | 'false' ) ) // InternalGame.g:2258:14: ( ( 'true' | 'false' ) )
// InternalGame.g:2268:16: ( 'true' | 'false' ) // InternalGame.g:2258:16: ( 'true' | 'false' )
{ {
// InternalGame.g:2268:16: ( 'true' | 'false' ) // InternalGame.g:2258:16: ( 'true' | 'false' )
int alt2=2; int alt2=2;
int LA2_0 = input.LA(1); int LA2_0 = input.LA(1);
@ -940,7 +940,7 @@ public class InternalGameLexer extends Lexer {
} }
switch (alt2) { switch (alt2) {
case 1 : case 1 :
// InternalGame.g:2268:17: 'true' // InternalGame.g:2258:17: 'true'
{ {
match("true"); match("true");
@ -948,7 +948,7 @@ public class InternalGameLexer extends Lexer {
} }
break; break;
case 2 : case 2 :
// InternalGame.g:2268:24: 'false' // InternalGame.g:2258:24: 'false'
{ {
match("false"); match("false");
@ -974,10 +974,10 @@ public class InternalGameLexer extends Lexer {
try { try {
int _type = RULE_ID; int _type = RULE_ID;
int _channel = DEFAULT_TOKEN_CHANNEL; int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalGame.g:2270:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) // InternalGame.g:2260:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
// InternalGame.g:2270:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* // InternalGame.g:2260:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
{ {
// InternalGame.g:2270:11: ( '^' )? // InternalGame.g:2260:11: ( '^' )?
int alt3=2; int alt3=2;
int LA3_0 = input.LA(1); int LA3_0 = input.LA(1);
@ -986,7 +986,7 @@ public class InternalGameLexer extends Lexer {
} }
switch (alt3) { switch (alt3) {
case 1 : case 1 :
// InternalGame.g:2270:11: '^' // InternalGame.g:2260:11: '^'
{ {
match('^'); match('^');
@ -1004,7 +1004,7 @@ public class InternalGameLexer extends Lexer {
recover(mse); recover(mse);
throw mse;} throw mse;}
// InternalGame.g:2270:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* // InternalGame.g:2260:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
loop4: loop4:
do { do {
int alt4=2; int alt4=2;
@ -1053,10 +1053,10 @@ public class InternalGameLexer extends Lexer {
try { try {
int _type = RULE_INT; int _type = RULE_INT;
int _channel = DEFAULT_TOKEN_CHANNEL; int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalGame.g:2272:10: ( ( '0' .. '9' )+ ) // InternalGame.g:2262:10: ( ( '0' .. '9' )+ )
// InternalGame.g:2272:12: ( '0' .. '9' )+ // InternalGame.g:2262:12: ( '0' .. '9' )+
{ {
// InternalGame.g:2272:12: ( '0' .. '9' )+ // InternalGame.g:2262:12: ( '0' .. '9' )+
int cnt5=0; int cnt5=0;
loop5: loop5:
do { do {
@ -1070,7 +1070,7 @@ public class InternalGameLexer extends Lexer {
switch (alt5) { switch (alt5) {
case 1 : case 1 :
// InternalGame.g:2272:13: '0' .. '9' // InternalGame.g:2262:13: '0' .. '9'
{ {
matchRange('0','9'); matchRange('0','9');
@ -1102,10 +1102,10 @@ public class InternalGameLexer extends Lexer {
try { try {
int _type = RULE_STRING; int _type = RULE_STRING;
int _channel = DEFAULT_TOKEN_CHANNEL; int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalGame.g:2274:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) ) // InternalGame.g:2264:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) )
// InternalGame.g:2274:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) // InternalGame.g:2264:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
{ {
// InternalGame.g:2274:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) // InternalGame.g:2264:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
int alt8=2; int alt8=2;
int LA8_0 = input.LA(1); int LA8_0 = input.LA(1);
@ -1123,10 +1123,10 @@ public class InternalGameLexer extends Lexer {
} }
switch (alt8) { switch (alt8) {
case 1 : case 1 :
// InternalGame.g:2274:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' // InternalGame.g:2264:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"'
{ {
match('\"'); match('\"');
// InternalGame.g:2274:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* // InternalGame.g:2264:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )*
loop6: loop6:
do { do {
int alt6=3; int alt6=3;
@ -1142,7 +1142,7 @@ public class InternalGameLexer extends Lexer {
switch (alt6) { switch (alt6) {
case 1 : case 1 :
// InternalGame.g:2274:21: '\\\\' . // InternalGame.g:2264:21: '\\\\' .
{ {
match('\\'); match('\\');
matchAny(); matchAny();
@ -1150,7 +1150,7 @@ public class InternalGameLexer extends Lexer {
} }
break; break;
case 2 : case 2 :
// InternalGame.g:2274:28: ~ ( ( '\\\\' | '\"' ) ) // InternalGame.g:2264:28: ~ ( ( '\\\\' | '\"' ) )
{ {
if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
input.consume(); input.consume();
@ -1175,10 +1175,10 @@ public class InternalGameLexer extends Lexer {
} }
break; break;
case 2 : case 2 :
// InternalGame.g:2274:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' // InternalGame.g:2264:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
{ {
match('\''); match('\'');
// InternalGame.g:2274:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* // InternalGame.g:2264:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )*
loop7: loop7:
do { do {
int alt7=3; int alt7=3;
@ -1194,7 +1194,7 @@ public class InternalGameLexer extends Lexer {
switch (alt7) { switch (alt7) {
case 1 : case 1 :
// InternalGame.g:2274:54: '\\\\' . // InternalGame.g:2264:54: '\\\\' .
{ {
match('\\'); match('\\');
matchAny(); matchAny();
@ -1202,7 +1202,7 @@ public class InternalGameLexer extends Lexer {
} }
break; break;
case 2 : case 2 :
// InternalGame.g:2274:61: ~ ( ( '\\\\' | '\\'' ) ) // InternalGame.g:2264:61: ~ ( ( '\\\\' | '\\'' ) )
{ {
if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
input.consume(); input.consume();
@ -1245,12 +1245,12 @@ public class InternalGameLexer extends Lexer {
try { try {
int _type = RULE_ML_COMMENT; int _type = RULE_ML_COMMENT;
int _channel = DEFAULT_TOKEN_CHANNEL; int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalGame.g:2276:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) // InternalGame.g:2266:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
// InternalGame.g:2276:19: '/*' ( options {greedy=false; } : . )* '*/' // InternalGame.g:2266:19: '/*' ( options {greedy=false; } : . )* '*/'
{ {
match("/*"); match("/*");
// InternalGame.g:2276:24: ( options {greedy=false; } : . )* // InternalGame.g:2266:24: ( options {greedy=false; } : . )*
loop9: loop9:
do { do {
int alt9=2; int alt9=2;
@ -1275,7 +1275,7 @@ public class InternalGameLexer extends Lexer {
switch (alt9) { switch (alt9) {
case 1 : case 1 :
// InternalGame.g:2276:52: . // InternalGame.g:2266:52: .
{ {
matchAny(); matchAny();
@ -1305,12 +1305,12 @@ public class InternalGameLexer extends Lexer {
try { try {
int _type = RULE_SL_COMMENT; int _type = RULE_SL_COMMENT;
int _channel = DEFAULT_TOKEN_CHANNEL; int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalGame.g:2278:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) // InternalGame.g:2268:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
// InternalGame.g:2278:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? // InternalGame.g:2268:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
{ {
match("//"); match("//");
// InternalGame.g:2278:24: (~ ( ( '\\n' | '\\r' ) ) )* // InternalGame.g:2268:24: (~ ( ( '\\n' | '\\r' ) ) )*
loop10: loop10:
do { do {
int alt10=2; int alt10=2;
@ -1323,7 +1323,7 @@ public class InternalGameLexer extends Lexer {
switch (alt10) { switch (alt10) {
case 1 : case 1 :
// InternalGame.g:2278:24: ~ ( ( '\\n' | '\\r' ) ) // InternalGame.g:2268:24: ~ ( ( '\\n' | '\\r' ) )
{ {
if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) {
input.consume(); input.consume();
@ -1343,7 +1343,7 @@ public class InternalGameLexer extends Lexer {
} }
} while (true); } while (true);
// InternalGame.g:2278:40: ( ( '\\r' )? '\\n' )? // InternalGame.g:2268:40: ( ( '\\r' )? '\\n' )?
int alt12=2; int alt12=2;
int LA12_0 = input.LA(1); int LA12_0 = input.LA(1);
@ -1352,9 +1352,9 @@ public class InternalGameLexer extends Lexer {
} }
switch (alt12) { switch (alt12) {
case 1 : case 1 :
// InternalGame.g:2278:41: ( '\\r' )? '\\n' // InternalGame.g:2268:41: ( '\\r' )? '\\n'
{ {
// InternalGame.g:2278:41: ( '\\r' )? // InternalGame.g:2268:41: ( '\\r' )?
int alt11=2; int alt11=2;
int LA11_0 = input.LA(1); int LA11_0 = input.LA(1);
@ -1363,7 +1363,7 @@ public class InternalGameLexer extends Lexer {
} }
switch (alt11) { switch (alt11) {
case 1 : case 1 :
// InternalGame.g:2278:41: '\\r' // InternalGame.g:2268:41: '\\r'
{ {
match('\r'); match('\r');
@ -1395,10 +1395,10 @@ public class InternalGameLexer extends Lexer {
try { try {
int _type = RULE_WS; int _type = RULE_WS;
int _channel = DEFAULT_TOKEN_CHANNEL; int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalGame.g:2280:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) // InternalGame.g:2270:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
// InternalGame.g:2280:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ // InternalGame.g:2270:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
{ {
// InternalGame.g:2280:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ // InternalGame.g:2270:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
int cnt13=0; int cnt13=0;
loop13: loop13:
do { do {
@ -1452,8 +1452,8 @@ public class InternalGameLexer extends Lexer {
try { try {
int _type = RULE_ANY_OTHER; int _type = RULE_ANY_OTHER;
int _channel = DEFAULT_TOKEN_CHANNEL; int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalGame.g:2282:16: ( . ) // InternalGame.g:2272:16: ( . )
// InternalGame.g:2282:18: . // InternalGame.g:2272:18: .
{ {
matchAny(); matchAny();

View file

@ -4872,22 +4872,22 @@ public class InternalGameParser extends AbstractInternalAntlrParser {
// $ANTLR start "ruleConditionConnaissance" // $ANTLR start "ruleConditionConnaissance"
// InternalGame.g:2150:1: ruleConditionConnaissance returns [EObject current=null] : ( ( (lv_negation_0_0= '!' ) )? ( (lv_connaissance_1_0= RULE_ID ) ) ) ; // InternalGame.g:2150:1: ruleConditionConnaissance returns [EObject current=null] : ( ( (lv_negation_0_0= '!' ) )? ( (otherlv_1= RULE_ID ) ) ) ;
public final EObject ruleConditionConnaissance() throws RecognitionException { public final EObject ruleConditionConnaissance() throws RecognitionException {
EObject current = null; EObject current = null;
Token lv_negation_0_0=null; Token lv_negation_0_0=null;
Token lv_connaissance_1_0=null; Token otherlv_1=null;
enterRule(); enterRule();
try { try {
// InternalGame.g:2156:2: ( ( ( (lv_negation_0_0= '!' ) )? ( (lv_connaissance_1_0= RULE_ID ) ) ) ) // InternalGame.g:2156:2: ( ( ( (lv_negation_0_0= '!' ) )? ( (otherlv_1= RULE_ID ) ) ) )
// InternalGame.g:2157:2: ( ( (lv_negation_0_0= '!' ) )? ( (lv_connaissance_1_0= RULE_ID ) ) ) // InternalGame.g:2157:2: ( ( (lv_negation_0_0= '!' ) )? ( (otherlv_1= RULE_ID ) ) )
{ {
// InternalGame.g:2157:2: ( ( (lv_negation_0_0= '!' ) )? ( (lv_connaissance_1_0= RULE_ID ) ) ) // InternalGame.g:2157:2: ( ( (lv_negation_0_0= '!' ) )? ( (otherlv_1= RULE_ID ) ) )
// InternalGame.g:2158:3: ( (lv_negation_0_0= '!' ) )? ( (lv_connaissance_1_0= RULE_ID ) ) // InternalGame.g:2158:3: ( (lv_negation_0_0= '!' ) )? ( (otherlv_1= RULE_ID ) )
{ {
// InternalGame.g:2158:3: ( (lv_negation_0_0= '!' ) )? // InternalGame.g:2158:3: ( (lv_negation_0_0= '!' ) )?
int alt33=2; int alt33=2;
@ -4922,25 +4922,20 @@ public class InternalGameParser extends AbstractInternalAntlrParser {
} }
// InternalGame.g:2172:3: ( (lv_connaissance_1_0= RULE_ID ) ) // InternalGame.g:2172:3: ( (otherlv_1= RULE_ID ) )
// InternalGame.g:2173:4: (lv_connaissance_1_0= RULE_ID ) // InternalGame.g:2173:4: (otherlv_1= RULE_ID )
{ {
// InternalGame.g:2173:4: (lv_connaissance_1_0= RULE_ID ) // InternalGame.g:2173:4: (otherlv_1= RULE_ID )
// InternalGame.g:2174:5: lv_connaissance_1_0= RULE_ID // InternalGame.g:2174:5: otherlv_1= RULE_ID
{ {
lv_connaissance_1_0=(Token)match(input,RULE_ID,FOLLOW_2);
newLeafNode(lv_connaissance_1_0, grammarAccess.getConditionConnaissanceAccess().getConnaissanceIDTerminalRuleCall_1_0());
if (current==null) { if (current==null) {
current = createModelElement(grammarAccess.getConditionConnaissanceRule()); current = createModelElement(grammarAccess.getConditionConnaissanceRule());
} }
setWithLastConsumed(
current, otherlv_1=(Token)match(input,RULE_ID,FOLLOW_2);
"connaissance",
lv_connaissance_1_0, newLeafNode(otherlv_1, grammarAccess.getConditionConnaissanceAccess().getConnaissanceConnaissanceCrossReference_1_0());
"org.eclipse.xtext.common.Terminals.ID");
} }
@ -4971,7 +4966,7 @@ public class InternalGameParser extends AbstractInternalAntlrParser {
// $ANTLR start "entryRuleConditionObjet" // $ANTLR start "entryRuleConditionObjet"
// InternalGame.g:2194:1: entryRuleConditionObjet returns [EObject current=null] : iv_ruleConditionObjet= ruleConditionObjet EOF ; // InternalGame.g:2189:1: entryRuleConditionObjet returns [EObject current=null] : iv_ruleConditionObjet= ruleConditionObjet EOF ;
public final EObject entryRuleConditionObjet() throws RecognitionException { public final EObject entryRuleConditionObjet() throws RecognitionException {
EObject current = null; EObject current = null;
@ -4979,8 +4974,8 @@ public class InternalGameParser extends AbstractInternalAntlrParser {
try { try {
// InternalGame.g:2194:55: (iv_ruleConditionObjet= ruleConditionObjet EOF ) // InternalGame.g:2189:55: (iv_ruleConditionObjet= ruleConditionObjet EOF )
// InternalGame.g:2195:2: iv_ruleConditionObjet= ruleConditionObjet EOF // InternalGame.g:2190:2: iv_ruleConditionObjet= ruleConditionObjet EOF
{ {
newCompositeNode(grammarAccess.getConditionObjetRule()); newCompositeNode(grammarAccess.getConditionObjetRule());
pushFollow(FOLLOW_1); pushFollow(FOLLOW_1);
@ -5007,11 +5002,11 @@ public class InternalGameParser extends AbstractInternalAntlrParser {
// $ANTLR start "ruleConditionObjet" // $ANTLR start "ruleConditionObjet"
// InternalGame.g:2201:1: ruleConditionObjet returns [EObject current=null] : ( ( (lv_objet_0_0= RULE_ID ) ) ( (lv_comparateur_1_0= RULE_COMPARATEUR ) ) ( (lv_nombre_2_0= RULE_INT ) ) ) ; // InternalGame.g:2196:1: ruleConditionObjet returns [EObject current=null] : ( ( (otherlv_0= RULE_ID ) ) ( (lv_comparateur_1_0= RULE_COMPARATEUR ) ) ( (lv_nombre_2_0= RULE_INT ) ) ) ;
public final EObject ruleConditionObjet() throws RecognitionException { public final EObject ruleConditionObjet() throws RecognitionException {
EObject current = null; EObject current = null;
Token lv_objet_0_0=null; Token otherlv_0=null;
Token lv_comparateur_1_0=null; Token lv_comparateur_1_0=null;
Token lv_nombre_2_0=null; Token lv_nombre_2_0=null;
@ -5019,31 +5014,26 @@ public class InternalGameParser extends AbstractInternalAntlrParser {
enterRule(); enterRule();
try { try {
// InternalGame.g:2207:2: ( ( ( (lv_objet_0_0= RULE_ID ) ) ( (lv_comparateur_1_0= RULE_COMPARATEUR ) ) ( (lv_nombre_2_0= RULE_INT ) ) ) ) // InternalGame.g:2202:2: ( ( ( (otherlv_0= RULE_ID ) ) ( (lv_comparateur_1_0= RULE_COMPARATEUR ) ) ( (lv_nombre_2_0= RULE_INT ) ) ) )
// InternalGame.g:2208:2: ( ( (lv_objet_0_0= RULE_ID ) ) ( (lv_comparateur_1_0= RULE_COMPARATEUR ) ) ( (lv_nombre_2_0= RULE_INT ) ) ) // InternalGame.g:2203:2: ( ( (otherlv_0= RULE_ID ) ) ( (lv_comparateur_1_0= RULE_COMPARATEUR ) ) ( (lv_nombre_2_0= RULE_INT ) ) )
{ {
// InternalGame.g:2208:2: ( ( (lv_objet_0_0= RULE_ID ) ) ( (lv_comparateur_1_0= RULE_COMPARATEUR ) ) ( (lv_nombre_2_0= RULE_INT ) ) ) // InternalGame.g:2203:2: ( ( (otherlv_0= RULE_ID ) ) ( (lv_comparateur_1_0= RULE_COMPARATEUR ) ) ( (lv_nombre_2_0= RULE_INT ) ) )
// InternalGame.g:2209:3: ( (lv_objet_0_0= RULE_ID ) ) ( (lv_comparateur_1_0= RULE_COMPARATEUR ) ) ( (lv_nombre_2_0= RULE_INT ) ) // InternalGame.g:2204:3: ( (otherlv_0= RULE_ID ) ) ( (lv_comparateur_1_0= RULE_COMPARATEUR ) ) ( (lv_nombre_2_0= RULE_INT ) )
{ {
// InternalGame.g:2209:3: ( (lv_objet_0_0= RULE_ID ) ) // InternalGame.g:2204:3: ( (otherlv_0= RULE_ID ) )
// InternalGame.g:2210:4: (lv_objet_0_0= RULE_ID ) // InternalGame.g:2205:4: (otherlv_0= RULE_ID )
{ {
// InternalGame.g:2210:4: (lv_objet_0_0= RULE_ID ) // InternalGame.g:2205:4: (otherlv_0= RULE_ID )
// InternalGame.g:2211:5: lv_objet_0_0= RULE_ID // InternalGame.g:2206:5: otherlv_0= RULE_ID
{ {
lv_objet_0_0=(Token)match(input,RULE_ID,FOLLOW_43);
newLeafNode(lv_objet_0_0, grammarAccess.getConditionObjetAccess().getObjetIDTerminalRuleCall_0_0());
if (current==null) { if (current==null) {
current = createModelElement(grammarAccess.getConditionObjetRule()); current = createModelElement(grammarAccess.getConditionObjetRule());
} }
setWithLastConsumed(
current, otherlv_0=(Token)match(input,RULE_ID,FOLLOW_43);
"objet",
lv_objet_0_0, newLeafNode(otherlv_0, grammarAccess.getConditionObjetAccess().getObjetObjetCrossReference_0_0());
"org.eclipse.xtext.common.Terminals.ID");
} }
@ -5051,11 +5041,11 @@ public class InternalGameParser extends AbstractInternalAntlrParser {
} }
// InternalGame.g:2227:3: ( (lv_comparateur_1_0= RULE_COMPARATEUR ) ) // InternalGame.g:2217:3: ( (lv_comparateur_1_0= RULE_COMPARATEUR ) )
// InternalGame.g:2228:4: (lv_comparateur_1_0= RULE_COMPARATEUR ) // InternalGame.g:2218:4: (lv_comparateur_1_0= RULE_COMPARATEUR )
{ {
// InternalGame.g:2228:4: (lv_comparateur_1_0= RULE_COMPARATEUR ) // InternalGame.g:2218:4: (lv_comparateur_1_0= RULE_COMPARATEUR )
// InternalGame.g:2229:5: lv_comparateur_1_0= RULE_COMPARATEUR // InternalGame.g:2219:5: lv_comparateur_1_0= RULE_COMPARATEUR
{ {
lv_comparateur_1_0=(Token)match(input,RULE_COMPARATEUR,FOLLOW_12); lv_comparateur_1_0=(Token)match(input,RULE_COMPARATEUR,FOLLOW_12);
@ -5077,11 +5067,11 @@ public class InternalGameParser extends AbstractInternalAntlrParser {
} }
// InternalGame.g:2245:3: ( (lv_nombre_2_0= RULE_INT ) ) // InternalGame.g:2235:3: ( (lv_nombre_2_0= RULE_INT ) )
// InternalGame.g:2246:4: (lv_nombre_2_0= RULE_INT ) // InternalGame.g:2236:4: (lv_nombre_2_0= RULE_INT )
{ {
// InternalGame.g:2246:4: (lv_nombre_2_0= RULE_INT ) // InternalGame.g:2236:4: (lv_nombre_2_0= RULE_INT )
// InternalGame.g:2247:5: lv_nombre_2_0= RULE_INT // InternalGame.g:2237:5: lv_nombre_2_0= RULE_INT
{ {
lv_nombre_2_0=(Token)match(input,RULE_INT,FOLLOW_2); lv_nombre_2_0=(Token)match(input,RULE_INT,FOLLOW_2);

View file

@ -171,7 +171,7 @@ public class GameSemanticSequencer extends AbstractDelegatingSemanticSequencer {
* ConditionConnaissance returns ConditionConnaissance * ConditionConnaissance returns ConditionConnaissance
* *
* Constraint: * Constraint:
* (negation='!'? connaissance=ID) * (negation='!'? connaissance=[Connaissance|ID])
*/ */
protected void sequence_ConditionConnaissance(ISerializationContext context, ConditionConnaissance semanticObject) { protected void sequence_ConditionConnaissance(ISerializationContext context, ConditionConnaissance semanticObject) {
genericSequencer.createSequence(context, semanticObject); genericSequencer.createSequence(context, semanticObject);
@ -196,7 +196,7 @@ public class GameSemanticSequencer extends AbstractDelegatingSemanticSequencer {
* ConditionObjet returns ConditionObjet * ConditionObjet returns ConditionObjet
* *
* Constraint: * Constraint:
* (objet=ID comparateur=COMPARATEUR nombre=INT) * (objet=[Objet|ID] comparateur=COMPARATEUR nombre=INT)
*/ */
protected void sequence_ConditionObjet(ISerializationContext context, ConditionObjet semanticObject) { protected void sequence_ConditionObjet(ISerializationContext context, ConditionObjet semanticObject) {
if (errorAcceptor != null) { if (errorAcceptor != null) {
@ -208,7 +208,7 @@ public class GameSemanticSequencer extends AbstractDelegatingSemanticSequencer {
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, GamePackage.Literals.CONDITION_OBJET__NOMBRE)); errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, GamePackage.Literals.CONDITION_OBJET__NOMBRE));
} }
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
feeder.accept(grammarAccess.getConditionObjetAccess().getObjetIDTerminalRuleCall_0_0(), semanticObject.getObjet()); feeder.accept(grammarAccess.getConditionObjetAccess().getObjetObjetIDTerminalRuleCall_0_0_1(), semanticObject.eGet(GamePackage.Literals.CONDITION_OBJET__OBJET, false));
feeder.accept(grammarAccess.getConditionObjetAccess().getComparateurCOMPARATEURTerminalRuleCall_1_0(), semanticObject.getComparateur()); feeder.accept(grammarAccess.getConditionObjetAccess().getComparateurCOMPARATEURTerminalRuleCall_1_0(), semanticObject.getComparateur());
feeder.accept(grammarAccess.getConditionObjetAccess().getNombreINTTerminalRuleCall_2_0(), semanticObject.getNombre()); feeder.accept(grammarAccess.getConditionObjetAccess().getNombreINTTerminalRuleCall_2_0(), semanticObject.getNombre());
feeder.finish(); feeder.finish();

View file

@ -1564,13 +1564,14 @@ public class GameGrammarAccess extends AbstractElementFinder.AbstractGrammarElem
private final Assignment cNegationAssignment_0 = (Assignment)cGroup.eContents().get(0); private final Assignment cNegationAssignment_0 = (Assignment)cGroup.eContents().get(0);
private final Keyword cNegationExclamationMarkKeyword_0_0 = (Keyword)cNegationAssignment_0.eContents().get(0); private final Keyword cNegationExclamationMarkKeyword_0_0 = (Keyword)cNegationAssignment_0.eContents().get(0);
private final Assignment cConnaissanceAssignment_1 = (Assignment)cGroup.eContents().get(1); private final Assignment cConnaissanceAssignment_1 = (Assignment)cGroup.eContents().get(1);
private final RuleCall cConnaissanceIDTerminalRuleCall_1_0 = (RuleCall)cConnaissanceAssignment_1.eContents().get(0); private final CrossReference cConnaissanceConnaissanceCrossReference_1_0 = (CrossReference)cConnaissanceAssignment_1.eContents().get(0);
private final RuleCall cConnaissanceConnaissanceIDTerminalRuleCall_1_0_1 = (RuleCall)cConnaissanceConnaissanceCrossReference_1_0.eContents().get(1);
//ConditionConnaissance: //ConditionConnaissance:
// negation='!'? connaissance=ID; // negation='!'? connaissance=[Connaissance];
@Override public ParserRule getRule() { return rule; } @Override public ParserRule getRule() { return rule; }
//negation='!'? connaissance=ID //negation='!'? connaissance=[Connaissance]
public Group getGroup() { return cGroup; } public Group getGroup() { return cGroup; }
//negation='!'? //negation='!'?
@ -1579,34 +1580,41 @@ public class GameGrammarAccess extends AbstractElementFinder.AbstractGrammarElem
//'!' //'!'
public Keyword getNegationExclamationMarkKeyword_0_0() { return cNegationExclamationMarkKeyword_0_0; } public Keyword getNegationExclamationMarkKeyword_0_0() { return cNegationExclamationMarkKeyword_0_0; }
//connaissance=ID //connaissance=[Connaissance]
public Assignment getConnaissanceAssignment_1() { return cConnaissanceAssignment_1; } public Assignment getConnaissanceAssignment_1() { return cConnaissanceAssignment_1; }
//[Connaissance]
public CrossReference getConnaissanceConnaissanceCrossReference_1_0() { return cConnaissanceConnaissanceCrossReference_1_0; }
//ID //ID
public RuleCall getConnaissanceIDTerminalRuleCall_1_0() { return cConnaissanceIDTerminalRuleCall_1_0; } public RuleCall getConnaissanceConnaissanceIDTerminalRuleCall_1_0_1() { return cConnaissanceConnaissanceIDTerminalRuleCall_1_0_1; }
} }
public class ConditionObjetElements extends AbstractParserRuleElementFinder { public class ConditionObjetElements extends AbstractParserRuleElementFinder {
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "fr.n7.game.xtext.Game.ConditionObjet"); private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "fr.n7.game.xtext.Game.ConditionObjet");
private final Group cGroup = (Group)rule.eContents().get(1); private final Group cGroup = (Group)rule.eContents().get(1);
private final Assignment cObjetAssignment_0 = (Assignment)cGroup.eContents().get(0); private final Assignment cObjetAssignment_0 = (Assignment)cGroup.eContents().get(0);
private final RuleCall cObjetIDTerminalRuleCall_0_0 = (RuleCall)cObjetAssignment_0.eContents().get(0); private final CrossReference cObjetObjetCrossReference_0_0 = (CrossReference)cObjetAssignment_0.eContents().get(0);
private final RuleCall cObjetObjetIDTerminalRuleCall_0_0_1 = (RuleCall)cObjetObjetCrossReference_0_0.eContents().get(1);
private final Assignment cComparateurAssignment_1 = (Assignment)cGroup.eContents().get(1); private final Assignment cComparateurAssignment_1 = (Assignment)cGroup.eContents().get(1);
private final RuleCall cComparateurCOMPARATEURTerminalRuleCall_1_0 = (RuleCall)cComparateurAssignment_1.eContents().get(0); private final RuleCall cComparateurCOMPARATEURTerminalRuleCall_1_0 = (RuleCall)cComparateurAssignment_1.eContents().get(0);
private final Assignment cNombreAssignment_2 = (Assignment)cGroup.eContents().get(2); private final Assignment cNombreAssignment_2 = (Assignment)cGroup.eContents().get(2);
private final RuleCall cNombreINTTerminalRuleCall_2_0 = (RuleCall)cNombreAssignment_2.eContents().get(0); private final RuleCall cNombreINTTerminalRuleCall_2_0 = (RuleCall)cNombreAssignment_2.eContents().get(0);
//ConditionObjet: //ConditionObjet:
// objet=ID comparateur=COMPARATEUR nombre=INT; // objet=[Objet] comparateur=COMPARATEUR nombre=INT;
@Override public ParserRule getRule() { return rule; } @Override public ParserRule getRule() { return rule; }
//objet=ID comparateur=COMPARATEUR nombre=INT //objet=[Objet] comparateur=COMPARATEUR nombre=INT
public Group getGroup() { return cGroup; } public Group getGroup() { return cGroup; }
//objet=ID //objet=[Objet]
public Assignment getObjetAssignment_0() { return cObjetAssignment_0; } public Assignment getObjetAssignment_0() { return cObjetAssignment_0; }
//[Objet]
public CrossReference getObjetObjetCrossReference_0_0() { return cObjetObjetCrossReference_0_0; }
//ID //ID
public RuleCall getObjetIDTerminalRuleCall_0_0() { return cObjetIDTerminalRuleCall_0_0; } public RuleCall getObjetObjetIDTerminalRuleCall_0_0_1() { return cObjetObjetIDTerminalRuleCall_0_0_1; }
//comparateur=COMPARATEUR //comparateur=COMPARATEUR
public Assignment getComparateurAssignment_1() { return cComparateurAssignment_1; } public Assignment getComparateurAssignment_1() { return cComparateurAssignment_1; }
@ -1911,7 +1919,7 @@ public class GameGrammarAccess extends AbstractElementFinder.AbstractGrammarElem
} }
//ConditionConnaissance: //ConditionConnaissance:
// negation='!'? connaissance=ID; // negation='!'? connaissance=[Connaissance];
public ConditionConnaissanceElements getConditionConnaissanceAccess() { public ConditionConnaissanceElements getConditionConnaissanceAccess() {
return pConditionConnaissance; return pConditionConnaissance;
} }
@ -1921,7 +1929,7 @@ public class GameGrammarAccess extends AbstractElementFinder.AbstractGrammarElem
} }
//ConditionObjet: //ConditionObjet:
// objet=ID comparateur=COMPARATEUR nombre=INT; // objet=[Objet] comparateur=COMPARATEUR nombre=INT;
public ConditionObjetElements getConditionObjetAccess() { public ConditionObjetElements getConditionObjetAccess() {
return pConditionObjet; return pConditionObjet;
} }

View file

@ -115,11 +115,11 @@ ConditionBoolean:
; ;
ConditionConnaissance: ConditionConnaissance:
(negation='!')? connaissance=ID (negation='!')? connaissance=[Connaissance]
; ;
ConditionObjet: ConditionObjet:
objet=ID comparateur=COMPARATEUR nombre=INT objet=[Objet] comparateur=COMPARATEUR nombre=INT
; ;
terminal COMPARATEUR: terminal COMPARATEUR: