/* * generated by Xtext 2.23.0 */ package fr.n7.serializer; import com.google.inject.Inject; import fr.n7.game.Chemin; import fr.n7.game.Condition; import fr.n7.game.ConditionConnaissance; import fr.n7.game.ConditionEt; import fr.n7.game.ConditionObjet; import fr.n7.game.Connaissance; import fr.n7.game.Description; import fr.n7.game.Explorateur; import fr.n7.game.GamePackage; import fr.n7.game.Interaction; import fr.n7.game.Jeu; import fr.n7.game.Lieu; import fr.n7.game.NOTConditionConnaissance; import fr.n7.game.Objet; import fr.n7.game.Personne; import fr.n7.game.Territoire; import fr.n7.game.Transformation; import fr.n7.services.GAMEGrammarAccess; 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") public class GAMESemanticSequencer extends AbstractDelegatingSemanticSequencer { @Inject private GAMEGrammarAccess grammarAccess; @Override public void sequence(ISerializationContext context, EObject semanticObject) { EPackage epackage = semanticObject.eClass().getEPackage(); ParserRule rule = context.getParserRule(); Action action = context.getAssignedAction(); Set parameters = context.getEnabledBooleanParameters(); if (epackage == GamePackage.eINSTANCE) switch (semanticObject.eClass().getClassifierID()) { case GamePackage.ACTION: sequence_Action(context, (fr.n7.game.Action) semanticObject); return; case GamePackage.CHEMIN: sequence_Chemin(context, (Chemin) semanticObject); return; case GamePackage.CONDITION: sequence_Condition(context, (Condition) semanticObject); return; case GamePackage.CONDITION_CONNAISSANCE: sequence_ConditionConnaissance(context, (ConditionConnaissance) semanticObject); return; case GamePackage.CONDITION_ET: sequence_ConditionEt(context, (ConditionEt) semanticObject); return; case GamePackage.CONDITION_OBJET: sequence_ConditionObjet(context, (ConditionObjet) semanticObject); return; case GamePackage.CONNAISSANCE: sequence_Connaissance(context, (Connaissance) semanticObject); return; case GamePackage.DESCRIPTION: sequence_Description(context, (Description) semanticObject); return; case GamePackage.EXPLORATEUR: sequence_Explorateur(context, (Explorateur) semanticObject); return; case GamePackage.INTERACTION: sequence_Interaction(context, (Interaction) semanticObject); return; case GamePackage.JEU: sequence_Jeu(context, (Jeu) semanticObject); return; case GamePackage.LIEU: sequence_Lieu(context, (Lieu) semanticObject); return; case GamePackage.NOT_CONDITION_CONNAISSANCE: sequence_NOTConditionConnaissance(context, (NOTConditionConnaissance) semanticObject); return; case GamePackage.OBJET: sequence_Objet(context, (Objet) semanticObject); return; case GamePackage.PERSONNE: sequence_Personne(context, (Personne) semanticObject); return; case GamePackage.TERRITOIRE: sequence_Territoire(context, (Territoire) semanticObject); return; case GamePackage.TRANSFORMATION: sequence_Transformation(context, (Transformation) semanticObject); return; } if (errorAcceptor != null) errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context)); } /** * Contexts: * Action returns Action * * Constraint: * ( * descriptions+=Description * descriptions+=Description* * visible=Condition * (connaissances+=Nom connaissances+=Nom*)? * (objetsRecus+=Nom objetsRecus+=Nom*)? * (objetsConso+=Nom objetsConso+=Nom*)? * finInteraction=Condition * ) */ protected void sequence_Action(ISerializationContext context, fr.n7.game.Action semanticObject) { genericSequencer.createSequence(context, semanticObject); } /** * Contexts: * Chemin returns Chemin * * Constraint: * ( * lieuIn=Nom * lieuOut=Nom * ouvert=Condition * visible=Condition * obligatoire=Condition * (connaissances+=Nom connaissances+=Nom*)? * (objetsRecus+=Nom objetsRecus+=Nom*)? * (objetsConso+=Nom objetsConso+=Nom*)? * descriptions+=Description+ * ) */ protected void sequence_Chemin(ISerializationContext context, Chemin semanticObject) { genericSequencer.createSequence(context, semanticObject); } /** * Contexts: * ConditionTest returns ConditionConnaissance * ConditionConnaissance returns ConditionConnaissance * * Constraint: * connaissance=Nom */ protected void sequence_ConditionConnaissance(ISerializationContext context, ConditionConnaissance semanticObject) { if (errorAcceptor != null) { if (transientValues.isValueTransient(semanticObject, GamePackage.Literals.CONDITION_CONNAISSANCE__CONNAISSANCE) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, GamePackage.Literals.CONDITION_CONNAISSANCE__CONNAISSANCE)); } SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); feeder.accept(grammarAccess.getConditionConnaissanceAccess().getConnaissanceNomParserRuleCall_0(), semanticObject.getConnaissance()); feeder.finish(); } /** * Contexts: * ConditionEt returns ConditionEt * * Constraint: * (conditionTest+=ConditionTest conditionTest+=ConditionTest*) */ protected void sequence_ConditionEt(ISerializationContext context, ConditionEt semanticObject) { genericSequencer.createSequence(context, semanticObject); } /** * Contexts: * ConditionTest returns ConditionObjet * ConditionObjet returns ConditionObjet * * Constraint: * (objet=Nom comparateur=Comparateur nombre=INT) */ protected void sequence_ConditionObjet(ISerializationContext context, ConditionObjet semanticObject) { if (errorAcceptor != null) { 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)); } SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); feeder.accept(grammarAccess.getConditionObjetAccess().getObjetNomParserRuleCall_0_0(), semanticObject.getObjet()); 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*) */ protected void sequence_Condition(ISerializationContext context, Condition semanticObject) { genericSequencer.createSequence(context, semanticObject); } /** * Contexts: * Connaissance returns Connaissance * * Constraint: * (nom=Nom visible=Condition descriptions+=Description+) */ 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) { 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)); } SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); feeder.accept(grammarAccess.getDescriptionAccess().getTexteSTRINGTerminalRuleCall_3_0(), semanticObject.getTexte()); feeder.accept(grammarAccess.getDescriptionAccess().getConditionConditionParserRuleCall_7_0(), semanticObject.getCondition()); feeder.finish(); } /** * Contexts: * Explorateur returns Explorateur * * Constraint: * (tailleInventaire=INT (connaissances+=Nom connaissances+=Nom*)? (objets+=Nom objets+=Nom*)?) */ protected void sequence_Explorateur(ISerializationContext context, Explorateur semanticObject) { genericSequencer.createSequence(context, semanticObject); } /** * Contexts: * Interaction returns Interaction * * Constraint: * ( * visible=Condition * (connaissances+=Nom connaissances+=Nom*)? * (objetsRecus+=Nom objetsRecus+=Nom*)? * (objetsConso+=Nom objetsRecus+=Nom*)? * actions+=Action+ * ) */ protected void sequence_Interaction(ISerializationContext context, Interaction semanticObject) { genericSequencer.createSequence(context, semanticObject); } /** * Contexts: * Jeu returns Jeu * * Constraint: * ( * explorateur=Explorateur * territoire=Territoire * objets+=Objet* * connaissances+=Connaissance* * personnes+=Personne* * transformations+=Transformation* * ) */ protected void sequence_Jeu(ISerializationContext context, Jeu semanticObject) { genericSequencer.createSequence(context, semanticObject); } /** * Contexts: * Lieu returns Lieu * * Constraint: * ( * nom=Nom * deposable=Condition * depart=Condition * fin=Condition * (personnes+=Nom personnes+=Nom*)? * descriptions+=Description+ * (objets+=Nom objets+=Nom*)? * (connaissances+=Nom connaissances+=Nom*)? * ) */ protected void sequence_Lieu(ISerializationContext context, Lieu semanticObject) { genericSequencer.createSequence(context, semanticObject); } /** * Contexts: * ConditionTest returns NOTConditionConnaissance * NOTConditionConnaissance returns NOTConditionConnaissance * * Constraint: * connaissance=Nom */ protected void sequence_NOTConditionConnaissance(ISerializationContext context, NOTConditionConnaissance semanticObject) { if (errorAcceptor != null) { 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); feeder.accept(grammarAccess.getNOTConditionConnaissanceAccess().getConnaissanceNomParserRuleCall_1_0(), semanticObject.getConnaissance()); feeder.finish(); } /** * Contexts: * Objet returns Objet * * Constraint: * (nom=Nom taille=INT visible=Condition descriptions+=Description+) */ protected void sequence_Objet(ISerializationContext context, Objet semanticObject) { genericSequencer.createSequence(context, semanticObject); } /** * Contexts: * Personne returns Personne * * Constraint: * (nom=Nom visible=Condition obligatoire=Condition (interactions+=Interaction interactions+=Interaction*)?) */ 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*)?) */ protected void sequence_Territoire(ISerializationContext context, Territoire semanticObject) { genericSequencer.createSequence(context, semanticObject); } /** * Contexts: * Transformation returns Transformation * * Constraint: * (condition=Condition (objetsIn+=Nom objetsIn+=Nom*)? (objetsOut+=Nom objetsOut+=Nom*)?) */ protected void sequence_Transformation(ISerializationContext context, Transformation semanticObject) { genericSequencer.createSequence(context, semanticObject); } }