private boolean isOverriddenMethod(AstNode memberDeclarator) { List<AstNode> modifiers = memberDeclarator.getDescendants(CxxGrammarImpl.cliFunctionModifier); for (AstNode modifier : modifiers) { AstNode modifierId = modifier.getFirstChild(); if (TOKEN_OVERRIDE.equals(modifierId.getTokenValue())) { return true; } } return false; }
@Override public void visitNode(AstNode node) { for (AstNode nestedNode : node.getDescendants(PuppetGrammar.CLASSDEF, PuppetGrammar.DEFINITION)) { message = "Move this nested " + (nestedNode.is(PuppetGrammar.CLASSDEF) ? "class " : "define ") + "\"" + nestedNode.getFirstChild(PuppetGrammar.CLASSNAME).getTokenValue() + "\"" + " outside of " + (node.is(PuppetGrammar.CLASSDEF) ? "class " : "define ") + "\"" + node.getFirstChild(PuppetGrammar.CLASSNAME).getTokenValue() + "\"" + "."; addIssue(nestedNode, this, message); } }