TrivialEvaluateRule extends CobolCheck { @Override public void visitNode(AstNode evaluateNode) { List<AstNode> whenClauses = evaluateNode.getChildren(getCobolGrammar().evaluateWhen); if (whenClauses.size() == 1) { reportIssue("Change this EVALUATE into an IF statement.").on(evaluateNode.getToken()); } }  @Override void init(); @Override void visitNode(AstNode evaluateNode);  }
@Test public void testVisitNode() { TrivialEvaluateRule check = new TrivialEvaluateRule(); CobolCheckVerifier.verify( new File("src/test/resources/checks/SRC/TrivialEvaluate.cbl"), check); }