Search in sources :

Example 1 with Any_Value_Template

use of org.eclipse.titan.designer.AST.TTCN3.templates.Any_Value_Template in project titan.EclipsePlug-ins by eclipse.

the class SuperfluousTemplate method visit.

@Override
public int visit(final IVisitableNode node) {
    if (node instanceof TemplateInstance) {
        template = (TemplateInstance) node;
        final ITTCN3Template body = template.getTemplateBody();
        if (body instanceof Any_Value_Template || body instanceof AnyOrOmit_Template) {
            final Type type = template.getType();
            if (type == null) {
                // port.receive(?) or port.receive(*)
                receivesAny = true;
            } else if (receivableType != null && type.isIdentical(CompilationTimeStamp.getBaseTimestamp(), receivableType)) {
                // e.g. port.receive(integer:?)
                receivesAllOfType = true;
            }
        }
        // We don't want to investigate nested templates
        return V_SKIP;
    }
    return V_CONTINUE;
}
Also used : ITTCN3Template(org.eclipse.titan.designer.AST.TTCN3.templates.ITTCN3Template) CodeSmellType(org.eclipse.titanium.markers.types.CodeSmellType) Port_Type(org.eclipse.titan.designer.AST.TTCN3.types.Port_Type) Type(org.eclipse.titan.designer.AST.Type) IType(org.eclipse.titan.designer.AST.IType) Any_Value_Template(org.eclipse.titan.designer.AST.TTCN3.templates.Any_Value_Template) AnyOrOmit_Template(org.eclipse.titan.designer.AST.TTCN3.templates.AnyOrOmit_Template) TemplateInstance(org.eclipse.titan.designer.AST.TTCN3.templates.TemplateInstance)

Aggregations

IType (org.eclipse.titan.designer.AST.IType)1 AnyOrOmit_Template (org.eclipse.titan.designer.AST.TTCN3.templates.AnyOrOmit_Template)1 Any_Value_Template (org.eclipse.titan.designer.AST.TTCN3.templates.Any_Value_Template)1 ITTCN3Template (org.eclipse.titan.designer.AST.TTCN3.templates.ITTCN3Template)1 TemplateInstance (org.eclipse.titan.designer.AST.TTCN3.templates.TemplateInstance)1 Port_Type (org.eclipse.titan.designer.AST.TTCN3.types.Port_Type)1 Type (org.eclipse.titan.designer.AST.Type)1 CodeSmellType (org.eclipse.titanium.markers.types.CodeSmellType)1