Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2016-09-10 11:29:06 +0000
committerEd Willink2016-09-19 11:18:45 +0000
commit4b2b83791a3abf5548663f24bc1c81d0b94ef7eb (patch)
treeae7612a2e6b4f64dec86fae4f624f451c5bcade9
parentab75bb4e52f5dd100c148bcd748a627660dd5444 (diff)
downloadorg.eclipse.qvtd-4b2b83791a3abf5548663f24bc1c81d0b94ef7eb.tar.gz
org.eclipse.qvtd-4b2b83791a3abf5548663f24bc1c81d0b94ef7eb.tar.xz
org.eclipse.qvtd-4b2b83791a3abf5548663f24bc1c81d0b94ef7eb.zip
[500369] Support grammar without ambiguities
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/as2cs/QVTimperativeDeclarationVisitor.java2
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSContainmentVisitor.java19
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSPostOrderVisitor.java6
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSPreOrderVisitor.java16
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/formatting/QVTimperativeFormatter.java235
5 files changed, 54 insertions, 224 deletions
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/as2cs/QVTimperativeDeclarationVisitor.java b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/as2cs/QVTimperativeDeclarationVisitor.java
index 24feb6051..38bf6a67c 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/as2cs/QVTimperativeDeclarationVisitor.java
+++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/as2cs/QVTimperativeDeclarationVisitor.java
@@ -745,12 +745,14 @@ public class QVTimperativeDeclarationVisitor extends QVTbaseDeclarationVisitor i
}
}
csUnrealizedVariable.setOwnedInitExpression(context.visitDeclaration(ExpCS.class, ownedInit));
+ csUnrealizedVariable.setIsConnection(asVariable instanceof ConnectionVariable);
return csUnrealizedVariable;
}
else {
if (asVariable.eContainer() instanceof ImperativePattern) {
UnrealizedVariableCS csUnrealizedVariable = refreshTypedElement(UnrealizedVariableCS.class, QVTimperativeCSPackage.Literals.UNREALIZED_VARIABLE_CS, asVariable);
csUnrealizedVariable.setOwnedInitExpression(context.visitDeclaration(ExpCS.class, asVariable.getOwnedInit()));
+ csUnrealizedVariable.setIsConnection(asVariable instanceof ConnectionVariable);
return csUnrealizedVariable;
}
else {
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSContainmentVisitor.java b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSContainmentVisitor.java
index a7d5a1697..a3503941e 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSContainmentVisitor.java
+++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSContainmentVisitor.java
@@ -34,7 +34,6 @@ import org.eclipse.ocl.xtext.base.cs2as.Continuation;
import org.eclipse.ocl.xtext.base.cs2as.SingleContinuation;
import org.eclipse.ocl.xtext.base.utilities.BaseCSResource;
import org.eclipse.ocl.xtext.basecs.PathNameCS;
-import org.eclipse.ocl.xtext.basecs.PrimitiveTypeRefCS;
import org.eclipse.ocl.xtext.essentialoclcs.ExpCS;
import org.eclipse.ocl.xtext.essentialoclcs.NameExpCS;
import org.eclipse.qvtd.pivot.qvtbase.Function;
@@ -74,7 +73,6 @@ import org.eclipse.qvtd.xtext.qvtimperativecs.MappingCallCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.MappingLoopCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.NewStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.ParamDeclarationCS;
-import org.eclipse.qvtd.xtext.qvtimperativecs.PatternCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.PredicateCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.PredicateOrAssignmentCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.QueryCS;
@@ -82,7 +80,6 @@ import org.eclipse.qvtd.xtext.qvtimperativecs.SetStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.TopLevelCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.TransformationCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.UnrealizedVariableCS;
-import org.eclipse.qvtd.xtext.qvtimperativecs.impl.DomainCSImpl;
import org.eclipse.qvtd.xtext.qvtimperativecs.util.AbstractQVTimperativeCSContainmentVisitor;
import com.google.common.collect.Iterables;
@@ -415,18 +412,12 @@ public class QVTimperativeCSContainmentVisitor extends AbstractQVTimperativeCSCo
@Override
public Continuation<?> visitUnrealizedVariableCS(@NonNull UnrealizedVariableCS csElement) {
- EObject eContainer = csElement.eContainer();
- if ((eContainer instanceof PatternCS) && !(csElement.getOwnedType() instanceof PrimitiveTypeRefCS)) { // FIXME need clearer syntax
- EObject eContainerContainer = eContainer.eContainer();
- if (eContainerContainer instanceof DomainCSImpl) {
- TypedModel typedModel = ((DomainCSImpl)eContainerContainer).basicGetDirection();
- if (typedModel == null) {
- refreshNamedElement(ConnectionVariable.class, QVTimperativePackage.Literals.CONNECTION_VARIABLE, csElement);
- return null;
- }
- }
+ if (csElement.isIsConnection()) {
+ refreshNamedElement(ConnectionVariable.class, QVTimperativePackage.Literals.CONNECTION_VARIABLE, csElement);
+ }
+ else {
+ refreshNamedElement(Variable.class, PivotPackage.Literals.VARIABLE, csElement);
}
- refreshNamedElement(Variable.class, PivotPackage.Literals.VARIABLE, csElement);
return null;
}
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSPostOrderVisitor.java b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSPostOrderVisitor.java
index 9ea510d35..e1e46dce4 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSPostOrderVisitor.java
+++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSPostOrderVisitor.java
@@ -63,7 +63,6 @@ import org.eclipse.qvtd.xtext.qvtimperativecs.PredicateCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.PredicateOrAssignmentCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.SetStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.QueryCS;
-import org.eclipse.qvtd.xtext.qvtimperativecs.RealizeableVariableCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.TopLevelCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.TransformationCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.UnrealizedVariableCS;
@@ -333,11 +332,6 @@ public class QVTimperativeCSPostOrderVisitor extends AbstractQVTimperativeCSPost
}
@Override
- public Continuation<?> visitRealizeableVariableCS(@NonNull RealizeableVariableCS object) {
- return null;
- }
-
- @Override
public Continuation<?> visitSetStatementCS(@NonNull SetStatementCS csElement) {
SetStatement setStatement = PivotUtil.getPivot(SetStatement.class, csElement);
if (setStatement != null) {
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSPreOrderVisitor.java b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSPreOrderVisitor.java
index 5499cac7e..834121252 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSPreOrderVisitor.java
+++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSPreOrderVisitor.java
@@ -55,9 +55,9 @@ import org.eclipse.qvtd.xtext.qvtimperativecs.PredicateCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.PredicateOrAssignmentCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.SetStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.QueryCS;
-import org.eclipse.qvtd.xtext.qvtimperativecs.RealizeableVariableCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.TopLevelCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.TransformationCS;
+import org.eclipse.qvtd.xtext.qvtimperativecs.UnrealizedVariableCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.util.AbstractQVTimperativeCSPreOrderVisitor;
public class QVTimperativeCSPreOrderVisitor extends AbstractQVTimperativeCSPreOrderVisitor
@@ -144,9 +144,9 @@ public class QVTimperativeCSPreOrderVisitor extends AbstractQVTimperativeCSPreOr
}
}
- public static class RealizeableVariableCompletion extends SingleContinuation<RealizeableVariableCS>
+ public static class UnrealizedVariableCompletion extends SingleContinuation<UnrealizedVariableCS>
{
- public RealizeableVariableCompletion(@NonNull CS2ASConversion context, @NonNull RealizeableVariableCS csElement) {
+ public UnrealizedVariableCompletion(@NonNull CS2ASConversion context, @NonNull UnrealizedVariableCS csElement) {
super(context, null, null, csElement, new PivotDependency(csElement.getOwnedType()));
}
@@ -296,11 +296,6 @@ public class QVTimperativeCSPreOrderVisitor extends AbstractQVTimperativeCSPreOr
}
@Override
- public Continuation<?> visitRealizeableVariableCS(@NonNull RealizeableVariableCS csElement) {
- return new RealizeableVariableCompletion(context, csElement);
- }
-
- @Override
public Continuation<?> visitSetStatementCS(@NonNull SetStatementCS csElement) {
return null;
}
@@ -323,4 +318,9 @@ public class QVTimperativeCSPreOrderVisitor extends AbstractQVTimperativeCSPreOr
}
return null;
}
+
+ @Override
+ public @Nullable Continuation<?> visitUnrealizedVariableCS(@NonNull UnrealizedVariableCS csElement) {
+ return new UnrealizedVariableCompletion(context, csElement);
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/formatting/QVTimperativeFormatter.java b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/formatting/QVTimperativeFormatter.java
index d52a71b09..212c327ec 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/formatting/QVTimperativeFormatter.java
+++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/formatting/QVTimperativeFormatter.java
@@ -14,29 +14,27 @@ import org.eclipse.ocl.xtext.essentialocl.formatting.AbstractEssentialOCLFormatt
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.AddStatementCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.BottomPatternCSElements;
+import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.ConstraintCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.DirectionCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.GuardPatternCSElements;
+import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.GuardVariableCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.ImportCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.MappingCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.MappingCallBindingCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.MappingCallCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.MappingLoopCSElements;
-import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.MiddleBottomPatternCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.MiddleDomainCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.NewStatementCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.PredicateCSElements;
-import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.PredicateOrAssignmentCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.QualifiedPackageCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.QueryCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.ScopeNameCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.SetStatementCSElements;
-import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.SourceBottomPatternCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.SourceDomainCSElements;
-import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.SourceGuardPatternCSElements;
-import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.TargetBottomPatternCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.TargetDomainCSElements;
-import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.TargetGuardPatternCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.TransformationCSElements;
+import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.UnrealizedVariableCSElements;
+import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.VariablePredicateCSElements;
import org.eclipse.xtext.formatting.impl.FormattingConfig;
/**
@@ -51,36 +49,10 @@ public class QVTimperativeFormatter extends AbstractEssentialOCLFormatter
{
protected void configureBottomPatternCS(FormattingConfig c, BottomPatternCSElements a) {
- c.setNoLinewrap().before(a.getLeftCurlyBracketKeyword_0_0());
- c.setLinewrap().after(a.getLeftCurlyBracketKeyword_0_0());
- c.setNoSpace().before(a.getCommaKeyword_0_2_0());
- c.setLinewrap().after(a.getCommaKeyword_0_2_0());
- c.setLinewrap(1).before(a.getVerticalLineKeyword_0_3());
- c.setLinewrap(1).after(a.getVerticalLineKeyword_0_3());
- c.setIndentation(a.getLeftCurlyBracketKeyword_0_0(), a.getVerticalLineKeyword_0_3());
- c.setLinewrap().before(a.getRightCurlyBracketKeyword_0_5());
- c.setLinewrap().after(a.getRightCurlyBracketKeyword_0_5());
- c.setIndentation(a.getVerticalLineKeyword_0_3(), a.getRightCurlyBracketKeyword_0_5());
- c.setNoSpace().between(a.getLeftCurlyBracketKeyword_0_0(), a.getVerticalLineKeyword_0_3());
- c.setNoSpace().between(a.getVerticalLineKeyword_0_3(), a.getRightCurlyBracketKeyword_0_5());
- //
- c.setNoLinewrap().before(a.getLeftCurlyBracketKeyword_1_0());
- c.setLinewrap().after(a.getLeftCurlyBracketKeyword_1_0());
- c.setNoSpace().before(a.getCommaKeyword_1_2_0());
- c.setLinewrap().after(a.getCommaKeyword_1_2_0());
- c.setLinewrap().before(a.getRightCurlyBracketKeyword_1_3());
- c.setLinewrap().after(a.getRightCurlyBracketKeyword_1_3());
- c.setIndentation(a.getLeftCurlyBracketKeyword_1_0(), a.getRightCurlyBracketKeyword_1_3());
- //
- c.setNoLinewrap().before(a.getLeftCurlyBracketKeyword_2_0());
- c.setLinewrap().after(a.getLeftCurlyBracketKeyword_2_0());
- c.setLinewrap().before(a.getRightCurlyBracketKeyword_2_2());
- c.setLinewrap().after(a.getRightCurlyBracketKeyword_2_2());
- c.setIndentation(a.getLeftCurlyBracketKeyword_2_0(), a.getRightCurlyBracketKeyword_2_2());
- //
- c.setNoLinewrap().before(a.getLeftCurlyBracketKeyword_3_1());
- c.setLinewrap().after(a.getRightCurlyBracketKeyword_3_2());
- c.setNoSpace().between(a.getLeftCurlyBracketKeyword_3_1(), a.getRightCurlyBracketKeyword_3_2());
+ c.setNoLinewrap().before(a.getLeftCurlyBracketKeyword_1());
+ c.setLinewrap().after(a.getLeftCurlyBracketKeyword_1());
+ c.setLinewrap().before(a.getRightCurlyBracketKeyword_3());
+ c.setLinewrap().after(a.getRightCurlyBracketKeyword_3());
}
protected void configureDirectionCS(FormattingConfig c, DirectionCSElements a) {
@@ -88,57 +60,13 @@ public class QVTimperativeFormatter extends AbstractEssentialOCLFormatter
c.setNoSpace().before(a.getCommaKeyword_5_2_0());
}
- protected void configureGuardPatternCS(FormattingConfig c, GuardPatternCSElements a) {
- c.setNoLinewrap().before(a.getLeftParenthesisKeyword_0_0());
- c.setLinewrap().after(a.getLeftParenthesisKeyword_0_0());
- c.setNoSpace().before(a.getCommaKeyword_0_2_0());
- c.setLinewrap().after(a.getCommaKeyword_0_2_0());
- c.setLinewrap(1).before(a.getVerticalLineKeyword_0_3());
- c.setLinewrap(1).after(a.getVerticalLineKeyword_0_3());
- c.setIndentation(a.getLeftParenthesisKeyword_0_0(), a.getVerticalLineKeyword_0_3());
- c.setLinewrap().before(a.getRightParenthesisKeyword_0_5());
- c.setLinewrap().after(a.getRightParenthesisKeyword_0_5());
- c.setIndentation(a.getVerticalLineKeyword_0_3(), a.getRightParenthesisKeyword_0_5());
- c.setNoSpace().around(a.getLeftParenthesisKeyword_0_0());
- c.setNoSpace().before(a.getRightParenthesisKeyword_0_5());
- c.setNoSpace().between(a.getLeftParenthesisKeyword_0_0(), a.getVerticalLineKeyword_0_3());
- c.setNoSpace().between(a.getVerticalLineKeyword_0_3(), a.getRightParenthesisKeyword_0_5());
- c.setNoSpace().between(a.getLeftParenthesisKeyword_0_0(), a.getRightParenthesisKeyword_0_5());
- //
- c.setNoLinewrap().before(a.getLeftParenthesisKeyword_1_0());
- c.setLinewrap().after(a.getLeftParenthesisKeyword_1_0());
- c.setNoSpace().before(a.getCommaKeyword_1_2_0());
- c.setLinewrap().after(a.getCommaKeyword_1_2_0());
- c.setLinewrap().before(a.getRightParenthesisKeyword_1_3());
- c.setLinewrap().after(a.getRightParenthesisKeyword_1_3());
- c.setIndentation(a.getLeftParenthesisKeyword_1_0(), a.getRightParenthesisKeyword_1_3());
- c.setNoSpace().around(a.getLeftParenthesisKeyword_1_0());
- c.setNoSpace().before(a.getRightParenthesisKeyword_1_3());
- //
- c.setNoLinewrap().before(a.getLeftParenthesisKeyword_2_0());
- c.setLinewrap().after(a.getLeftParenthesisKeyword_2_0());
- c.setLinewrap().before(a.getRightParenthesisKeyword_2_2());
- c.setLinewrap().after(a.getRightParenthesisKeyword_2_2());
- c.setIndentation(a.getLeftParenthesisKeyword_2_0(), a.getRightParenthesisKeyword_2_2());
- c.setNoSpace().around(a.getLeftParenthesisKeyword_2_0());
- c.setNoSpace().before(a.getRightParenthesisKeyword_2_2());
- //
- c.setNoLinewrap().before(a.getLeftParenthesisKeyword_3_1());
- c.setLinewrap().after(a.getRightParenthesisKeyword_3_2());
- c.setNoSpace().around(a.getLeftParenthesisKeyword_3_1());
- c.setNoSpace().before(a.getRightParenthesisKeyword_3_2());
- c.setNoSpace().between(a.getLeftParenthesisKeyword_3_1(), a.getRightParenthesisKeyword_3_2());
- }
-
protected void configureImportCS(FormattingConfig c, ImportCSElements a) {
setNoSpaceLineWrap(c, a.getSemicolonKeyword_4());
}
protected void configurePredicateCS(FormattingConfig c, PredicateCSElements a) {
- setNoSpaceLineWrap(c, a.getSemicolonKeyword_1());
- }
-
- protected void configurePredicateOrAssignmentCS(FormattingConfig c, PredicateOrAssignmentCSElements a) {
+ c.setLinewrap(1).before(a.getCheckKeyword_0());
+ c.setNoSpace().before(a.getSemicolonKeyword_2());
setNoSpaceLineWrap(c, a.getSemicolonKeyword_2());
}
@@ -217,7 +145,14 @@ public class QVTimperativeFormatter extends AbstractEssentialOCLFormatter
{
AddStatementCSElements a = f.getAddStatementCSAccess();
- setNoSpaceLineWrap(c, a.getSemicolonKeyword_4());
+ c.setLinewrap(1).before(a.getAddKeyword_0());
+ c.setNoSpace().before(a.getSemicolonKeyword_4());
+ }
+ {
+ GuardVariableCSElements a = f.getGuardVariableCSAccess();
+ c.setLinewrap(1).before(a.getInKeyword_0_0());
+ c.setLinewrap(1).before(a.getIsConnectionInoutKeyword_0_1_0());
+ c.setNoSpace().before(a.getSemicolonKeyword_4());
}
{
MappingCSElements a = f.getMappingCSAccess();
@@ -245,39 +180,6 @@ public class QVTimperativeFormatter extends AbstractEssentialOCLFormatter
setAppendedBraces(c, a.getLeftCurlyBracketKeyword_4(), a.getRightCurlyBracketKeyword_6());
}
{
- MiddleBottomPatternCSElements a = f.getMiddleBottomPatternCSAccess();
- c.setNoLinewrap().before(a.getLeftCurlyBracketKeyword_0_0());
- c.setLinewrap().after(a.getLeftCurlyBracketKeyword_0_0());
- c.setNoSpace().before(a.getCommaKeyword_0_2_0());
- c.setLinewrap().after(a.getCommaKeyword_0_2_0());
- c.setLinewrap(1).before(a.getVerticalLineKeyword_0_3());
- c.setLinewrap(1).after(a.getVerticalLineKeyword_0_3());
- c.setIndentation(a.getLeftCurlyBracketKeyword_0_0(), a.getVerticalLineKeyword_0_3());
- c.setLinewrap().before(a.getRightCurlyBracketKeyword_0_5());
- c.setLinewrap().after(a.getRightCurlyBracketKeyword_0_5());
- c.setIndentation(a.getVerticalLineKeyword_0_3(), a.getRightCurlyBracketKeyword_0_5());
- c.setNoSpace().between(a.getLeftCurlyBracketKeyword_0_0(), a.getVerticalLineKeyword_0_3());
- c.setNoSpace().between(a.getVerticalLineKeyword_0_3(), a.getRightCurlyBracketKeyword_0_5());
- //
- c.setNoLinewrap().before(a.getLeftCurlyBracketKeyword_1_0());
- c.setLinewrap().after(a.getLeftCurlyBracketKeyword_1_0());
- c.setNoSpace().before(a.getCommaKeyword_1_2_0());
- c.setLinewrap().after(a.getCommaKeyword_1_2_0());
- c.setLinewrap().before(a.getRightCurlyBracketKeyword_1_3());
- c.setLinewrap().after(a.getRightCurlyBracketKeyword_1_3());
- c.setIndentation(a.getLeftCurlyBracketKeyword_1_0(), a.getRightCurlyBracketKeyword_1_3());
- //
- c.setNoLinewrap().before(a.getLeftCurlyBracketKeyword_2_0());
- c.setLinewrap().after(a.getLeftCurlyBracketKeyword_2_0());
- c.setLinewrap().before(a.getRightCurlyBracketKeyword_2_2());
- c.setLinewrap().after(a.getRightCurlyBracketKeyword_2_2());
- c.setIndentation(a.getLeftCurlyBracketKeyword_2_0(), a.getRightCurlyBracketKeyword_2_2());
- //
- c.setNoLinewrap().before(a.getLeftCurlyBracketKeyword_3_1());
- c.setLinewrap().after(a.getRightCurlyBracketKeyword_3_2());
- c.setNoSpace().between(a.getLeftCurlyBracketKeyword_3_1(), a.getRightCurlyBracketKeyword_3_2());
- }
- {
MiddleDomainCSElements a = f.getMiddleDomainCSAccess();
c.setNoLinewrap().before(a.getLeftCurlyBracketKeyword_0_0());
c.setLinewrap().after(a.getLeftCurlyBracketKeyword_0_0());
@@ -291,36 +193,15 @@ public class QVTimperativeFormatter extends AbstractEssentialOCLFormatter
}
{
GuardPatternCSElements a = f.getGuardPatternCSAccess();
- c.setNoLinewrap().before(a.getLeftParenthesisKeyword_0_0());
- c.setLinewrap().after(a.getLeftParenthesisKeyword_0_0());
- c.setLinewrap().before(a.getRightParenthesisKeyword_0_5());
- c.setLinewrap().after(a.getRightParenthesisKeyword_0_5());
- c.setNoSpace().after(a.getLeftParenthesisKeyword_0_0());
- c.setNoSpace().before(a.getCommaKeyword_0_2_0());
- c.setNoSpace().before(a.getRightParenthesisKeyword_0_5());
- //
- c.setNoLinewrap().before(a.getLeftParenthesisKeyword_1_0());
- c.setLinewrap().after(a.getLeftParenthesisKeyword_1_0());
- c.setLinewrap().before(a.getRightParenthesisKeyword_1_3());
- c.setLinewrap().after(a.getRightParenthesisKeyword_1_3());
- c.setNoSpace().after(a.getLeftParenthesisKeyword_1_0());
- c.setNoSpace().before(a.getCommaKeyword_1_2_0());
- c.setNoSpace().before(a.getRightParenthesisKeyword_1_3());
- //
- c.setNoLinewrap().before(a.getLeftParenthesisKeyword_2_0());
- c.setLinewrap().after(a.getLeftParenthesisKeyword_2_0());
- c.setLinewrap().before(a.getRightParenthesisKeyword_2_2());
- c.setLinewrap().after(a.getRightParenthesisKeyword_2_2());
- c.setNoSpace().after(a.getLeftParenthesisKeyword_2_0());
- //
- c.setNoLinewrap().before(a.getLeftParenthesisKeyword_3_1());
- c.setLinewrap().after(a.getLeftParenthesisKeyword_3_1());
- c.setLinewrap().before(a.getRightParenthesisKeyword_3_2());
- c.setLinewrap().after(a.getRightParenthesisKeyword_3_2());
- c.setNoSpace().after(a.getLeftParenthesisKeyword_3_1());
+ c.setNoLinewrap().before(a.getLeftParenthesisKeyword_1());
+ c.setLinewrap().after(a.getLeftParenthesisKeyword_1());
+ c.setLinewrap().before(a.getRightParenthesisKeyword_3());
+ c.setLinewrap().after(a.getRightParenthesisKeyword_3());
+ c.setNoSpace().around(a.getLeftParenthesisKeyword_1());
+ c.setNoSpace().before(a.getRightParenthesisKeyword_3());
//
- c.setIndentation(a.getLeftParenthesisKeyword_0_0(), a.getRightParenthesisKeyword_0_5());
- c.setNoSpace().between(a.getLeftParenthesisKeyword_0_0(), a.getRightParenthesisKeyword_0_5());
+ c.setIndentation(a.getLeftParenthesisKeyword_1(), a.getRightParenthesisKeyword_3());
+ c.setNoSpace().between(a.getLeftParenthesisKeyword_1(), a.getRightParenthesisKeyword_3());
}
{
NewStatementCSElements a = f.getNewStatementCSAccess();
@@ -329,8 +210,9 @@ public class QVTimperativeFormatter extends AbstractEssentialOCLFormatter
c.setNoSpace().before(a.getSemicolonKeyword_7());
}
{
- PredicateOrAssignmentCSElements a = f.getPredicateOrAssignmentCSAccess();
- setNoSpaceLineWrap(c, a.getSemicolonKeyword_2());
+ ConstraintCSElements a = f.getConstraintCSAccess();
+ c.setLinewrap(1).before(a.getCheckKeyword_0());
+ setNoSpaceLineWrap(c, a.getSemicolonKeyword_3());
}
{
ScopeNameCSElements a = f.getScopeNameCSAccess();
@@ -343,15 +225,6 @@ public class QVTimperativeFormatter extends AbstractEssentialOCLFormatter
c.setNoSpace().before(a.getSemicolonKeyword_6());
}
{
- SourceBottomPatternCSElements a = f.getSourceBottomPatternCSAccess();
- c.setNoLinewrap().before(a.getLeftCurlyBracketKeyword_1());
- c.setLinewrap().after(a.getLeftCurlyBracketKeyword_1());
- c.setNoSpace().before(a.getCommaKeyword_2_1_0());
- c.setLinewrap().after(a.getCommaKeyword_2_1_0());
- c.setLinewrap().after(a.getRightCurlyBracketKeyword_3());
- c.setNoSpace().between(a.getLeftCurlyBracketKeyword_1(), a.getRightCurlyBracketKeyword_3());
- }
- {
SourceDomainCSElements a = f.getSourceDomainCSAccess();
c.setNoLinewrap().before(a.getLeftCurlyBracketKeyword_2_0());
c.setLinewrap().after(a.getLeftCurlyBracketKeyword_2_0());
@@ -364,32 +237,6 @@ public class QVTimperativeFormatter extends AbstractEssentialOCLFormatter
c.setIndentation(a.getLeftCurlyBracketKeyword_2_0(), a.getRightCurlyBracketKeyword_2_3());
}
{
- SourceGuardPatternCSElements a = f.getSourceGuardPatternCSAccess();
- c.setNoLinewrap().before(a.getLeftParenthesisKeyword_1());
- c.setLinewrap().after(a.getLeftParenthesisKeyword_1());
- c.setNoSpace().before(a.getCommaKeyword_2_1_0());
- c.setLinewrap().after(a.getCommaKeyword_2_1_0());
- c.setLinewrap().before(a.getRightParenthesisKeyword_3());
- c.setLinewrap().after(a.getRightParenthesisKeyword_3());
- c.setNoSpace().around(a.getLeftParenthesisKeyword_1());
- c.setNoSpace().before(a.getRightParenthesisKeyword_3());
- //
- c.setIndentation(a.getLeftParenthesisKeyword_1(), a.getRightParenthesisKeyword_3());
- c.setNoSpace().between(a.getLeftParenthesisKeyword_1(), a.getRightParenthesisKeyword_3());
- }
- {
- TargetBottomPatternCSElements a = f.getTargetBottomPatternCSAccess();
- c.setNoLinewrap().before(a.getLeftCurlyBracketKeyword_1());
- c.setLinewrap().after(a.getLeftCurlyBracketKeyword_1());
- c.setNoSpace().before(a.getCommaKeyword_2_1_0());
- c.setLinewrap().after(a.getCommaKeyword_2_1_0());
- c.setLinewrap().before(a.getRightCurlyBracketKeyword_3());
- c.setLinewrap().after(a.getRightCurlyBracketKeyword_3());
- //
- c.setIndentation(a.getLeftCurlyBracketKeyword_1(), a.getRightCurlyBracketKeyword_3());
- c.setNoSpace().between(a.getLeftCurlyBracketKeyword_1(), a.getRightCurlyBracketKeyword_3());
- }
- {
TargetDomainCSElements a = f.getTargetDomainCSAccess();
c.setNoLinewrap().before(a.getLeftCurlyBracketKeyword_2_0());
c.setLinewrap().after(a.getLeftCurlyBracketKeyword_2_0());
@@ -401,26 +248,22 @@ public class QVTimperativeFormatter extends AbstractEssentialOCLFormatter
c.setNoSpace().between(a.getLeftCurlyBracketKeyword_2_0(), a.getRightCurlyBracketKeyword_2_3());
c.setIndentation(a.getLeftCurlyBracketKeyword_2_0(), a.getRightCurlyBracketKeyword_2_3());
}
- {
- TargetGuardPatternCSElements a = f.getTargetGuardPatternCSAccess();
- c.setNoLinewrap().before(a.getLeftParenthesisKeyword_1());
- c.setLinewrap().after(a.getLeftParenthesisKeyword_1());
- c.setNoSpace().before(a.getCommaKeyword_2_1_0());
- c.setLinewrap().after(a.getCommaKeyword_2_1_0());
- c.setLinewrap().before(a.getRightParenthesisKeyword_3());
- c.setLinewrap().after(a.getRightParenthesisKeyword_3());
- c.setNoSpace().around(a.getLeftParenthesisKeyword_1());
- c.setNoSpace().before(a.getRightParenthesisKeyword_3());
- //
- c.setIndentation(a.getLeftParenthesisKeyword_1(), a.getRightParenthesisKeyword_3());
- c.setNoSpace().between(a.getLeftParenthesisKeyword_1(), a.getRightParenthesisKeyword_3());
- }
// {
// TopLevelCSElements a = f.getTopLevelCSAccess();
// c.setLinewrap(2).between(a.getOwnedMappingsMappingCSParserRuleCall_1_1_0(), a.getOwnedMappingsMappingCSParserRuleCall_1_1_0());
// c.setLinewrap(2).before(a.getOwnedQueriesAssignment_1_2());
// c.setLinewrap(2).before(a.getOwnedTransformationsAssignment_1_0());
// }
+ {
+ UnrealizedVariableCSElements a = f.getUnrealizedVariableCSAccess();
+ c.setLinewrap(1).before(a.getVarKeyword_0_0());
+ c.setNoSpace().before(a.getSemicolonKeyword_4());
+ }
+ {
+ VariablePredicateCSElements a = f.getVariablePredicateCSAccess();
+ c.setLinewrap(1).before(a.getInvarKeyword_0());
+ setNoSpaceLineWrap(c, a.getSemicolonKeyword_5());
+ }
}
@Override

Back to the top