Vous devez ajouter votre propre code Java à cette classe pour effectuer les vérifications requises par votre règle personnalisée.
// The package name is set to the package-name portion of analysisRule.ruleclass
package com.example;
import java.util.ArrayList;
import java.util.List;
import com.ibm.etools.cobol.application.model.cobol.*;
import com.ibm.rsar.analysis.codereview.cobol.custom.rules.AbstractCustomCobolAnalysisRule;
import com.ibm.rsar.analysis.codereview.cobol.custom.model.util.*;
// The class name is set to the class-name portion of analysisRule.ruleclass
public class CobolRule extends
AbstractCustomCobolAnalysisRule {
@Override
public List<ASTNode> performRule(ASTNode baseNode) {
final List<ASTNode> tokens = new ArrayList<ASTNode>();
COBOLVisitorAdapter adapter = new COBOLVisitorAdapter();
adapter.accept(baseNode, new AbstractCOBOLVisitor() {
@Override
public void unimplementedVisitor(String s) {
}
@Override
public boolean visit(IdentificationDivision node) {
//TODO analyze node for violations of rule and add violating nodes to tokens
return true;
}
@Override
public boolean visit(DataDivision node) {
//TODO analyze node for violations of rule and add violating nodes to tokens
return true;
}
@Override
public boolean visit(ProcedureDivision node) {
//TODO analyze node for violations of rule and add violating nodes to tokens
return true;
}
});
return tokens;
}
}