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