use of org.eclipse.gemoc.gexpressions.GAdditionExpression in project gemoc-studio by eclipse.
the class AbstractGExpressionsSemanticSequencer method sequence.
@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 == GexpressionsPackage.eINSTANCE)
switch(semanticObject.eClass().getClassifierID()) {
case GexpressionsPackage.GADDITION_EXPRESSION:
sequence_GAdditionExpression(context, (GAdditionExpression) semanticObject);
return;
case GexpressionsPackage.GAND_EXPRESSION:
sequence_GAndExpression(context, (GAndExpression) semanticObject);
return;
case GexpressionsPackage.GBOOLEAN_EXPRESSION:
sequence_GBooleanExpression(context, (GBooleanExpression) semanticObject);
return;
case GexpressionsPackage.GBRACE_EXPRESSION:
sequence_GBraceExpression(context, (GBraceExpression) semanticObject);
return;
case GexpressionsPackage.GDOUBLE_EXPRESSION:
sequence_GDoubleExpression(context, (GDoubleExpression) semanticObject);
return;
case GexpressionsPackage.GENUM_LITERAL_EXPRESSION:
sequence_GEnumLiteralExpression(context, (GEnumLiteralExpression) semanticObject);
return;
case GexpressionsPackage.GEQUALITY_EXPRESSION:
sequence_GEqualityExpression(context, (GEqualityExpression) semanticObject);
return;
case GexpressionsPackage.GIF_EXPRESSION:
sequence_GIfExpression(context, (GIfExpression) semanticObject);
return;
case GexpressionsPackage.GIMPORT_STATEMENT:
sequence_GImportStatement(context, (GImportStatement) semanticObject);
return;
case GexpressionsPackage.GINTEGER_EXPRESSION:
sequence_GIntegerExpression(context, (GIntegerExpression) semanticObject);
return;
case GexpressionsPackage.GMULTIPLICATION_EXPRESSION:
sequence_GMultiplicationExpression(context, (GMultiplicationExpression) semanticObject);
return;
case GexpressionsPackage.GNAVIGATION_EXPRESSION:
sequence_GNavigationExpression(context, (GNavigationExpression) semanticObject);
return;
case GexpressionsPackage.GNEGATION_EXPRESSION:
sequence_GNegationExpression(context, (GNegationExpression) semanticObject);
return;
case GexpressionsPackage.GOR_EXPRESSION:
sequence_GOrExpression(context, (GOrExpression) semanticObject);
return;
case GexpressionsPackage.GPROGRAM:
sequence_GProgram(context, (GProgram) semanticObject);
return;
case GexpressionsPackage.GREFERENCE_EXPRESSION:
sequence_GReferenceExpression(context, (GReferenceExpression) semanticObject);
return;
case GexpressionsPackage.GRELATION_EXPRESSION:
sequence_GRelationExpression(context, (GRelationExpression) semanticObject);
return;
case GexpressionsPackage.GSTRING_EXPRESSION:
sequence_GStringExpression(context, (GStringExpression) semanticObject);
return;
case GexpressionsPackage.GXOR_EXPRESSION:
sequence_GXorExpression(context, (GXorExpression) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
use of org.eclipse.gemoc.gexpressions.GAdditionExpression in project gemoc-studio by eclipse.
the class GAdditionExpressionItemProvider method getText.
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
GAdditionOperator labelValue = ((GAdditionExpression) object).getOperator();
String label = labelValue == null ? null : labelValue.toString();
return label == null || label.length() == 0 ? getString("_UI_GAdditionExpression_type") : getString("_UI_GAdditionExpression_type") + " " + label;
}
use of org.eclipse.gemoc.gexpressions.GAdditionExpression in project gemoc-studio by eclipse.
the class TestXtextSerializer method main.
public static void main(String[] args) {
// Getting the serializer
GExpressionsStandaloneSetup setup = new GExpressionsStandaloneSetup();
Injector injector = setup.createInjectorAndDoEMFRegistration();
Serializer serializer = injector.getInstance(Serializer.class);
// Creating a model
GexpressionsFactory factory = GexpressionsFactory.eINSTANCE;
GAdditionExpression exp = factory.createGAdditionExpression();
GIntegerExpression un = factory.createGIntegerExpression();
un.setValue(1);
GStringExpression deux = factory.createGStringExpression();
deux.setValue("deux");
exp.setLeftOperand(un);
exp.setRightOperand(deux);
// Serializing
String s = serializer.serialize(exp);
System.out.println(s);
}
Aggregations