Search in sources :

Example 1 with ActivateExpression

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

the class FMDefaultActivations method measure.

@Override
public Number measure(final MetricData data, final Def_Function function) {
    final Counter count = new Counter(0);
    function.accept(new CounterVisitor(count) {

        @Override
        public int visit(final IVisitableNode node) {
            if (node instanceof Activate_Statement) {
                count.inc();
            } else if (node instanceof Activate_Referenced_Statement) {
                count.inc();
            } else if (node instanceof ActivateDereferedExpression) {
                count.inc();
            } else if (node instanceof ActivateExpression) {
                count.inc();
            }
            return V_CONTINUE;
        }
    });
    return count.val();
}
Also used : ActivateExpression(org.eclipse.titan.designer.AST.TTCN3.values.expressions.ActivateExpression) Counter(org.eclipse.titanium.metrics.visitors.Counter) Activate_Statement(org.eclipse.titan.designer.AST.TTCN3.statements.Activate_Statement) CounterVisitor(org.eclipse.titanium.metrics.visitors.CounterVisitor) Activate_Referenced_Statement(org.eclipse.titan.designer.AST.TTCN3.statements.Activate_Referenced_Statement) ActivateDereferedExpression(org.eclipse.titan.designer.AST.TTCN3.values.expressions.ActivateDereferedExpression) IVisitableNode(org.eclipse.titan.designer.AST.IVisitableNode)

Aggregations

IVisitableNode (org.eclipse.titan.designer.AST.IVisitableNode)1 Activate_Referenced_Statement (org.eclipse.titan.designer.AST.TTCN3.statements.Activate_Referenced_Statement)1 Activate_Statement (org.eclipse.titan.designer.AST.TTCN3.statements.Activate_Statement)1 ActivateDereferedExpression (org.eclipse.titan.designer.AST.TTCN3.values.expressions.ActivateDereferedExpression)1 ActivateExpression (org.eclipse.titan.designer.AST.TTCN3.values.expressions.ActivateExpression)1 Counter (org.eclipse.titanium.metrics.visitors.Counter)1 CounterVisitor (org.eclipse.titanium.metrics.visitors.CounterVisitor)1