Search in sources :

Example 11 with org.hl7.fhir.dstu3.model

use of org.hl7.fhir.dstu3.model in project xtext-core by eclipse.

the class Bug302128TestLanguageSemanticSequencer 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 == Bug302128Package.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case Bug302128Package.ELEMENT:
                sequence_Element(context, (Element) semanticObject);
                return;
            case Bug302128Package.MODEL:
                sequence_Model(context, (Model) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) Element(org.eclipse.xtext.parsetree.reconstr.bug302128.Element) Model(org.eclipse.xtext.parsetree.reconstr.bug302128.Model) Parameter(org.eclipse.xtext.Parameter) EPackage(org.eclipse.emf.ecore.EPackage)

Example 12 with org.hl7.fhir.dstu3.model

use of org.hl7.fhir.dstu3.model in project xtext-core by eclipse.

the class Bug362902SemanticSequencer 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 == Bug362902Package.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case Bug362902Package.GREETING:
                sequence_Greeting(context, (Greeting) semanticObject);
                return;
            case Bug362902Package.MODEL:
                sequence_Model(context, (Model) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Greeting(org.eclipse.xtext.linking.bug362902.Greeting) Action(org.eclipse.xtext.Action) Model(org.eclipse.xtext.linking.bug362902.Model) Parameter(org.eclipse.xtext.Parameter) EPackage(org.eclipse.emf.ecore.EPackage)

Example 13 with org.hl7.fhir.dstu3.model

use of org.hl7.fhir.dstu3.model in project xtext-core by eclipse.

the class Bug299395Test method testSerialization_03.

@Test
public void testSerialization_03() {
    Model model = Bug299395Factory.eINSTANCE.createModel();
    model.getStrings().add("Foo");
    model.getStrings().add("Bar");
    model.getStrings().add("Zonk");
    String serialized = getSerializer().serialize(model);
    assertEquals("{ \"Foo\" } { \"Bar\" } { \"Zonk\" }", serialized);
}
Also used : Model(org.eclipse.xtext.parsetree.reconstr.bug299395.Model) SubModel(org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel) Test(org.junit.Test)

Example 14 with org.hl7.fhir.dstu3.model

use of org.hl7.fhir.dstu3.model in project xtext-core by eclipse.

the class Bug299395Test method testSerialization_07.

@Test
public void testSerialization_07() {
    Model model = Bug299395Factory.eINSTANCE.createModel();
    SubModel subModel = Bug299395Factory.eINSTANCE.createSubModel();
    model.setSubModel(subModel);
    subModel.getStrings().add("s1");
    String serialized = getSerializer().serialize(model);
    assertEquals("subModel 1 2 \"s1\"", serialized);
}
Also used : Model(org.eclipse.xtext.parsetree.reconstr.bug299395.Model) SubModel(org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel) SubModel(org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel) Test(org.junit.Test)

Example 15 with org.hl7.fhir.dstu3.model

use of org.hl7.fhir.dstu3.model in project xtext-core by eclipse.

the class Bug299395Test method testSerialization_05.

@Test
public void testSerialization_05() {
    Model model = Bug299395Factory.eINSTANCE.createModel();
    model.getStrings().add("Unused");
    model.getKeys().add("Key1");
    model.getValues().add("Value1");
    model.getKeys().add("Key2");
    model.getValues().add("Value2");
    String serialized = getSerializer().serialize(model);
    assertEquals("{ \"Unused\" } [ \"Key1\" \"Value1\" \"Key2\" \"Value2\" ]", serialized);
}
Also used : Model(org.eclipse.xtext.parsetree.reconstr.bug299395.Model) SubModel(org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)47 Model (org.eclipse.xtext.valueconverter.bug250313.Model)30 ICompositeNode (org.eclipse.xtext.nodemodel.ICompositeNode)16 ILeafNode (org.eclipse.xtext.nodemodel.ILeafNode)11 Model (org.eclipse.xtext.parsetree.reconstr.bug299395.Model)9 SubModel (org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel)9 BoolExpr (com.microsoft.z3.BoolExpr)7 Model (com.microsoft.z3.Model)7 EPackage (org.eclipse.emf.ecore.EPackage)6 Action (org.eclipse.xtext.Action)6 Parameter (org.eclipse.xtext.Parameter)6 ParserRule (org.eclipse.xtext.ParserRule)6 Status (com.microsoft.z3.Status)3 Model (de.micromata.opengis.kml.v_2_2_0.Model)3 Model (org.sbolstandard.core2.Model)3 Context (com.microsoft.z3.Context)2 Solver (com.microsoft.z3.Solver)2 Kml (de.micromata.opengis.kml.v_2_2_0.Kml)2 HashSet (java.util.HashSet)2 Set (java.util.Set)2