All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.pmd.lang.plsql.ast.ASTPrimarySuffix Maven / Gradle / Ivy

There is a newer version: 7.7.0
Show newest version
/*
 * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
 */

package net.sourceforge.pmd.lang.plsql.ast;

public final class ASTPrimarySuffix extends AbstractPLSQLNode {
    private boolean isArguments;
    private boolean isArrayDereference;

    ASTPrimarySuffix(int id) {
        super(id);
    }

    @Override
    protected  R acceptPlsqlVisitor(PlsqlVisitor visitor, P data) {
        return visitor.visit(this, data);
    }


    void setIsArrayDereference() {
        isArrayDereference = true;
    }

    public boolean isArrayDereference() {
        return isArrayDereference;
    }

    void setIsArguments() {
        this.isArguments = true;
    }

    public boolean isArguments() {
        return this.isArguments;
    }

    /**
     * Get the number of arguments for this primary suffix. One should call
     * {@link #isArguments()} to see if there are arguments. If this method is
     * called when there are no arguments it returns -1.
     *
     * @return A non-negative argument number when there are arguments,
     *         -1 otherwise.
     */
    public int getArgumentCount() {
        if (!this.isArguments()) {
            return -1;
        }
        return ((ASTArguments) getChild(getNumChildren() - 1)).getArgumentCount();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy