projet-genie-logiciel-systeme/workspace/fr.n7.game/src-gen/fr/n7/serializer/GAMESemanticSequencer.java
2021-12-03 10:02:04 +01:00

390 lines
14 KiB
Java

/*
* 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<Parameter> 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:
* (
* visible=Condition
* finInteraction=Condition
* (connaissances+=STRING connaissances+=STRING*)?
* (objetsRecus+=STRING objetsRecus+=STRING*)?
* (objetsConso+=STRING objetsConso+=STRING*)?
* descriptions+=Description
* descriptions+=Description*
* )
*/
protected void sequence_Action(ISerializationContext context, fr.n7.gAME.Action semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* Chemin returns Chemin
*
* Constraint:
* (
* lieuIn=STRING
* lieuOut=STRING
* ouvert=Condition
* visible=Condition
* obligatoire=Condition
* (connaissances+=STRING connaissances+=STRING*)?
* (objetsRecus+=STRING objetsRecus+=STRING*)?
* (objetsConso+=STRING objetsConso+=STRING*)?
* descriptions+=Description
* descriptions+=Description*
* )
*/
protected void sequence_Chemin(ISerializationContext context, Chemin semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* ConditionTest returns ConditionConnaissance
* ConditionConnaissance returns ConditionConnaissance
*
* Constraint:
* connaissance=STRING
*/
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().getConnaissanceSTRINGTerminalRuleCall_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=STRING 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().getObjetSTRINGTerminalRuleCall_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=STRING visible=Condition descriptions+=Description 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+=STRING connaissances+=STRING*)? (objets+=STRING objets+=STRING*)?)
*/
protected void sequence_Explorateur(ISerializationContext context, Explorateur semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* Interaction returns Interaction
*
* Constraint:
* (
* visible=Condition
* (connaissances+=STRING connaissances+=STRING*)?
* (objetsRecus+=STRING objetsRecus+=STRING*)?
* (objetsConso+=STRING objetsRecus+=STRING*)?
* actions+=Action
* 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 objets+=Objet*)?
* (connaissances+=Connaissance connaissances+=Connaissance*)?
* (personnes+=Personne personnes+=Personne*)?
* (transformations+=Transformation transformations+=Transformation*)?
* )
*/
protected void sequence_Jeu(ISerializationContext context, Jeu semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* Lieu returns Lieu
*
* Constraint:
* (
* nom=STRING
* deposable=Condition
* depart=Condition
* fin=Condition
* (personnes+=STRING personnes+=STRING*)?
* descriptions+=Description
* descriptions+=Description*
* (objets+=STRING objets+=STRING*)?
* (connaissances+=STRING connaissances+=STRING*)?
* )
*/
protected void sequence_Lieu(ISerializationContext context, Lieu semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* ConditionTest returns NOTConditionConnaissance
* NOTConditionConnaissance returns NOTConditionConnaissance
*
* Constraint:
* connaissance=STRING
*/
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().getConnaissanceSTRINGTerminalRuleCall_1_0(), semanticObject.getConnaissance());
feeder.finish();
}
/**
* Contexts:
* Objet returns Objet
*
* Constraint:
* (nom=STRING taille=INT visible=Condition descriptions+=Description descriptions+=Description*)
*/
protected void sequence_Objet(ISerializationContext context, Objet semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* Personne returns Personne
*
* Constraint:
* (nom=STRING 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+=STRING objetsIn+=STRING*)? (objetsOut+=STRING objetsOut+=STRING*)?)
*/
protected void sequence_Transformation(ISerializationContext context, Transformation semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
}