use of org.eclipse.xsemantics.runtime.ErrorInformation in project n4js by eclipse.
the class InternalTypeSystem method typeImpl.
protected Result<TypeRef> typeImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final ModuleNamespaceVirtualType t) throws RuleFailedException {
try {
final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
final Result<TypeRef> _result_ = applyRuleTypeModuleNamespace(G, _subtrace_, t);
addToTrace(_trace_, new Provider<Object>() {
public Object get() {
return ruleName("typeModuleNamespace") + stringRepForEnv(G) + " |- " + stringRep(t) + " : " + stringRep(_result_.getFirst());
}
});
addAsSubtrace(_trace_, _subtrace_);
return _result_;
} catch (Exception e_applyRuleTypeModuleNamespace) {
typeThrowException(ruleName("typeModuleNamespace") + stringRepForEnv(G) + " |- " + stringRep(t) + " : " + "TypeRef", TYPEMODULENAMESPACE, e_applyRuleTypeModuleNamespace, t, new ErrorInformation[] { new ErrorInformation(t) });
return null;
}
}
use of org.eclipse.xsemantics.runtime.ErrorInformation in project n4js by eclipse.
the class N4JSValidatorErrorGenerator method generateErrors.
/**
* Copied from super class to create error messages from RuleFailedExceptions via method
* {@link TypeSystemErrorExtensions#compileMessage(RuleFailedException)}.
*/
@Override
protected void generateErrors(ValidationMessageAcceptor validationMessageAcceptor, RuleFailedException ruleFailedException, EObject originalSource) {
if (ruleFailedException == null) {
return;
}
Iterable<RuleFailedException> allFailures = filter.filterRuleFailedExceptions(ruleFailedException);
// the last information about a model element with error
ErrorInformation lastErrorInformationWithSource = null;
// an associated model element
for (RuleFailedException ruleFailedException2 : allFailures) {
lastErrorInformationWithSource = generateErrors(validationMessageAcceptor, // only change w.r.t. super-class method:
TypeSystemErrorExtensions.compileMessage(ruleFailedException2), // ================================================================
ruleFailedException2.getIssue(), filter.filterErrorInformation(ruleFailedException2), lastErrorInformationWithSource, originalSource);
}
}
use of org.eclipse.xsemantics.runtime.ErrorInformation in project n4js by eclipse.
the class InternalTypeSystem method expectedTypeInImpl.
protected Result<TypeRef> expectedTypeInImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final BinaryLogicalExpression e, final Expression expression) throws RuleFailedException {
try {
final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
final Result<TypeRef> _result_ = applyRuleExpectedTypeInBinaryLogicalExpression(G, _subtrace_, e, expression);
addToTrace(_trace_, new Provider<Object>() {
public Object get() {
return ruleName("expectedTypeInBinaryLogicalExpression") + stringRepForEnv(G) + " |- " + stringRep(e) + " |> " + stringRep(expression) + " : " + stringRep(_result_.getFirst());
}
});
addAsSubtrace(_trace_, _subtrace_);
return _result_;
} catch (Exception e_applyRuleExpectedTypeInBinaryLogicalExpression) {
expectedTypeInThrowException(ruleName("expectedTypeInBinaryLogicalExpression") + stringRepForEnv(G) + " |- " + stringRep(e) + " |> " + stringRep(expression) + " : " + "ParameterizedTypeRef", EXPECTEDTYPEINBINARYLOGICALEXPRESSION, e_applyRuleExpectedTypeInBinaryLogicalExpression, e, expression, new ErrorInformation[] { new ErrorInformation(e), new ErrorInformation(expression) });
return null;
}
}
use of org.eclipse.xsemantics.runtime.ErrorInformation in project n4js by eclipse.
the class InternalTypeSystem method typeImpl.
protected Result<TypeRef> typeImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final ConditionalExpression expr) throws RuleFailedException {
try {
final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
final Result<TypeRef> _result_ = applyRuleTypeConditionalExpression(G, _subtrace_, expr);
addToTrace(_trace_, new Provider<Object>() {
public Object get() {
return ruleName("typeConditionalExpression") + stringRepForEnv(G) + " |- " + stringRep(expr) + " : " + stringRep(_result_.getFirst());
}
});
addAsSubtrace(_trace_, _subtrace_);
return _result_;
} catch (Exception e_applyRuleTypeConditionalExpression) {
typeThrowException(ruleName("typeConditionalExpression") + stringRepForEnv(G) + " |- " + stringRep(expr) + " : " + "TypeRef", TYPECONDITIONALEXPRESSION, e_applyRuleTypeConditionalExpression, expr, new ErrorInformation[] { new ErrorInformation(expr) });
return null;
}
}
use of org.eclipse.xsemantics.runtime.ErrorInformation in project n4js by eclipse.
the class InternalTypeSystem method typeImpl.
protected Result<TypeRef> typeImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final BinaryLogicalExpression e) throws RuleFailedException {
try {
final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
final Result<TypeRef> _result_ = applyRuleTypeBinaryLogicalExpression(G, _subtrace_, e);
addToTrace(_trace_, new Provider<Object>() {
public Object get() {
return ruleName("typeBinaryLogicalExpression") + stringRepForEnv(G) + " |- " + stringRep(e) + " : " + stringRep(_result_.getFirst());
}
});
addAsSubtrace(_trace_, _subtrace_);
return _result_;
} catch (Exception e_applyRuleTypeBinaryLogicalExpression) {
typeThrowException(ruleName("typeBinaryLogicalExpression") + stringRepForEnv(G) + " |- " + stringRep(e) + " : " + "TypeRef", TYPEBINARYLOGICALEXPRESSION, e_applyRuleTypeBinaryLogicalExpression, e, new ErrorInformation[] { new ErrorInformation(e) });
return null;
}
}
Aggregations