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

390 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 07:37:31 +00:00
package fr.n7.serializer;
2021-11-30 17:25:45 +00:00
import com.google.inject.Inject;
2021-12-03 08:38:29 +00:00
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;
2021-12-03 07:37:31 +00:00
import fr.n7.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:
sequence_Action(context, (fr.n7.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 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
* (connaissances+=STRING connaissances+=STRING*)?
* (objetsRecus+=STRING objetsRecus+=STRING*)?
* (objetsConso+=STRING objetsConso+=STRING*)?
* descriptions+=Description
* descriptions+=Description*
* )
2021-11-30 17:25:45 +00:00
*/
2021-12-03 08:38:29 +00:00
protected void sequence_Action(ISerializationContext context, fr.n7.gAME.Action semanticObject) {
2021-11-30 17:25:45 +00:00
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* Chemin returns Chemin
*
* Constraint:
* (
2021-12-03 08:38:29 +00:00
* lieuIn=STRING
* lieuOut=STRING
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 09:02:04 +00:00
* (connaissances+=STRING connaissances+=STRING*)?
* (objetsRecus+=STRING objetsRecus+=STRING*)?
* (objetsConso+=STRING objetsConso+=STRING*)?
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 09:02:04 +00:00
* connaissance=STRING
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 09:02:04 +00:00
feeder.accept(grammarAccess.getConditionConnaissanceAccess().getConnaissanceSTRINGTerminalRuleCall_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 09:02:04 +00:00
* (objet=STRING 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 09:02:04 +00:00
feeder.accept(grammarAccess.getConditionObjetAccess().getObjetSTRINGTerminalRuleCall_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 09:02:04 +00:00
* (nom=STRING 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 09:02:04 +00:00
* (tailleInventaire=INT (connaissances+=STRING connaissances+=STRING*)? (objets+=STRING objets+=STRING*)?)
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 09:02:04 +00:00
* (connaissances+=STRING connaissances+=STRING*)?
* (objetsRecus+=STRING objetsRecus+=STRING*)?
* (objetsConso+=STRING objetsRecus+=STRING*)?
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 09:02:04 +00:00
* nom=STRING
2021-11-30 17:25:45 +00:00
* deposable=Condition
* depart=Condition
* fin=Condition
2021-12-03 08:38:29 +00:00
* (personnes+=STRING personnes+=STRING*)?
* descriptions+=Description
* descriptions+=Description*
2021-12-03 09:02:04 +00:00
* (objets+=STRING objets+=STRING*)?
* (connaissances+=STRING connaissances+=STRING*)?
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 09:02:04 +00:00
* connaissance=STRING
*/
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 09:02:04 +00:00
feeder.accept(grammarAccess.getNOTConditionConnaissanceAccess().getConnaissanceSTRINGTerminalRuleCall_1_0(), semanticObject.getConnaissance());
feeder.finish();
}
2021-11-30 17:25:45 +00:00
/**
* Contexts:
* Objet returns Objet
*
* Constraint:
2021-12-03 09:02:04 +00:00
* (nom=STRING 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 09:02:04 +00:00
* (nom=STRING 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 09:02:04 +00:00
* (condition=Condition (objetsIn+=STRING objetsIn+=STRING*)? (objetsOut+=STRING objetsOut+=STRING*)?)
2021-11-30 17:25:45 +00:00
*/
protected void sequence_Transformation(ISerializationContext context, Transformation semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
}