CxxGrammarImpl.iterationStatement);
}
@Override
public void visitNode(AstNode astNode) {
AstNode statement = astNode.getFirstChild(CxxGrammarImpl.statement);
if (!statement.getFirstChild().is(CxxGrammarImpl.compoundStatement)) {
getContext().createLineViolation(this, "Missing curly brace.", astNode);
}
if (astNode.is(CxxGrammarImpl.ifStatement)) {
AstNode elseClause = astNode.getFirstChild(CxxKeyword.ELSE);
if (elseClause != null) {
statement = elseClause.getNextSibling();
if (!statement.getFirstChild().is(CxxGrammarImpl.compoundStatement) && !statement.getFirstChild().is(CxxGrammarImpl.ifStatement)) {
getContext().createLineViolation(this, "Missing curly brace.", elseClause);
}
}
}