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

net.sourceforge.pmd.lang.java.ast.ASTBlock 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.java.ast;

import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken;
import net.sourceforge.pmd.lang.java.ast.ASTList.ASTMaybeEmptyListOf;

/**
 * A block of code. This is a {@linkplain ASTStatement statement} that
 * contains other statements.
 *
 * 
 *
 * Block ::=  "{" {@link ASTStatement Statement}* "}"
 *
 * 
*/ public final class ASTBlock extends ASTMaybeEmptyListOf implements ASTSwitchArrowRHS, ASTStatement { ASTBlock(int id) { super(id, ASTStatement.class); } @Override public R acceptVisitor(JavaVisitor visitor, P data) { return visitor.visit(this, data); } public boolean containsComment() { JavaccToken t = getLastToken().getPreviousComment(); while (t != null) { if (JavaComment.isComment(t)) { return true; } t = t.getPreviousComment(); } return false; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy