Logo Search packages:      
Sourcecode: antlr version File versions

boolean antlr::BaseAST::equalsTree ( AST  t  )  [inline, inherited]

Is tree rooted at 'this' equal to 't'? The siblings of 'this' are ignored.

Implements antlr::collections::AST.

Definition at line 178 of file BaseAST.java.

References antlr::BaseAST::equals(), antlr::BaseAST::equalsList(), antlr::collections::AST::getFirstChild(), and antlr::BaseAST::getFirstChild().

        // check roots first.
        if (!this.equals(t)) return false;
        // if roots match, do full list match test on children.
        if (this.getFirstChild() != null) {
            if (!this.getFirstChild().equalsList(t.getFirstChild())) return false;
        // sibling has no kids, make sure t doesn't either
        else if (t.getFirstChild() != null) {
            return false;
        return true;

Generated by  Doxygen 1.6.0   Back to index