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