Search in sources :

Example 6 with If_Clause

use of org.eclipse.titan.designer.AST.TTCN3.statements.If_Clause in project titan.EclipsePlug-ins by eclipse.

the class ContainsRef method visit.

@Override
public int visit(final IVisitableNode node) {
    if (node instanceof If_Statement) {
        final List<If_Clause> ifs = ((If_Statement) node).getIfClauses().getClauses();
        for (final If_Clause clause : ifs) {
            final Value cond = clause.getExpression();
            if (cond != null) {
                final RefUsedInMatching mv = new RefUsedInMatching(redirectValue);
                cond.accept(mv);
                if (mv.getUsed()) {
                    smells = true;
                    suspicious = clause;
                }
            }
        }
        return V_SKIP;
    }
    return V_CONTINUE;
}
Also used : Value(org.eclipse.titan.designer.AST.Value) If_Statement(org.eclipse.titan.designer.AST.TTCN3.statements.If_Statement) If_Clause(org.eclipse.titan.designer.AST.TTCN3.statements.If_Clause)

Aggregations

If_Clause (org.eclipse.titan.designer.AST.TTCN3.statements.If_Clause)6 If_Statement (org.eclipse.titan.designer.AST.TTCN3.statements.If_Statement)4 If_Clauses (org.eclipse.titan.designer.AST.TTCN3.statements.If_Clauses)3 Reference (org.eclipse.titan.designer.AST.Reference)2 Value (org.eclipse.titan.designer.AST.Value)2 ArrayList (java.util.ArrayList)1 ArraySubReference (org.eclipse.titan.designer.AST.ArraySubReference)1 IVisitableNode (org.eclipse.titan.designer.AST.IVisitableNode)1 Identifier (org.eclipse.titan.designer.AST.Identifier)1 Def_Function (org.eclipse.titan.designer.AST.TTCN3.definitions.Def_Function)1 Def_Testcase (org.eclipse.titan.designer.AST.TTCN3.definitions.Def_Testcase)1 Assignment_Statement (org.eclipse.titan.designer.AST.TTCN3.statements.Assignment_Statement)1 Connect_Statement (org.eclipse.titan.designer.AST.TTCN3.statements.Connect_Statement)1 Definition_Statement (org.eclipse.titan.designer.AST.TTCN3.statements.Definition_Statement)1 Disconnect_Statement (org.eclipse.titan.designer.AST.TTCN3.statements.Disconnect_Statement)1 Map_Statement (org.eclipse.titan.designer.AST.TTCN3.statements.Map_Statement)1 Operation_Altguard (org.eclipse.titan.designer.AST.TTCN3.statements.Operation_Altguard)1 Receive_Port_Statement (org.eclipse.titan.designer.AST.TTCN3.statements.Receive_Port_Statement)1 Return_Statement (org.eclipse.titan.designer.AST.TTCN3.statements.Return_Statement)1 Send_Statement (org.eclipse.titan.designer.AST.TTCN3.statements.Send_Statement)1