2021-11-29 19:29:53 +00:00
|
|
|
grammar xtext.Game with org.eclipse.xtext.common.Terminals
|
|
|
|
|
|
|
|
generate game "http://www.Game.xtext"
|
|
|
|
|
|
|
|
Jeu:
|
2021-11-30 17:25:45 +00:00
|
|
|
'Jeu'
|
|
|
|
'{'
|
|
|
|
explorateur=Explorateur
|
|
|
|
territoire=Territoire
|
|
|
|
objets+=Objet*
|
|
|
|
connaissances+=Connaissance*
|
|
|
|
personnes+=Personne*
|
|
|
|
transformations+=Transformation*
|
|
|
|
'}'
|
2021-11-29 19:29:53 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
Explorateur:
|
2021-11-30 17:25:45 +00:00
|
|
|
'Explorateur'
|
|
|
|
'{'
|
|
|
|
'taille' '=' tailleTotaleMax=INT
|
|
|
|
connaissances+=Nom*
|
|
|
|
objets+=Nom*
|
|
|
|
'}'
|
2021-11-29 19:29:53 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
Territoire:
|
2021-11-30 17:25:45 +00:00
|
|
|
'Territoire'
|
|
|
|
'{'
|
|
|
|
'lieux' ':' lieux+=Lieu+
|
|
|
|
'chemins' ':' chemins+=Chemin*
|
|
|
|
'}'
|
2021-11-29 19:29:53 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
Lieu:
|
2021-11-30 17:25:45 +00:00
|
|
|
'Lieu' nom=Nom
|
|
|
|
'{'
|
|
|
|
connaissances+=Nom*
|
|
|
|
personnes+=Personne*
|
|
|
|
objets+=Nom*
|
|
|
|
deposable=Condition
|
|
|
|
descriptions+=Description+
|
|
|
|
depart=Condition
|
|
|
|
fin=Condition
|
|
|
|
'}'
|
2021-11-29 19:29:53 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
Chemin:
|
2021-11-30 17:25:45 +00:00
|
|
|
'Chemin'
|
|
|
|
'{'
|
|
|
|
lieuIn=Nom '->' lieuOut=Nom
|
|
|
|
connaissances+=Nom*
|
|
|
|
objets+=Nom*
|
|
|
|
objetsConso+=Nom*
|
|
|
|
ouvert=Condition
|
|
|
|
ferme=Condition
|
|
|
|
obligatoire=Condition
|
|
|
|
descriptions+=Description+
|
|
|
|
'}'
|
2021-11-29 19:29:53 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
Objet:
|
2021-11-30 17:25:45 +00:00
|
|
|
'Objet' nom=Nom
|
|
|
|
'{'
|
|
|
|
taille=INT
|
|
|
|
visible=Condition
|
|
|
|
descriptions+=Description+
|
|
|
|
'}'
|
2021-11-29 19:29:53 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
Transformation:
|
2021-11-30 17:25:45 +00:00
|
|
|
'Transformation'
|
|
|
|
'{'
|
|
|
|
condition=Condition
|
|
|
|
objetSource+=Nom+ '->' objetsResultats+=Nom+
|
|
|
|
'}'
|
2021-11-29 19:29:53 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
Connaissance:
|
2021-11-30 17:25:45 +00:00
|
|
|
'Connaissance' nom=Nom
|
|
|
|
'{'
|
|
|
|
visible=Condition
|
|
|
|
descriptions+=Description+
|
|
|
|
'}'
|
2021-11-29 19:29:53 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
Personne:
|
2021-11-30 17:25:45 +00:00
|
|
|
'Personne'
|
|
|
|
'{'
|
|
|
|
visible=Condition
|
|
|
|
obligatoire=Condition
|
|
|
|
interractions+=Interraction+
|
|
|
|
'}'
|
2021-11-29 19:29:53 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
Interraction:
|
2021-11-30 17:25:45 +00:00
|
|
|
'Interraction'
|
|
|
|
'{'
|
|
|
|
actions+=Action+
|
|
|
|
connaissances+=Nom*
|
|
|
|
objets+=Nom*
|
|
|
|
visible=Condition
|
|
|
|
'}'
|
2021-11-29 19:29:53 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
Action:
|
2021-11-30 17:25:45 +00:00
|
|
|
'Action'
|
|
|
|
'{'
|
|
|
|
connaissances+=Nom*
|
|
|
|
objets+=Nom*
|
|
|
|
objetsConso+=Nom*
|
|
|
|
visible=Condition
|
|
|
|
finInterraction=Condition
|
|
|
|
'}'
|
2021-11-29 19:29:53 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
Description:
|
2021-11-30 17:25:45 +00:00
|
|
|
'Description'
|
|
|
|
'{'
|
|
|
|
texte=STRING
|
|
|
|
condition=Condition
|
|
|
|
'}'
|
2021-11-29 19:29:53 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
Condition:
|
2021-11-30 17:25:45 +00:00
|
|
|
'Condition'
|
|
|
|
'{'
|
|
|
|
condition+=[ConditionEt] ( '||' condition+=[ConditionEt] )*
|
|
|
|
'}'
|
2021-11-29 19:29:53 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
ConditionEt:
|
2021-11-30 17:25:45 +00:00
|
|
|
'('
|
|
|
|
conditionTest+=[ConditionTest] ( '&&' conditonTest+=[ConditionTest] )*
|
|
|
|
')'
|
2021-11-29 19:29:53 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
ConditionTest:
|
2021-11-30 17:25:45 +00:00
|
|
|
ConditionConnaissance | AntiConditionConnaissance | ConditionObjet
|
2021-11-29 19:29:53 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
ConditionConnaissance:
|
2021-11-30 17:25:45 +00:00
|
|
|
connaissance=Nom
|
2021-11-29 19:29:53 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
AntiConditionConnaissance:
|
2021-11-30 17:25:45 +00:00
|
|
|
'!' connaissance=Nom
|
2021-11-29 19:29:53 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
ConditionObjet:
|
2021-11-30 17:25:45 +00:00
|
|
|
objet=STRING
|
|
|
|
comparateur=Comparateur
|
|
|
|
nombre=INT
|
2021-11-29 19:29:53 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
Comparateur:
|
2021-11-30 17:25:45 +00:00
|
|
|
'<' | '>' | '=' | '<=' | '>='
|
2021-11-29 19:29:53 +00:00
|
|
|
;
|
2021-11-30 17:25:45 +00:00
|
|
|
|
|
|
|
Nom:
|
|
|
|
STRING
|
|
|
|
;
|