Search in sources :

Example 1 with LogArguments

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

the class VerdictWithoutReason method process.

@Override
public void process(final IVisitableNode node, final Problems problems) {
    if (!(node instanceof Setverdict_Statement)) {
        return;
    }
    final Setverdict_Statement s = (Setverdict_Statement) node;
    final Value verdictValue = s.getVerdictValue();
    if (verdictValue == null) {
        return;
    }
    final CompilationTimeStamp ct = CompilationTimeStamp.getBaseTimestamp();
    final Type_type temp = verdictValue.getExpressionReturntype(ct, Expected_Value_type.EXPECTED_TEMPLATE);
    if (Type_type.TYPE_VERDICT != temp) {
        return;
    }
    final LogArguments verdictReason = s.getVerdictReason();
    if (Value_type.VERDICT_VALUE.equals(verdictValue.getValuetype()) && !Verdict_type.PASS.equals(((Verdict_Value) verdictValue).getValue()) && verdictReason == null) {
        final String msg = MessageFormat.format(WITHOUT_REASON, ((Verdict_Value) verdictValue).getValue());
        problems.report(s.getLocation(), msg);
    }
}
Also used : LogArguments(org.eclipse.titan.designer.AST.TTCN3.statements.LogArguments) CompilationTimeStamp(org.eclipse.titan.designer.parsers.CompilationTimeStamp) Value(org.eclipse.titan.designer.AST.Value) Verdict_Value(org.eclipse.titan.designer.AST.TTCN3.values.Verdict_Value) Type_type(org.eclipse.titan.designer.AST.IType.Type_type) Verdict_Value(org.eclipse.titan.designer.AST.TTCN3.values.Verdict_Value) Setverdict_Statement(org.eclipse.titan.designer.AST.TTCN3.statements.Setverdict_Statement)

Aggregations

Type_type (org.eclipse.titan.designer.AST.IType.Type_type)1 LogArguments (org.eclipse.titan.designer.AST.TTCN3.statements.LogArguments)1 Setverdict_Statement (org.eclipse.titan.designer.AST.TTCN3.statements.Setverdict_Statement)1 Verdict_Value (org.eclipse.titan.designer.AST.TTCN3.values.Verdict_Value)1 Value (org.eclipse.titan.designer.AST.Value)1 CompilationTimeStamp (org.eclipse.titan.designer.parsers.CompilationTimeStamp)1