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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
Aggregations