use of org.eclipse.n4js.ts.typeRefs.TypeRef in project n4js by eclipse.
the class InternalTypeSystem method expectedTypeInImpl.
protected Result<TypeRef> expectedTypeInImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final PostfixExpression e, final Expression expression) throws RuleFailedException {
try {
final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
final Result<TypeRef> _result_ = applyRuleExpectedTypeInPostfixExpression(G, _subtrace_, e, expression);
addToTrace(_trace_, new Provider<Object>() {
public Object get() {
return ruleName("expectedTypeInPostfixExpression") + stringRepForEnv(G) + " |- " + stringRep(e) + " |> " + stringRep(expression) + " : " + stringRep(_result_.getFirst());
}
});
addAsSubtrace(_trace_, _subtrace_);
return _result_;
} catch (Exception e_applyRuleExpectedTypeInPostfixExpression) {
expectedTypeInThrowException(ruleName("expectedTypeInPostfixExpression") + stringRepForEnv(G) + " |- " + stringRep(e) + " |> " + stringRep(expression) + " : " + "TypeRef", EXPECTEDTYPEINPOSTFIXEXPRESSION, e_applyRuleExpectedTypeInPostfixExpression, e, expression, new ErrorInformation[] { new ErrorInformation(e), new ErrorInformation(expression) });
return null;
}
}
use of org.eclipse.n4js.ts.typeRefs.TypeRef in project n4js by eclipse.
the class InternalTypeSystem method applyRuleTypeN4ClassExpression.
protected Result<TypeRef> applyRuleTypeN4ClassExpression(final RuleEnvironment G, final RuleApplicationTrace _trace_, final N4ClassExpression e) throws RuleFailedException {
// output parameter
TypeRef T = null;
T = this.applyRuleTypeTypeDefiningElement(G, _trace_, e).getValue();
return new Result<TypeRef>(T);
}
use of org.eclipse.n4js.ts.typeRefs.TypeRef in project n4js by eclipse.
the class InternalTypeSystem method applyRuleExpectedTypeInFormalParameter.
protected Result<TypeRef> applyRuleExpectedTypeInFormalParameter(final RuleEnvironment G, final RuleApplicationTrace _trace_, final FormalParameter formalParam, final Expression initializer) throws RuleFailedException {
// output parameter
TypeRef T = null;
TypeRef _declaredTypeRef = formalParam.getDeclaredTypeRef();
boolean _tripleNotEquals = (_declaredTypeRef != null);
if (_tripleNotEquals) {
T = formalParam.getDeclaredTypeRef();
} else {
TFormalParameter _definedTypeElement = formalParam.getDefinedTypeElement();
TypeRef _typeRef = null;
if (_definedTypeElement != null) {
_typeRef = _definedTypeElement.getTypeRef();
}
boolean _tripleNotEquals_1 = (_typeRef != null);
if (_tripleNotEquals_1) {
T = formalParam.getDefinedTypeElement().getTypeRef();
} else {
T = RuleEnvironmentExtensions.anyTypeRef(G);
}
}
return new Result<TypeRef>(T);
}
use of org.eclipse.n4js.ts.typeRefs.TypeRef in project n4js by eclipse.
the class InternalTypeSystem method applyRuleUpperBoundFunctionTypeExprOrRef.
protected Result<TypeRef> applyRuleUpperBoundFunctionTypeExprOrRef(final RuleEnvironment G, final RuleApplicationTrace _trace_, final FunctionTypeExprOrRef F) throws RuleFailedException {
// output parameter
TypeRef T = null;
T = this.typeSystemHelper.createUpperBoundOfFunctionTypeExprOrRef(G, F);
return new Result<TypeRef>(T);
}
use of org.eclipse.n4js.ts.typeRefs.TypeRef in project n4js by eclipse.
the class InternalTypeSystem method expectedTypeInImpl.
protected Result<TypeRef> expectedTypeInImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final YieldExpression yieldExpr, final Expression expression) throws RuleFailedException {
try {
final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
final Result<TypeRef> _result_ = applyRuleExpectedTypeInYieldStatement(G, _subtrace_, yieldExpr, expression);
addToTrace(_trace_, new Provider<Object>() {
public Object get() {
return ruleName("expectedTypeInYieldStatement") + stringRepForEnv(G) + " |- " + stringRep(yieldExpr) + " |> " + stringRep(expression) + " : " + stringRep(_result_.getFirst());
}
});
addAsSubtrace(_trace_, _subtrace_);
return _result_;
} catch (Exception e_applyRuleExpectedTypeInYieldStatement) {
expectedTypeInThrowException(ruleName("expectedTypeInYieldStatement") + stringRepForEnv(G) + " |- " + stringRep(yieldExpr) + " |> " + stringRep(expression) + " : " + "TypeRef", EXPECTEDTYPEINYIELDSTATEMENT, e_applyRuleExpectedTypeInYieldStatement, yieldExpr, expression, new ErrorInformation[] { new ErrorInformation(yieldExpr), new ErrorInformation(expression) });
return null;
}
}
Aggregations