Search in sources :

Example 1 with Mixed

use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Mixed in project xtext-core by eclipse.

the class AssignedActionImpl method basicSetChild.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetChild(Mixed newChild, NotificationChain msgs) {
    Mixed oldChild = child;
    child = newChild;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RegionaccesstestlanguagePackage.ASSIGNED_ACTION__CHILD, oldChild, newChild);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : Mixed(org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Mixed) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 2 with Mixed

use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Mixed in project xtext-core by eclipse.

the class MixedImpl method setRef.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setRef(Mixed newRef) {
    Mixed oldRef = ref;
    ref = newRef;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, RegionaccesstestlanguagePackage.MIXED__REF, oldRef, ref));
}
Also used : Mixed(org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Mixed) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 3 with Mixed

use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Mixed in project xtext-core by eclipse.

the class RegionAccessTestLanguageSemanticSequencer 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 == RegionaccesstestlanguagePackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case RegionaccesstestlanguagePackage.ACTION:
                sequence_Fragment_Mixed(context, (org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Action) semanticObject);
                return;
            case RegionaccesstestlanguagePackage.ADD:
                sequence_Expression(context, (Add) semanticObject);
                return;
            case RegionaccesstestlanguagePackage.ASSIGNED_ACTION:
                sequence_Mixed(context, (AssignedAction) semanticObject);
                return;
            case RegionaccesstestlanguagePackage.DELEGATE:
                sequence_Delegate(context, (Delegate) semanticObject);
                return;
            case RegionaccesstestlanguagePackage.DELEGATION:
                sequence_Delegation(context, (Delegation) semanticObject);
                return;
            case RegionaccesstestlanguagePackage.MIXED:
                sequence_Mixed(context, (Mixed) semanticObject);
                return;
            case RegionaccesstestlanguagePackage.NAMED:
                sequence_Primary(context, (Named) semanticObject);
                return;
            case RegionaccesstestlanguagePackage.PREFIXED_UNASSIGNED:
                sequence_PrefixedUnassigned(context, (PrefixedUnassigned) semanticObject);
                return;
            case RegionaccesstestlanguagePackage.ROOT:
                sequence_Root(context, (Root) semanticObject);
                return;
            case RegionaccesstestlanguagePackage.ROOT_ACTION:
                sequence_Root(context, (RootAction) semanticObject);
                return;
            case RegionaccesstestlanguagePackage.SIMPLE:
                sequence_Simple(context, (Simple) semanticObject);
                return;
            case RegionaccesstestlanguagePackage.VALUE_LIST:
                sequence_ValueList(context, (ValueList) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : Add(org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Add) ParserRule(org.eclipse.xtext.ParserRule) Named(org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Named) Action(org.eclipse.xtext.Action) RootAction(org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.RootAction) AssignedAction(org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.AssignedAction) Root(org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Root) RootAction(org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.RootAction) ValueList(org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.ValueList) Delegation(org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Delegation) EPackage(org.eclipse.emf.ecore.EPackage) Simple(org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Simple) AssignedAction(org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.AssignedAction) Delegate(org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Delegate) Mixed(org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Mixed) Parameter(org.eclipse.xtext.Parameter) PrefixedUnassigned(org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.PrefixedUnassigned)

Example 4 with Mixed

use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Mixed in project xtext-core by eclipse.

the class RegionAccessBuilderTest method testAssignedDatatype2.

@Test
public void testAssignedDatatype2() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("6 (datatype datatype foo)");
    _builder.newLine();
    String _trim = _builder.toString().trim();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append(" ");
    _builder_1.append("0  0 H");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("B Mixed      Root");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("0  1  S \"6\"        Root:\'6\'");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("1  1  H \" \"        Whitespace:TerminalRule\'WS\'");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("2  1  S \"(\"        Mixed:\'(\'");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("3  0  H");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("3 21  S \"datat...\" Mixed:datatype=Datatype");
    _builder_1.newLine();
    _builder_1.append("24  0  H");
    _builder_1.newLine();
    _builder_1.append("24  1  S \")\"        Mixed:\')\'");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("E Mixed      Root");
    _builder_1.newLine();
    _builder_1.append("25  0 H");
    _builder_1.newLine();
    this.operator_tripleEquals(_trim, _builder_1);
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) TextRegionAccessToString(org.eclipse.xtext.formatting2.debug.TextRegionAccessToString) Test(org.junit.Test)

Example 5 with Mixed

use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Mixed in project xtext-core by eclipse.

the class RegionAccessBuilderTest method testMixedUnassignedTerminal.

@Test
public void testMixedUnassignedTerminal() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("6 (unassigned foo)");
    _builder.newLine();
    String _trim = _builder.toString().trim();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append(" ");
    _builder_1.append("0  0 H");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("B Action     Root");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("0  1  S \"6\"        Root:\'6\'");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("1  1  H \" \"        Whitespace:TerminalRule\'WS\'");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("2  1  S \"(\"        Mixed:\'(\'");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("3  0  H");
    _builder_1.newLine();
    _builder_1.append(" ");
    _builder_1.append("3 10  S \"unass...\" Mixed:\'unassigned\'");
    _builder_1.newLine();
    _builder_1.append("13  1  H \" \"        Whitespace:TerminalRule\'WS\'");
    _builder_1.newLine();
    _builder_1.append("14  3  S \"foo\"      Mixed:ID");
    _builder_1.newLine();
    _builder_1.append("17  0  H");
    _builder_1.newLine();
    _builder_1.append("17  1  S \")\"        Mixed:\')\'");
    _builder_1.newLine();
    _builder_1.append("      ");
    _builder_1.append("E Action     Root");
    _builder_1.newLine();
    _builder_1.append("18  0 H");
    _builder_1.newLine();
    this.operator_tripleEquals(_trim, _builder_1);
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) TextRegionAccessToString(org.eclipse.xtext.formatting2.debug.TextRegionAccessToString) Test(org.junit.Test)

Aggregations

StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)40 Test (org.junit.Test)40 TextRegionAccessToString (org.eclipse.xtext.formatting2.debug.TextRegionAccessToString)21 Mixed (org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Mixed)20 ISemanticRegionsFinder (org.eclipse.xtext.formatting2.regionaccess.ISemanticRegionsFinder)18 ISemanticRegion (org.eclipse.xtext.formatting2.regionaccess.ISemanticRegion)16 AssignedAction (org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.AssignedAction)6 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)5 EPackage (org.eclipse.emf.ecore.EPackage)1 Action (org.eclipse.xtext.Action)1 Parameter (org.eclipse.xtext.Parameter)1 ParserRule (org.eclipse.xtext.ParserRule)1 IEObjectRegion (org.eclipse.xtext.formatting2.regionaccess.IEObjectRegion)1 Add (org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Add)1 Delegate (org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Delegate)1 Delegation (org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Delegation)1 Named (org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Named)1 PrefixedUnassigned (org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.PrefixedUnassigned)1 Root (org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Root)1 RootAction (org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.RootAction)1