Ancestry check

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Ancestry check

amir650
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Ancestry check

amir650
Here's what I have so far

import antlr.collections.AST;

import com.puppycrawl.tools.checkstyle.api.Check;
import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;

public final class MyEqualsCheck
        extends Check {

    @Override
    public int[] getDefaultTokens() {
        return new int[] { TokenTypes.EQUAL, TokenTypes.NOT_EQUAL };
    }

    /**
     * Right before we visit the AST, we're allowed to do initialization and setup
     * here.
     */
    @Override
    public void beginTree(final DetailAST aRootAST) {
    }

    /**
     * Each token that we defined above is visited here.
     */
    @Override
    public void visitToken(final DetailAST ast) {

        final AST lValue = ast.getFirstChild();
        final AST rValue = lValue.getNextSibling();

    }

}