Skip to content

Commit

Permalink
157: updated compiler test expectations
Browse files Browse the repository at this point in the history
Task-Url: #157
  • Loading branch information
LorenzoBettini committed Jun 20, 2022
1 parent 637a2da commit 0f273a7
Show file tree
Hide file tree
Showing 74 changed files with 2,446 additions and 2,452 deletions.
Expand Up @@ -25,66 +25,66 @@
@SuppressWarnings("all")
public class TypeSystem extends XsemanticsRuntimeSystem {
public static final String EOBJECTECLASS = "org.eclipse.xsemantics.test.errspecification.ecore.EObjectEClass";

public static final String EOBJECTECLASSWITHERRORSPECIFICATION = "org.eclipse.xsemantics.test.errspecification.ecore.EObjectEClassWithErrorSpecification";

public static final String ECLASSSUBTYPING = "org.eclipse.xsemantics.test.errspecification.ecore.EClassSubtyping";

private PolymorphicDispatcher<Result<EClass>> typeDispatcher;

private PolymorphicDispatcher<Result<Boolean>> subtypeDispatcher;

public TypeSystem() {
init();
}

public void init() {
typeDispatcher = buildPolymorphicDispatcher1(
"typeImpl", 3, "|-", ":");
subtypeDispatcher = buildPolymorphicDispatcher1(
"subtypeImpl", 4, "|-", "<:");
}

public Result<EClass> type(final EObject c) {
return type(new RuleEnvironment(), null, c);
}

public Result<EClass> type(final RuleEnvironment _environment_, final EObject c) {
return type(_environment_, null, c);
}

public Result<EClass> type(final RuleEnvironment _environment_, final RuleApplicationTrace _trace_, final EObject c) {
try {
return typeInternal(_environment_, _trace_, c);
} catch (Exception _e_type) {
return resultForFailure(_e_type);
}
}

public Result<Boolean> subtype(final EClass left, final EClass right) {
return subtype(new RuleEnvironment(), null, left, right);
}

public Result<Boolean> subtype(final RuleEnvironment _environment_, final EClass left, final EClass right) {
return subtype(_environment_, null, left, right);
}

public Result<Boolean> subtype(final RuleEnvironment _environment_, final RuleApplicationTrace _trace_, final EClass left, final EClass right) {
try {
return subtypeInternal(_environment_, _trace_, left, right);
} catch (Exception _e_subtype) {
return resultForFailure(_e_subtype);
}
}

public Boolean subtypeSucceeded(final EClass left, final EClass right) {
return subtypeSucceeded(new RuleEnvironment(), null, left, right);
}

public Boolean subtypeSucceeded(final RuleEnvironment _environment_, final EClass left, final EClass right) {
return subtypeSucceeded(_environment_, null, left, right);
}

public Boolean subtypeSucceeded(final RuleEnvironment _environment_, final RuleApplicationTrace _trace_, final EClass left, final EClass right) {
try {
subtypeInternal(_environment_, _trace_, left, right);
Expand All @@ -93,7 +93,7 @@ public Boolean subtypeSucceeded(final RuleEnvironment _environment_, final RuleA
return false;
}
}

protected Result<EClass> typeInternal(final RuleEnvironment _environment_, final RuleApplicationTrace _trace_, final EObject c) {
try {
checkParamsNotNull(c);
Expand All @@ -103,13 +103,13 @@ protected Result<EClass> typeInternal(final RuleEnvironment _environment_, final
return null;
}
}

protected void typeThrowException(final String _error, final String _issue, final Exception _ex, final EObject c, final ErrorInformation[] _errorInformations) throws RuleFailedException {
String error = (("cannot find " + c) + "\'s EClass");
throwRuleFailedException(error,
_issue, _ex, new ErrorInformation(null, null));
}

protected Result<Boolean> subtypeInternal(final RuleEnvironment _environment_, final RuleApplicationTrace _trace_, final EClass left, final EClass right) {
try {
checkParamsNotNull(left, right);
Expand All @@ -119,7 +119,7 @@ protected Result<Boolean> subtypeInternal(final RuleEnvironment _environment_, f
return null;
}
}

protected void subtypeThrowException(final String _error, final String _issue, final Exception _ex, final EClass left, final EClass right, final ErrorInformation[] _errorInformations) throws RuleFailedException {
String _name = left.getName();
String _plus = (_name + " is not a subtype of ");
Expand All @@ -132,7 +132,7 @@ protected void subtypeThrowException(final String _error, final String _issue, f
throwRuleFailedException(error,
_issue, _ex, new ErrorInformation(source, feature));
}

protected Result<EClass> typeImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final EObject obj) throws RuleFailedException {
try {
final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
Expand All @@ -151,13 +151,13 @@ public Object get() {
return null;
}
}

protected Result<EClass> applyRuleEObjectEClass(final RuleEnvironment G, final RuleApplicationTrace _trace_, final EObject obj) throws RuleFailedException {
EClass eClass = null; // output parameter
eClass = obj.eClass();
return new Result<EClass>(eClass);
}

protected Result<EClass> typeImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final EClass obj) throws RuleFailedException {
try {
final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
Expand All @@ -174,13 +174,13 @@ public Object get() {
return null;
}
}

protected Result<EClass> applyRuleEObjectEClassWithErrorSpecification(final RuleEnvironment G, final RuleApplicationTrace _trace_, final EClass obj) throws RuleFailedException {
EClass eClass = null; // output parameter
eClass = obj.eClass();
return new Result<EClass>(eClass);
}

private void eObjectEClassWithErrorSpecificationThrowException(final Exception e_applyRuleEObjectEClassWithErrorSpecification, final EClass obj) throws RuleFailedException {
String _stringRep = this.stringRep(obj);
String _plus = ("cannot find EClass for EClass " + _stringRep);
Expand All @@ -191,7 +191,7 @@ private void eObjectEClassWithErrorSpecificationThrowException(final Exception e
throwRuleFailedException(error,
EOBJECTECLASSWITHERRORSPECIFICATION, e_applyRuleEObjectEClassWithErrorSpecification, new ErrorInformation(source, feature));
}

protected Result<Boolean> subtypeImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final EClass candidate, final EClass superClass) throws RuleFailedException {
try {
final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
Expand All @@ -210,7 +210,7 @@ public Object get() {
return null;
}
}

protected Result<Boolean> applyRuleEClassSubtyping(final RuleEnvironment G, final RuleApplicationTrace _trace_, final EClass candidate, final EClass superClass) throws RuleFailedException {
/* superClass.isSuperTypeOf(candidate) */
if (!superClass.isSuperTypeOf(candidate)) {
Expand Down
Expand Up @@ -19,10 +19,10 @@
public class TypeSystemValidator extends AbstractDeclarativeValidator {
@Inject
protected XsemanticsValidatorErrorGenerator errorGenerator;

@Inject
protected TypeSystem xsemanticsSystem;

protected TypeSystem getXsemanticsSystem() {
return this.xsemanticsSystem;
}
Expand Down
Expand Up @@ -30,19 +30,19 @@
@SuppressWarnings("all")
public class TypeSystem extends XsemanticsRuntimeSystem {
public static final String ECLASSEOBJECT = "org.eclipse.xsemantics.test.expressions.ecore.EClassEObject";

public static final String TESTFORTHIS = "org.eclipse.xsemantics.test.expressions.ecore.TestForThis";

private PolymorphicDispatcher<Result<EObject>> typeDispatcher;

private PolymorphicDispatcher<Result<EObject>> type2Dispatcher;

private PolymorphicDispatcher<Result<EClass>> testforthisDispatcher;

public TypeSystem() {
init();
}

public void init() {
typeDispatcher = buildPolymorphicDispatcher1(
"typeImpl", 3, "|-", ":");
Expand All @@ -51,55 +51,55 @@ public void init() {
testforthisDispatcher = buildPolymorphicDispatcher1(
"testforthisImpl", 3, "|~", ":");
}

public Result<EObject> type(final EClass c) {
return type(new RuleEnvironment(), null, c);
}

public Result<EObject> type(final RuleEnvironment _environment_, final EClass c) {
return type(_environment_, null, c);
}

public Result<EObject> type(final RuleEnvironment _environment_, final RuleApplicationTrace _trace_, final EClass c) {
try {
return typeInternal(_environment_, _trace_, c);
} catch (Exception _e_type) {
return resultForFailure(_e_type);
}
}

public Result<EObject> type2(final EClass c) {
return type2(new RuleEnvironment(), null, c);
}

public Result<EObject> type2(final RuleEnvironment _environment_, final EClass c) {
return type2(_environment_, null, c);
}

public Result<EObject> type2(final RuleEnvironment _environment_, final RuleApplicationTrace _trace_, final EClass c) {
try {
return type2Internal(_environment_, _trace_, c);
} catch (Exception _e_type2) {
return resultForFailure(_e_type2);
}
}

public Result<EClass> testforthis(final EObject obj) {
return testforthis(new RuleEnvironment(), null, obj);
}

public Result<EClass> testforthis(final RuleEnvironment _environment_, final EObject obj) {
return testforthis(_environment_, null, obj);
}

public Result<EClass> testforthis(final RuleEnvironment _environment_, final RuleApplicationTrace _trace_, final EObject obj) {
try {
return testforthisInternal(_environment_, _trace_, obj);
} catch (Exception _e_testforthis) {
return resultForFailure(_e_testforthis);
}
}

protected Result<EObject> typeInternal(final RuleEnvironment _environment_, final RuleApplicationTrace _trace_, final EClass c) {
try {
checkParamsNotNull(c);
Expand All @@ -109,11 +109,11 @@ protected Result<EObject> typeInternal(final RuleEnvironment _environment_, fina
return null;
}
}

protected void typeThrowException(final String _error, final String _issue, final Exception _ex, final EClass c, final ErrorInformation[] _errorInformations) throws RuleFailedException {
throwRuleFailedException(_error, _issue, _ex, _errorInformations);
}

protected Result<EObject> type2Internal(final RuleEnvironment _environment_, final RuleApplicationTrace _trace_, final EClass c) {
try {
checkParamsNotNull(c);
Expand All @@ -123,11 +123,11 @@ protected Result<EObject> type2Internal(final RuleEnvironment _environment_, fin
return null;
}
}

protected void type2ThrowException(final String _error, final String _issue, final Exception _ex, final EClass c, final ErrorInformation[] _errorInformations) throws RuleFailedException {
throwRuleFailedException(_error, _issue, _ex, _errorInformations);
}

protected Result<EClass> testforthisInternal(final RuleEnvironment _environment_, final RuleApplicationTrace _trace_, final EObject obj) {
try {
checkParamsNotNull(obj);
Expand All @@ -137,11 +137,11 @@ protected Result<EClass> testforthisInternal(final RuleEnvironment _environment_
return null;
}
}

protected void testforthisThrowException(final String _error, final String _issue, final Exception _ex, final EObject obj, final ErrorInformation[] _errorInformations) throws RuleFailedException {
throwRuleFailedException(_error, _issue, _ex, _errorInformations);
}

protected Result<EObject> typeImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final EClass eClass) throws RuleFailedException {
try {
final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
Expand All @@ -160,7 +160,7 @@ public Object get() {
return null;
}
}

protected Result<EObject> applyRuleEClassEObject(final RuleEnvironment G, final RuleApplicationTrace _trace_, final EClass eClass) throws RuleFailedException {
EObject object = null; // output parameter
/* 'foo' == new String() || 'bar' == new String() */
Expand Down Expand Up @@ -206,7 +206,7 @@ protected Result<EObject> applyRuleEClassEObject(final RuleEnvironment G, final
Boolean b = Boolean.valueOf(false);
return new Result<EObject>(object);
}

protected Result<EClass> testforthisImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final EObject obj) throws RuleFailedException {
try {
final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
Expand All @@ -225,7 +225,7 @@ public Object get() {
return null;
}
}

protected Result<EClass> applyRuleTestForThis(final RuleEnvironment G, final RuleApplicationTrace _trace_, final EObject obj) throws RuleFailedException {
EClass cl = null; // output parameter
cl = this.<EClass>clone(obj.eClass());
Expand Down
Expand Up @@ -22,10 +22,10 @@
public class TypeSystemValidator extends AbstractDeclarativeValidator {
@Inject
protected XsemanticsValidatorErrorGenerator errorGenerator;

@Inject
protected TypeSystem xsemanticsSystem;

protected TypeSystem getXsemanticsSystem() {
return this.xsemanticsSystem;
}
Expand Down

0 comments on commit 0f273a7

Please sign in to comment.