FileDocCategorySizeDatePackage
ASTPair.javaAPI DocGlassfish v2 API1251Wed Aug 30 15:34:04 BST 2006persistence.antlr

ASTPair

public class ASTPair extends Object
ASTPair: utility class used for manipulating a pair of ASTs representing the current AST root and current AST sibling. This exists to compensate for the lack of pointers or 'var' arguments in Java.

Fields Summary
public AST
root
public AST
child
Constructors Summary
Methods Summary
public final voidadvanceChildToEnd()
Make sure that child is the last sibling

        if (child != null) {
            while (child.getNextSibling() != null) {
                child = child.getNextSibling();
            }
        }
    
public persistence.antlr.ASTPaircopy()
Copy an ASTPair. Don't call it clone() because we want type-safety

        ASTPair tmp = new ASTPair();
        tmp.root = root;
        tmp.child = child;
        return tmp;
    
public java.lang.StringtoString()

        String r = root == null ? "null" : root.getText();
        String c = child == null ? "null" : child.getText();
        return "[" + r + "," + c + "]";