Search in sources :

Example 31 with Structure

use of net.sourceforge.pmd.lang.dfa.Structure in project pmd by pmd.

the class StatementAndBraceFinder method visit.

@Override
public Object visit(ASTEmbeddedSqlStatement node, Object data) {
    if (!(data instanceof Structure)) {
        if (LOGGER.isLoggable(Level.FINEST)) {
            LOGGER.finest("immediate return ASTEmbeddedSqlStatement: line " + node.getBeginLine() + ", column " + node.getBeginColumn());
        }
        return data;
    }
    Structure dataFlow = (Structure) data;
    dataFlow.createNewNode(node);
    if (LOGGER.isLoggable(Level.FINEST)) {
        LOGGER.finest("createNewNode ASTEmbeddedSqlStatement: line " + node.getBeginLine() + ", column " + node.getBeginColumn());
    }
    return super.visit(node, data);
}
Also used : Structure(net.sourceforge.pmd.lang.dfa.Structure)

Example 32 with Structure

use of net.sourceforge.pmd.lang.dfa.Structure in project pmd by pmd.

the class StatementAndBraceFinder method visit.

@Override
public Object visit(ASTOpenStatement node, Object data) {
    if (!(data instanceof Structure)) {
        return data;
    }
    Structure dataFlow = (Structure) data;
    dataFlow.createNewNode(node);
    if (LOGGER.isLoggable(Level.FINEST)) {
        LOGGER.finest("createNewNode ASTOpenStatement: line " + node.getBeginLine() + ", column " + node.getBeginColumn());
    }
    return super.visit(node, data);
}
Also used : Structure(net.sourceforge.pmd.lang.dfa.Structure)

Example 33 with Structure

use of net.sourceforge.pmd.lang.dfa.Structure in project pmd by pmd.

the class StatementAndBraceFinder method visit.

/**
 * Treat a PLSQL GOTO like a Java "continue"
 *
 * @param node
 * @param data
 * @return
 */
@Override
public Object visit(ASTGotoStatement node, Object data) {
    if (!(data instanceof Structure)) {
        return data;
    }
    Structure dataFlow = (Structure) data;
    dataFlow.createNewNode(node);
    dataFlow.pushOnStack(NodeType.CONTINUE_STATEMENT, dataFlow.getLast());
    if (LOGGER.isLoggable(Level.FINEST)) {
        LOGGER.finest("pushOnStack (ASTGotoStatement) CONTINUE_STATEMENT (GOTO): line " + node.getBeginLine() + ", column " + node.getBeginColumn());
    }
    return super.visit(node, data);
}
Also used : Structure(net.sourceforge.pmd.lang.dfa.Structure)

Example 34 with Structure

use of net.sourceforge.pmd.lang.dfa.Structure in project pmd by pmd.

the class StatementAndBraceFinder method visit.

@Override
public Object visit(ASTReturnStatement node, Object data) {
    if (!(data instanceof Structure)) {
        return data;
    }
    Structure dataFlow = (Structure) data;
    dataFlow.createNewNode(node);
    dataFlow.pushOnStack(NodeType.RETURN_STATEMENT, dataFlow.getLast());
    if (LOGGER.isLoggable(Level.FINEST)) {
        LOGGER.finest("pushOnStack RETURN_STATEMENT: line " + node.getBeginLine() + ", column " + node.getBeginColumn());
    }
    return super.visit(node, data);
}
Also used : Structure(net.sourceforge.pmd.lang.dfa.Structure)

Example 35 with Structure

use of net.sourceforge.pmd.lang.dfa.Structure in project pmd by pmd.

the class StatementAndBraceFinder method visit.

/**
 * Treat a PLSQL EXIT like a Java "break"
 *
 * @param node
 * @param data
 * @return
 */
@Override
public Object visit(ASTExitStatement node, Object data) {
    if (!(data instanceof Structure)) {
        return data;
    }
    Structure dataFlow = (Structure) data;
    dataFlow.createNewNode(node);
    dataFlow.pushOnStack(NodeType.BREAK_STATEMENT, dataFlow.getLast());
    if (LOGGER.isLoggable(Level.FINEST)) {
        LOGGER.finest("pushOnStack (ASTExitStatement) BREAK_STATEMENT: line " + node.getBeginLine() + ", column " + node.getBeginColumn());
    }
    return super.visit(node, data);
}
Also used : Structure(net.sourceforge.pmd.lang.dfa.Structure)

Aggregations

Structure (net.sourceforge.pmd.lang.dfa.Structure)36 Node (net.sourceforge.pmd.lang.ast.Node)2 Linker (net.sourceforge.pmd.lang.dfa.Linker)2 LinkerException (net.sourceforge.pmd.lang.dfa.LinkerException)2 SequenceException (net.sourceforge.pmd.lang.dfa.SequenceException)2 ASTDoStatement (net.sourceforge.pmd.lang.java.ast.ASTDoStatement)2 ASTForStatement (net.sourceforge.pmd.lang.java.ast.ASTForStatement)2 ASTIfStatement (net.sourceforge.pmd.lang.java.ast.ASTIfStatement)2 ASTMethodDeclaration (net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration)2 ASTWhileStatement (net.sourceforge.pmd.lang.java.ast.ASTWhileStatement)2 ASTElseClause (net.sourceforge.pmd.lang.plsql.ast.ASTElseClause)2 ASTElsifClause (net.sourceforge.pmd.lang.plsql.ast.ASTElsifClause)2 ASTForStatement (net.sourceforge.pmd.lang.plsql.ast.ASTForStatement)2 ASTIfStatement (net.sourceforge.pmd.lang.plsql.ast.ASTIfStatement)2 ASTLabelledStatement (net.sourceforge.pmd.lang.plsql.ast.ASTLabelledStatement)2 ASTLoopStatement (net.sourceforge.pmd.lang.plsql.ast.ASTLoopStatement)2 ASTWhileStatement (net.sourceforge.pmd.lang.plsql.ast.ASTWhileStatement)2 List (java.util.List)1 ASTAssertStatement (net.sourceforge.pmd.lang.java.ast.ASTAssertStatement)1 ASTConstructorDeclaration (net.sourceforge.pmd.lang.java.ast.ASTConstructorDeclaration)1