projet-genie-logiciel-systeme/workspace/fr.n7.xtext.game/src-gen/fr/n7/xtext/serializer/GAMESemanticSequencer.java

412 lines
14 KiB
Java
Raw Normal View History

2021-11-30 17:25:45 +00:00
/*
* generated by Xtext 2.23.0
*/
2021-12-03 10:28:42 +00:00
package fr.n7.xtext.serializer;
2021-11-30 17:25:45 +00:00
import com.google.inject.Inject;
2021-12-03 10:28:42 +00:00
import fr.n7.xtext.gAME.Chemin;
import fr.n7.xtext.gAME.Condition;
import fr.n7.xtext.gAME.ConditionConnaissance;
import fr.n7.xtext.gAME.ConditionEt;
import fr.n7.xtext.gAME.ConditionObjet;
import fr.n7.xtext.gAME.Connaissance;
import fr.n7.xtext.gAME.Description;
import fr.n7.xtext.gAME.Explorateur;
import fr.n7.xtext.gAME.GAMEPackage;
import fr.n7.xtext.gAME.Interaction;
import fr.n7.xtext.gAME.Jeu;
import fr.n7.xtext.gAME.Lieu;
import fr.n7.xtext.gAME.NOTConditionConnaissance;
2021-12-03 10:57:43 +00:00
import fr.n7.xtext.gAME.Nom;
2021-12-03 10:28:42 +00:00
import fr.n7.xtext.gAME.Objet;
import fr.n7.xtext.gAME.Personne;
import fr.n7.xtext.gAME.Territoire;
import fr.n7.xtext.gAME.Transformation;
import fr.n7.xtext.services.GAMEGrammarAccess;
2021-11-30 17:25:45 +00:00
import java.util.Set;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.xtext.Action;
import org.eclipse.xtext.Parameter;
import org.eclipse.xtext.ParserRule;
import org.eclipse.xtext.serializer.ISerializationContext;
import org.eclipse.xtext.serializer.acceptor.SequenceFeeder;
import org.eclipse.xtext.serializer.sequencer.AbstractDelegatingSemanticSequencer;
import org.eclipse.xtext.serializer.sequencer.ITransientValueService.ValueTransient;
@SuppressWarnings("all")
2021-12-03 07:37:31 +00:00
public class GAMESemanticSequencer extends AbstractDelegatingSemanticSequencer {
2021-11-30 17:25:45 +00:00
@Inject
2021-12-03 07:37:31 +00:00
private GAMEGrammarAccess grammarAccess;
2021-11-30 17:25:45 +00:00
@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
EPackage epackage = semanticObject.eClass().getEPackage();
ParserRule rule = context.getParserRule();
Action action = context.getAssignedAction();
Set<Parameter> parameters = context.getEnabledBooleanParameters();
2021-12-03 08:38:29 +00:00
if (epackage == GAMEPackage.eINSTANCE)
2021-11-30 17:25:45 +00:00
switch (semanticObject.eClass().getClassifierID()) {
2021-12-03 08:38:29 +00:00
case GAMEPackage.ACTION:
2021-12-03 10:28:42 +00:00
sequence_Action(context, (fr.n7.xtext.gAME.Action) semanticObject);
2021-11-30 17:25:45 +00:00
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.CHEMIN:
2021-11-30 17:25:45 +00:00
sequence_Chemin(context, (Chemin) semanticObject);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.CONDITION:
2021-11-30 17:25:45 +00:00
sequence_Condition(context, (Condition) semanticObject);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.CONDITION_CONNAISSANCE:
2021-11-30 17:25:45 +00:00
sequence_ConditionConnaissance(context, (ConditionConnaissance) semanticObject);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.CONDITION_ET:
2021-11-30 17:25:45 +00:00
sequence_ConditionEt(context, (ConditionEt) semanticObject);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.CONDITION_OBJET:
2021-11-30 17:25:45 +00:00
sequence_ConditionObjet(context, (ConditionObjet) semanticObject);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.CONNAISSANCE:
2021-11-30 17:25:45 +00:00
sequence_Connaissance(context, (Connaissance) semanticObject);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.DESCRIPTION:
2021-11-30 17:25:45 +00:00
sequence_Description(context, (Description) semanticObject);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.EXPLORATEUR:
2021-11-30 17:25:45 +00:00
sequence_Explorateur(context, (Explorateur) semanticObject);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.INTERACTION:
sequence_Interaction(context, (Interaction) semanticObject);
2021-11-30 17:25:45 +00:00
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.JEU:
2021-11-30 17:25:45 +00:00
sequence_Jeu(context, (Jeu) semanticObject);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.LIEU:
2021-11-30 17:25:45 +00:00
sequence_Lieu(context, (Lieu) semanticObject);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.NOT_CONDITION_CONNAISSANCE:
sequence_NOTConditionConnaissance(context, (NOTConditionConnaissance) semanticObject);
return;
2021-12-03 10:57:43 +00:00
case GAMEPackage.NOM:
sequence_Nom(context, (Nom) semanticObject);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.OBJET:
2021-11-30 17:25:45 +00:00
sequence_Objet(context, (Objet) semanticObject);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.PERSONNE:
2021-11-30 17:25:45 +00:00
sequence_Personne(context, (Personne) semanticObject);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.TERRITOIRE:
2021-11-30 17:25:45 +00:00
sequence_Territoire(context, (Territoire) semanticObject);
return;
2021-12-03 08:38:29 +00:00
case GAMEPackage.TRANSFORMATION:
2021-11-30 17:25:45 +00:00
sequence_Transformation(context, (Transformation) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
/**
* Contexts:
* Action returns Action
*
* Constraint:
* (
* visible=Condition
2021-12-03 09:02:04 +00:00
* finInteraction=Condition
2021-12-03 10:57:43 +00:00
* (connaissances+=Nom connaissances+=Nom*)?
* (objetsRecus+=Nom objetsRecus+=Nom*)?
* (objetsConso+=Nom objetsConso+=Nom*)?
2021-12-03 09:02:04 +00:00
* descriptions+=Description
* descriptions+=Description*
* )
2021-11-30 17:25:45 +00:00
*/
2021-12-03 10:28:42 +00:00
protected void sequence_Action(ISerializationContext context, fr.n7.xtext.gAME.Action semanticObject) {
2021-11-30 17:25:45 +00:00
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* Chemin returns Chemin
*
* Constraint:
* (
2021-12-03 10:57:43 +00:00
* lieuIn=Nom
* lieuOut=Nom
2021-11-30 17:25:45 +00:00
* ouvert=Condition
* visible=Condition
2021-11-30 17:25:45 +00:00
* obligatoire=Condition
2021-12-03 10:57:43 +00:00
* (connaissances+=Nom connaissances+=Nom*)?
* (objetsRecus+=Nom objetsRecus+=Nom*)?
* (objetsConso+=Nom objetsConso+=Nom*)?
2021-12-03 08:38:29 +00:00
* descriptions+=Description
* descriptions+=Description*
2021-11-30 17:25:45 +00:00
* )
*/
protected void sequence_Chemin(ISerializationContext context, Chemin semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* ConditionTest returns ConditionConnaissance
* ConditionConnaissance returns ConditionConnaissance
*
* Constraint:
2021-12-03 10:57:43 +00:00
* connaissance=Nom
2021-11-30 17:25:45 +00:00
*/
protected void sequence_ConditionConnaissance(ISerializationContext context, ConditionConnaissance semanticObject) {
if (errorAcceptor != null) {
2021-12-03 08:38:29 +00:00
if (transientValues.isValueTransient(semanticObject, GAMEPackage.Literals.CONDITION_CONNAISSANCE__CONNAISSANCE) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, GAMEPackage.Literals.CONDITION_CONNAISSANCE__CONNAISSANCE));
2021-11-30 17:25:45 +00:00
}
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
2021-12-03 10:57:43 +00:00
feeder.accept(grammarAccess.getConditionConnaissanceAccess().getConnaissanceNomParserRuleCall_0(), semanticObject.getConnaissance());
2021-11-30 17:25:45 +00:00
feeder.finish();
}
/**
* Contexts:
* ConditionEt returns ConditionEt
*
* Constraint:
* (conditionTest+=ConditionTest conditionTest+=ConditionTest*)
2021-11-30 17:25:45 +00:00
*/
protected void sequence_ConditionEt(ISerializationContext context, ConditionEt semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* ConditionTest returns ConditionObjet
* ConditionObjet returns ConditionObjet
*
* Constraint:
2021-12-03 10:57:43 +00:00
* (objet=Nom comparateur=Comparateur nombre=INT)
2021-11-30 17:25:45 +00:00
*/
protected void sequence_ConditionObjet(ISerializationContext context, ConditionObjet semanticObject) {
if (errorAcceptor != null) {
2021-12-03 08:38:29 +00:00
if (transientValues.isValueTransient(semanticObject, GAMEPackage.Literals.CONDITION_OBJET__OBJET) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, GAMEPackage.Literals.CONDITION_OBJET__OBJET));
if (transientValues.isValueTransient(semanticObject, GAMEPackage.Literals.CONDITION_OBJET__COMPARATEUR) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, GAMEPackage.Literals.CONDITION_OBJET__COMPARATEUR));
if (transientValues.isValueTransient(semanticObject, GAMEPackage.Literals.CONDITION_OBJET__NOMBRE) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, GAMEPackage.Literals.CONDITION_OBJET__NOMBRE));
2021-11-30 17:25:45 +00:00
}
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
2021-12-03 10:57:43 +00:00
feeder.accept(grammarAccess.getConditionObjetAccess().getObjetNomParserRuleCall_0_0(), semanticObject.getObjet());
2021-11-30 17:25:45 +00:00
feeder.accept(grammarAccess.getConditionObjetAccess().getComparateurComparateurParserRuleCall_1_0(), semanticObject.getComparateur());
feeder.accept(grammarAccess.getConditionObjetAccess().getNombreINTTerminalRuleCall_2_0(), semanticObject.getNombre());
feeder.finish();
}
/**
* Contexts:
* Condition returns Condition
*
* Constraint:
* (condition+=ConditionEt condition+=ConditionEt*)
2021-11-30 17:25:45 +00:00
*/
protected void sequence_Condition(ISerializationContext context, Condition semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* Connaissance returns Connaissance
*
* Constraint:
2021-12-03 10:57:43 +00:00
* (nom=Nom visible=Condition descriptions+=Description descriptions+=Description*)
2021-11-30 17:25:45 +00:00
*/
protected void sequence_Connaissance(ISerializationContext context, Connaissance semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* Description returns Description
*
* Constraint:
* (texte=STRING condition=Condition)
*/
protected void sequence_Description(ISerializationContext context, Description semanticObject) {
if (errorAcceptor != null) {
2021-12-03 08:38:29 +00:00
if (transientValues.isValueTransient(semanticObject, GAMEPackage.Literals.DESCRIPTION__TEXTE) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, GAMEPackage.Literals.DESCRIPTION__TEXTE));
if (transientValues.isValueTransient(semanticObject, GAMEPackage.Literals.DESCRIPTION__CONDITION) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, GAMEPackage.Literals.DESCRIPTION__CONDITION));
2021-11-30 17:25:45 +00:00
}
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
feeder.accept(grammarAccess.getDescriptionAccess().getTexteSTRINGTerminalRuleCall_3_0(), semanticObject.getTexte());
feeder.accept(grammarAccess.getDescriptionAccess().getConditionConditionParserRuleCall_7_0(), semanticObject.getCondition());
2021-11-30 17:25:45 +00:00
feeder.finish();
}
/**
* Contexts:
* Explorateur returns Explorateur
*
* Constraint:
2021-12-03 10:57:43 +00:00
* (tailleInventaire=INT (connaissances+=Nom connaissances+=Nom*)? (objets+=Nom objets+=Nom*)?)
2021-11-30 17:25:45 +00:00
*/
protected void sequence_Explorateur(ISerializationContext context, Explorateur semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* Interaction returns Interaction
2021-11-30 17:25:45 +00:00
*
* Constraint:
* (
* visible=Condition
2021-12-03 10:57:43 +00:00
* (connaissances+=Nom connaissances+=Nom*)?
* (objetsRecus+=Nom objetsRecus+=Nom*)?
* (objetsConso+=Nom objetsRecus+=Nom*)?
2021-12-03 08:38:29 +00:00
* actions+=Action
* actions+=Action*
* )
2021-11-30 17:25:45 +00:00
*/
protected void sequence_Interaction(ISerializationContext context, Interaction semanticObject) {
2021-11-30 17:25:45 +00:00
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* Jeu returns Jeu
*
* Constraint:
* (
* explorateur=Explorateur
* territoire=Territoire
2021-12-03 08:38:29 +00:00
* (objets+=Objet objets+=Objet*)?
* (connaissances+=Connaissance connaissances+=Connaissance*)?
* (personnes+=Personne personnes+=Personne*)?
* (transformations+=Transformation transformations+=Transformation*)?
2021-11-30 17:25:45 +00:00
* )
*/
protected void sequence_Jeu(ISerializationContext context, Jeu semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* Lieu returns Lieu
*
* Constraint:
* (
2021-12-03 10:57:43 +00:00
* nom=Nom
2021-11-30 17:25:45 +00:00
* deposable=Condition
* depart=Condition
* fin=Condition
2021-12-03 10:57:43 +00:00
* (personnes+=Nom personnes+=Nom*)?
2021-12-03 08:38:29 +00:00
* descriptions+=Description
* descriptions+=Description*
2021-12-03 10:57:43 +00:00
* (objets+=Nom objets+=Nom*)?
* (connaissances+=Nom connaissances+=Nom*)?
2021-11-30 17:25:45 +00:00
* )
*/
protected void sequence_Lieu(ISerializationContext context, Lieu semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* ConditionTest returns NOTConditionConnaissance
* NOTConditionConnaissance returns NOTConditionConnaissance
*
* Constraint:
2021-12-03 10:57:43 +00:00
* connaissance=Nom
*/
protected void sequence_NOTConditionConnaissance(ISerializationContext context, NOTConditionConnaissance semanticObject) {
if (errorAcceptor != null) {
2021-12-03 08:38:29 +00:00
if (transientValues.isValueTransient(semanticObject, GAMEPackage.Literals.NOT_CONDITION_CONNAISSANCE__CONNAISSANCE) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, GAMEPackage.Literals.NOT_CONDITION_CONNAISSANCE__CONNAISSANCE));
}
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
2021-12-03 10:57:43 +00:00
feeder.accept(grammarAccess.getNOTConditionConnaissanceAccess().getConnaissanceNomParserRuleCall_1_0(), semanticObject.getConnaissance());
feeder.finish();
}
/**
* Contexts:
* Nom returns Nom
*
* Constraint:
* nom=STRING
*/
protected void sequence_Nom(ISerializationContext context, Nom semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, GAMEPackage.Literals.NOM__NOM) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, GAMEPackage.Literals.NOM__NOM));
}
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
feeder.accept(grammarAccess.getNomAccess().getNomSTRINGTerminalRuleCall_0(), semanticObject.getNom());
feeder.finish();
}
2021-11-30 17:25:45 +00:00
/**
* Contexts:
* Objet returns Objet
*
* Constraint:
2021-12-03 10:57:43 +00:00
* (nom=Nom taille=INT visible=Condition descriptions+=Description descriptions+=Description*)
2021-11-30 17:25:45 +00:00
*/
protected void sequence_Objet(ISerializationContext context, Objet semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* Personne returns Personne
*
* Constraint:
2021-12-03 10:57:43 +00:00
* (nom=Nom visible=Condition obligatoire=Condition (interactions+=Interaction interactions+=Interaction*)?)
2021-11-30 17:25:45 +00:00
*/
protected void sequence_Personne(ISerializationContext context, Personne semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* Territoire returns Territoire
*
* Constraint:
* ((lieux+=Lieu lieux+=Lieu*)? (chemins+=Chemin chemins+=Chemin*)?)
2021-11-30 17:25:45 +00:00
*/
protected void sequence_Territoire(ISerializationContext context, Territoire semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* Transformation returns Transformation
*
* Constraint:
2021-12-03 10:57:43 +00:00
* (condition=Condition (objetsIn+=Nom objetsIn+=Nom*)? (objetsOut+=Nom objetsOut+=Nom*)?)
2021-11-30 17:25:45 +00:00
*/
protected void sequence_Transformation(ISerializationContext context, Transformation semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
}