Search in sources :

Example 1 with ApplyExpression

use of org.eclipse.titan.designer.AST.TTCN3.values.expressions.ApplyExpression in project titan.EclipsePlug-ins by eclipse.

the class SpecificValue_Template method checkSpecificValue.

@Override
public /**
 * {@inheritDoc}
 */
void checkSpecificValue(final CompilationTimeStamp timestamp, final boolean allowOmit) {
    if (specificValue == null) {
        return;
    }
    switch(specificValue.getValuetype()) {
        case EXPRESSION_VALUE:
            // checked later
            break;
        case OMIT_VALUE:
            if (!allowOmit) {
                getLocation().reportSemanticError(OmitValue_Template.SPECIFICVALUEEXPECTED);
            }
            return;
        default:
            return;
    }
    final Expression_Value expressionValue = (Expression_Value) specificValue;
    if (!Operation_type.APPLY_OPERATION.equals(expressionValue.getOperationType())) {
        return;
    }
    expressionValue.setLoweridToReference(timestamp);
    IType type = ((ApplyExpression) expressionValue).getExpressionGovernor(timestamp, Expected_Value_type.EXPECTED_DYNAMIC_VALUE);
    if (type == null) {
        return;
    }
    type = type.getTypeRefdLast(timestamp);
    if (Type_type.TYPE_FUNCTION.equals(type.getTypetype()) && ((Function_Type) type).returnsTemplate()) {
        final ITTCN3Template template = setTemplatetype(timestamp, Template_type.TEMPLATE_INVOKE);
        template.checkSpecificValue(timestamp, allowOmit);
    }
}
Also used : Expression_Value(org.eclipse.titan.designer.AST.TTCN3.values.Expression_Value) ApplyExpression(org.eclipse.titan.designer.AST.TTCN3.values.expressions.ApplyExpression) IType(org.eclipse.titan.designer.AST.IType)

Aggregations

IType (org.eclipse.titan.designer.AST.IType)1 Expression_Value (org.eclipse.titan.designer.AST.TTCN3.values.Expression_Value)1 ApplyExpression (org.eclipse.titan.designer.AST.TTCN3.values.expressions.ApplyExpression)1