Search in sources :

Example 96 with RuleApplicationTrace

use of org.eclipse.xsemantics.runtime.RuleApplicationTrace in project n4js by eclipse.

the class InternalTypeSystem method equaltypeImpl.

protected Result<Boolean> equaltypeImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final TypeRef left, final TypeRef right) throws RuleFailedException {
    try {
        final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
        final Result<Boolean> _result_ = applyRuleEqualTypeTypeRef(G, _subtrace_, left, right);
        addToTrace(_trace_, new Provider<Object>() {

            public Object get() {
                return ruleName("equalTypeTypeRef") + stringRepForEnv(G) + " |- " + stringRep(left) + " ~~ " + stringRep(right);
            }
        });
        addAsSubtrace(_trace_, _subtrace_);
        return _result_;
    } catch (Exception e_applyRuleEqualTypeTypeRef) {
        equaltypeThrowException(ruleName("equalTypeTypeRef") + stringRepForEnv(G) + " |- " + stringRep(left) + " ~~ " + stringRep(right), EQUALTYPETYPEREF, e_applyRuleEqualTypeTypeRef, left, right, new ErrorInformation[] { new ErrorInformation(left), new ErrorInformation(right) });
        return null;
    }
}
Also used : ErrorInformation(org.eclipse.xsemantics.runtime.ErrorInformation) RuleApplicationTrace(org.eclipse.xsemantics.runtime.RuleApplicationTrace) EObject(org.eclipse.emf.ecore.EObject) RuleFailedException(org.eclipse.xsemantics.runtime.RuleFailedException)

Example 97 with RuleApplicationTrace

use of org.eclipse.xsemantics.runtime.RuleApplicationTrace in project n4js by eclipse.

the class InternalTypeSystem method typeImpl.

protected Result<TypeRef> typeImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final TypeDefiningElement elem) throws RuleFailedException {
    try {
        final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
        final Result<TypeRef> _result_ = applyRuleTypeTypeDefiningElement(G, _subtrace_, elem);
        addToTrace(_trace_, new Provider<Object>() {

            public Object get() {
                return ruleName("typeTypeDefiningElement") + stringRepForEnv(G) + " |- " + stringRep(elem) + " : " + stringRep(_result_.getFirst());
            }
        });
        addAsSubtrace(_trace_, _subtrace_);
        return _result_;
    } catch (Exception e_applyRuleTypeTypeDefiningElement) {
        typeThrowException(ruleName("typeTypeDefiningElement") + stringRepForEnv(G) + " |- " + stringRep(elem) + " : " + "TypeRef", TYPETYPEDEFININGELEMENT, e_applyRuleTypeTypeDefiningElement, elem, new ErrorInformation[] { new ErrorInformation(elem) });
        return null;
    }
}
Also used : ErrorInformation(org.eclipse.xsemantics.runtime.ErrorInformation) ThisTypeRef(org.eclipse.n4js.ts.typeRefs.ThisTypeRef) ParameterizedTypeRef(org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef) BaseTypeRef(org.eclipse.n4js.ts.typeRefs.BaseTypeRef) FunctionTypeRef(org.eclipse.n4js.ts.typeRefs.FunctionTypeRef) ExistentialTypeRef(org.eclipse.n4js.ts.typeRefs.ExistentialTypeRef) BoundThisTypeRef(org.eclipse.n4js.ts.typeRefs.BoundThisTypeRef) StructuralTypeRef(org.eclipse.n4js.ts.typeRefs.StructuralTypeRef) TypeRef(org.eclipse.n4js.ts.typeRefs.TypeRef) TypeTypeRef(org.eclipse.n4js.ts.typeRefs.TypeTypeRef) StaticBaseTypeRef(org.eclipse.n4js.ts.typeRefs.StaticBaseTypeRef) ComposedTypeRef(org.eclipse.n4js.ts.typeRefs.ComposedTypeRef) UnknownTypeRef(org.eclipse.n4js.ts.typeRefs.UnknownTypeRef) RuleApplicationTrace(org.eclipse.xsemantics.runtime.RuleApplicationTrace) EObject(org.eclipse.emf.ecore.EObject) RuleFailedException(org.eclipse.xsemantics.runtime.RuleFailedException)

Example 98 with RuleApplicationTrace

use of org.eclipse.xsemantics.runtime.RuleApplicationTrace in project n4js by eclipse.

the class InternalTypeSystem method subtypeImpl.

protected Result<Boolean> subtypeImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final BoundThisTypeRef left, final BoundThisTypeRef right) throws RuleFailedException {
    try {
        final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
        final Result<Boolean> _result_ = applyRuleSubtypeBoundThisTypeRef(G, _subtrace_, left, right);
        addToTrace(_trace_, new Provider<Object>() {

            public Object get() {
                return ruleName("subtypeBoundThisTypeRef") + stringRepForEnv(G) + " |- " + stringRep(left) + " <: " + stringRep(right);
            }
        });
        addAsSubtrace(_trace_, _subtrace_);
        return _result_;
    } catch (Exception e_applyRuleSubtypeBoundThisTypeRef) {
        subtypeThrowException(ruleName("subtypeBoundThisTypeRef") + stringRepForEnv(G) + " |- " + stringRep(left) + " <: " + stringRep(right), SUBTYPEBOUNDTHISTYPEREF, e_applyRuleSubtypeBoundThisTypeRef, left, right, new ErrorInformation[] { new ErrorInformation(left), new ErrorInformation(right) });
        return null;
    }
}
Also used : ErrorInformation(org.eclipse.xsemantics.runtime.ErrorInformation) RuleApplicationTrace(org.eclipse.xsemantics.runtime.RuleApplicationTrace) EObject(org.eclipse.emf.ecore.EObject) RuleFailedException(org.eclipse.xsemantics.runtime.RuleFailedException)

Example 99 with RuleApplicationTrace

use of org.eclipse.xsemantics.runtime.RuleApplicationTrace in project n4js by eclipse.

the class InternalTypeSystem method expectedTypeInImpl.

protected Result<TypeRef> expectedTypeInImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final N4FieldDeclaration fdecl, final Expression rhs) throws RuleFailedException {
    try {
        final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
        final Result<TypeRef> _result_ = applyRuleExpectedTypeOfRightSideInN4FieldDeclaration(G, _subtrace_, fdecl, rhs);
        addToTrace(_trace_, new Provider<Object>() {

            public Object get() {
                return ruleName("expectedTypeOfRightSideInN4FieldDeclaration") + stringRepForEnv(G) + " |- " + stringRep(fdecl) + " |> " + stringRep(rhs) + " : " + stringRep(_result_.getFirst());
            }
        });
        addAsSubtrace(_trace_, _subtrace_);
        return _result_;
    } catch (Exception e_applyRuleExpectedTypeOfRightSideInN4FieldDeclaration) {
        expectedTypeInThrowException(ruleName("expectedTypeOfRightSideInN4FieldDeclaration") + stringRepForEnv(G) + " |- " + stringRep(fdecl) + " |> " + stringRep(rhs) + " : " + "TypeRef", EXPECTEDTYPEOFRIGHTSIDEINN4FIELDDECLARATION, e_applyRuleExpectedTypeOfRightSideInN4FieldDeclaration, fdecl, rhs, new ErrorInformation[] { new ErrorInformation(fdecl), new ErrorInformation(rhs) });
        return null;
    }
}
Also used : ErrorInformation(org.eclipse.xsemantics.runtime.ErrorInformation) ThisTypeRef(org.eclipse.n4js.ts.typeRefs.ThisTypeRef) ParameterizedTypeRef(org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef) BaseTypeRef(org.eclipse.n4js.ts.typeRefs.BaseTypeRef) FunctionTypeRef(org.eclipse.n4js.ts.typeRefs.FunctionTypeRef) ExistentialTypeRef(org.eclipse.n4js.ts.typeRefs.ExistentialTypeRef) BoundThisTypeRef(org.eclipse.n4js.ts.typeRefs.BoundThisTypeRef) StructuralTypeRef(org.eclipse.n4js.ts.typeRefs.StructuralTypeRef) TypeRef(org.eclipse.n4js.ts.typeRefs.TypeRef) TypeTypeRef(org.eclipse.n4js.ts.typeRefs.TypeTypeRef) StaticBaseTypeRef(org.eclipse.n4js.ts.typeRefs.StaticBaseTypeRef) ComposedTypeRef(org.eclipse.n4js.ts.typeRefs.ComposedTypeRef) UnknownTypeRef(org.eclipse.n4js.ts.typeRefs.UnknownTypeRef) RuleApplicationTrace(org.eclipse.xsemantics.runtime.RuleApplicationTrace) EObject(org.eclipse.emf.ecore.EObject) RuleFailedException(org.eclipse.xsemantics.runtime.RuleFailedException)

Example 100 with RuleApplicationTrace

use of org.eclipse.xsemantics.runtime.RuleApplicationTrace in project n4js by eclipse.

the class InternalTypeSystem method typeImpl.

protected Result<TypeRef> typeImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final PropertyNameValuePair property) throws RuleFailedException {
    try {
        final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
        final Result<TypeRef> _result_ = applyRuleTypePropertyNameValuePair(G, _subtrace_, property);
        addToTrace(_trace_, new Provider<Object>() {

            public Object get() {
                return ruleName("typePropertyNameValuePair") + stringRepForEnv(G) + " |- " + stringRep(property) + " : " + stringRep(_result_.getFirst());
            }
        });
        addAsSubtrace(_trace_, _subtrace_);
        return _result_;
    } catch (Exception e_applyRuleTypePropertyNameValuePair) {
        typeThrowException(ruleName("typePropertyNameValuePair") + stringRepForEnv(G) + " |- " + stringRep(property) + " : " + "TypeRef", TYPEPROPERTYNAMEVALUEPAIR, e_applyRuleTypePropertyNameValuePair, property, new ErrorInformation[] { new ErrorInformation(property) });
        return null;
    }
}
Also used : ErrorInformation(org.eclipse.xsemantics.runtime.ErrorInformation) ThisTypeRef(org.eclipse.n4js.ts.typeRefs.ThisTypeRef) ParameterizedTypeRef(org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef) BaseTypeRef(org.eclipse.n4js.ts.typeRefs.BaseTypeRef) FunctionTypeRef(org.eclipse.n4js.ts.typeRefs.FunctionTypeRef) ExistentialTypeRef(org.eclipse.n4js.ts.typeRefs.ExistentialTypeRef) BoundThisTypeRef(org.eclipse.n4js.ts.typeRefs.BoundThisTypeRef) StructuralTypeRef(org.eclipse.n4js.ts.typeRefs.StructuralTypeRef) TypeRef(org.eclipse.n4js.ts.typeRefs.TypeRef) TypeTypeRef(org.eclipse.n4js.ts.typeRefs.TypeTypeRef) StaticBaseTypeRef(org.eclipse.n4js.ts.typeRefs.StaticBaseTypeRef) ComposedTypeRef(org.eclipse.n4js.ts.typeRefs.ComposedTypeRef) UnknownTypeRef(org.eclipse.n4js.ts.typeRefs.UnknownTypeRef) RuleApplicationTrace(org.eclipse.xsemantics.runtime.RuleApplicationTrace) EObject(org.eclipse.emf.ecore.EObject) RuleFailedException(org.eclipse.xsemantics.runtime.RuleFailedException)

Aggregations

EObject (org.eclipse.emf.ecore.EObject)127 ErrorInformation (org.eclipse.xsemantics.runtime.ErrorInformation)127 RuleApplicationTrace (org.eclipse.xsemantics.runtime.RuleApplicationTrace)127 RuleFailedException (org.eclipse.xsemantics.runtime.RuleFailedException)127 BaseTypeRef (org.eclipse.n4js.ts.typeRefs.BaseTypeRef)101 BoundThisTypeRef (org.eclipse.n4js.ts.typeRefs.BoundThisTypeRef)101 ComposedTypeRef (org.eclipse.n4js.ts.typeRefs.ComposedTypeRef)101 ExistentialTypeRef (org.eclipse.n4js.ts.typeRefs.ExistentialTypeRef)101 FunctionTypeRef (org.eclipse.n4js.ts.typeRefs.FunctionTypeRef)101 ParameterizedTypeRef (org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef)101 StaticBaseTypeRef (org.eclipse.n4js.ts.typeRefs.StaticBaseTypeRef)101 StructuralTypeRef (org.eclipse.n4js.ts.typeRefs.StructuralTypeRef)101 ThisTypeRef (org.eclipse.n4js.ts.typeRefs.ThisTypeRef)101 TypeRef (org.eclipse.n4js.ts.typeRefs.TypeRef)101 TypeTypeRef (org.eclipse.n4js.ts.typeRefs.TypeTypeRef)101 UnknownTypeRef (org.eclipse.n4js.ts.typeRefs.UnknownTypeRef)101 TypeArgument (org.eclipse.n4js.ts.typeRefs.TypeArgument)9