class Declarator extends ASTList implements TokenId {
    /** default serialVersionUID */
    private static final long serialVersionUID = 1L;
    protected int varType;
    protected int arrayDim;
    protected int localVar;
    protected String qualifiedClass;    // JVM-internal representation

    public Declarator(int type, int dim) {
        super(null);
        varType = type;
        arrayDim = dim;
        localVar = -1;
        qualifiedClass = null;
    }

    public Declarator(ASTList className, int dim) {
        super(null);
        varType = CLASS;
        arrayDim = dim;
        localVar = -1;
        qualifiedClass = astToClassName(className, '/');
    }

    /* For declaring a pre-defined? local variable.
     */
    public Declarator(int type, String jvmClassName, int dim,
                      int var, Symbol sym) {
        super(null);
        varType = type;
        arrayDim = dim;
        localVar = var;
        qualifiedClass = jvmClassName;
        setLeft(sym);
        append(this, null);     // initializer
    }

    public Declarator make(Symbol sym, int dim, ASTree init) {
        Declarator d = new Declarator(this.varType, this.arrayDim + dim);
        d.qualifiedClass = this.qualifiedClass;
        d.setLeft(sym);
        append(d, init);
        return d;
    }

    /* Returns CLASS, BOOLEAN, BYTE, CHAR, SHORT, INT, LONG, FLOAT,
     * or DOUBLE (or VOID)
     */
    public int getType() { return varType; }

    public int getArrayDim() { return arrayDim; }

    public void addArrayDim(int d) { arrayDim += d; }

    public String getClassName() { return qualifiedClass; }

    public void setClassName(String s) { qualifiedClass = s; }

    public Symbol getVariable() { return (Symbol)getLeft(); }

    public void setVariable(Symbol sym) { setLeft(sym); }

    public ASTree getInitializer() {
        ASTList t = tail();
        if (t != null)
            return t.head();
        return null;
    }

    public void setLocalVar(int n) { localVar = n; }

    public int getLocalVar() { return localVar; }

    @Override
    public String getTag() { return "decl"; }

    @Override
    public void accept(Visitor v) throws CompileError {
        v.atDeclarator(this);
    }

    public static String astToClassName(ASTList name, char sep) {
        if (name == null)
            return null;

        StringBuffer sbuf = new StringBuffer();
        astToClassName(sbuf, name, sep);
        return sbuf.toString();
    }

    private static void astToClassName(StringBuffer sbuf, ASTList name,
                                       char sep) {<FILL_FUNCTION_BODY>}
}

        for (;;) {
            ASTree h = name.head();
            if (h instanceof Symbol)
                sbuf.append(((Symbol)h).get());
            else if (h instanceof ASTList)
                astToClassName(sbuf, (ASTList)h, sep);

            name = name.tail();
            if (name == null)
                break;

            sbuf.append(sep);
        }
    
<methods>public void <init>(org.hotswap.agent.javassist.compiler.ast.ASTree, org.hotswap.agent.javassist.compiler.ast.ASTList) ,public void <init>(org.hotswap.agent.javassist.compiler.ast.ASTree) ,public void accept(org.hotswap.agent.javassist.compiler.ast.Visitor) throws org.hotswap.agent.javassist.compiler.CompileError,public static org.hotswap.agent.javassist.compiler.ast.ASTList append(org.hotswap.agent.javassist.compiler.ast.ASTList, org.hotswap.agent.javassist.compiler.ast.ASTree) ,public static org.hotswap.agent.javassist.compiler.ast.ASTList concat(org.hotswap.agent.javassist.compiler.ast.ASTList, org.hotswap.agent.javassist.compiler.ast.ASTList) ,public org.hotswap.agent.javassist.compiler.ast.ASTree getLeft() ,public org.hotswap.agent.javassist.compiler.ast.ASTree getRight() ,public org.hotswap.agent.javassist.compiler.ast.ASTree head() ,public int length() ,public static int length(org.hotswap.agent.javassist.compiler.ast.ASTList) ,public static org.hotswap.agent.javassist.compiler.ast.ASTList make(org.hotswap.agent.javassist.compiler.ast.ASTree, org.hotswap.agent.javassist.compiler.ast.ASTree, org.hotswap.agent.javassist.compiler.ast.ASTree) ,public void setHead(org.hotswap.agent.javassist.compiler.ast.ASTree) ,public void setLeft(org.hotswap.agent.javassist.compiler.ast.ASTree) ,public void setRight(org.hotswap.agent.javassist.compiler.ast.ASTree) ,public void setTail(org.hotswap.agent.javassist.compiler.ast.ASTList) ,public org.hotswap.agent.javassist.compiler.ast.ASTList sublist(int) ,public boolean subst(org.hotswap.agent.javassist.compiler.ast.ASTree, org.hotswap.agent.javassist.compiler.ast.ASTree) ,public org.hotswap.agent.javassist.compiler.ast.ASTList tail() ,public java.lang.String toString() <variables>private org.hotswap.agent.javassist.compiler.ast.ASTree left,private org.hotswap.agent.javassist.compiler.ast.ASTList right,private static final long serialVersionUID