/* This file was generated by SableCC (http://www.sablecc.org/). */

package uk.co.zonetora.fj.ast.analysis;

import java.util.*;
import uk.co.zonetora.fj.ast.node.*;

public class DepthFirstAdapter extends AnalysisAdapter
{
    public void inStart(Start node)
    {
        defaultIn(node);
    }

    public void outStart(Start node)
    {
        defaultOut(node);
    }

    public void defaultIn(Node node)
    {
    }

    public void defaultOut(Node node)
    {
    }

    public void caseStart(Start node)
    {
        inStart(node);
        node.getPProg().apply(this);
        node.getEOF().apply(this);
        outStart(node);
    }

    public void inAProg(AProg node)
    {
        defaultIn(node);
    }

    public void outAProg(AProg node)
    {
        defaultOut(node);
    }

    public void caseAProg(AProg node)
    {
        inAProg(node);
        {
            Object temp[] = node.getClassDecl().toArray();
            for(int i = 0; i < temp.length; i++)
            {
                ((PClassDecl) temp[i]).apply(this);
            }
        }
        outAProg(node);
    }

    public void inAClassDecl(AClassDecl node)
    {
        defaultIn(node);
    }

    public void outAClassDecl(AClassDecl node)
    {
        defaultOut(node);
    }

    public void caseAClassDecl(AClassDecl node)
    {
        inAClassDecl(node);
        if(node.getTclass() != null)
        {
            node.getTclass().apply(this);
        }
        if(node.getClassname() != null)
        {
            node.getClassname().apply(this);
        }
        if(node.getExtends() != null)
        {
            node.getExtends().apply(this);
        }
        if(node.getExtendsname() != null)
        {
            node.getExtendsname().apply(this);
        }
        if(node.getLBrace() != null)
        {
            node.getLBrace().apply(this);
        }
        {
            Object temp[] = node.getFieldDecl().toArray();
            for(int i = 0; i < temp.length; i++)
            {
                ((PFieldDecl) temp[i]).apply(this);
            }
        }
        if(node.getConstructorDecl() != null)
        {
            node.getConstructorDecl().apply(this);
        }
        {
            Object temp[] = node.getMethodDecl().toArray();
            for(int i = 0; i < temp.length; i++)
            {
                ((PMethodDecl) temp[i]).apply(this);
            }
        }
        if(node.getRBrace() != null)
        {
            node.getRBrace().apply(this);
        }
        outAClassDecl(node);
    }

    public void inAFieldDecl(AFieldDecl node)
    {
        defaultIn(node);
    }

    public void outAFieldDecl(AFieldDecl node)
    {
        defaultOut(node);
    }

    public void caseAFieldDecl(AFieldDecl node)
    {
        inAFieldDecl(node);
        if(node.getClassname() != null)
        {
            node.getClassname().apply(this);
        }
        if(node.getFieldname() != null)
        {
            node.getFieldname().apply(this);
        }
        if(node.getSemicolon() != null)
        {
            node.getSemicolon().apply(this);
        }
        outAFieldDecl(node);
    }

    public void inAConstructorDecl(AConstructorDecl node)
    {
        defaultIn(node);
    }

    public void outAConstructorDecl(AConstructorDecl node)
    {
        defaultOut(node);
    }

    public void caseAConstructorDecl(AConstructorDecl node)
    {
        inAConstructorDecl(node);
        if(node.getIdentifier() != null)
        {
            node.getIdentifier().apply(this);
        }
        if(node.getL1() != null)
        {
            node.getL1().apply(this);
        }
        if(node.getParamDeclList() != null)
        {
            node.getParamDeclList().apply(this);
        }
        if(node.getR1() != null)
        {
            node.getR1().apply(this);
        }
        if(node.getLBrace() != null)
        {
            node.getLBrace().apply(this);
        }
        if(node.getSuper() != null)
        {
            node.getSuper().apply(this);
        }
        if(node.getL2() != null)
        {
            node.getL2().apply(this);
        }
        if(node.getFieldList() != null)
        {
            node.getFieldList().apply(this);
        }
        if(node.getR2() != null)
        {
            node.getR2().apply(this);
        }
        if(node.getSemicolon() != null)
        {
            node.getSemicolon().apply(this);
        }
        {
            Object temp[] = node.getThisFieldAssig().toArray();
            for(int i = 0; i < temp.length; i++)
            {
                ((PThisFieldAssig) temp[i]).apply(this);
            }
        }
        if(node.getRBrace() != null)
        {
            node.getRBrace().apply(this);
        }
        outAConstructorDecl(node);
    }

    public void inAMethodDecl(AMethodDecl node)
    {
        defaultIn(node);
    }

    public void outAMethodDecl(AMethodDecl node)
    {
        defaultOut(node);
    }

    public void caseAMethodDecl(AMethodDecl node)
    {
        inAMethodDecl(node);
        if(node.getClassname() != null)
        {
            node.getClassname().apply(this);
        }
        if(node.getMethodname() != null)
        {
            node.getMethodname().apply(this);
        }
        if(node.getLPar() != null)
        {
            node.getLPar().apply(this);
        }
        if(node.getParamDeclList() != null)
        {
            node.getParamDeclList().apply(this);
        }
        if(node.getRPar() != null)
        {
            node.getRPar().apply(this);
        }
        if(node.getLBrace() != null)
        {
            node.getLBrace().apply(this);
        }
        if(node.getReturn() != null)
        {
            node.getReturn().apply(this);
        }
        if(node.getTerm() != null)
        {
            node.getTerm().apply(this);
        }
        if(node.getSemicolon() != null)
        {
            node.getSemicolon().apply(this);
        }
        if(node.getRBrace() != null)
        {
            node.getRBrace().apply(this);
        }
        outAMethodDecl(node);
    }

    public void inAParamArgsParamDeclList(AParamArgsParamDeclList node)
    {
        defaultIn(node);
    }

    public void outAParamArgsParamDeclList(AParamArgsParamDeclList node)
    {
        defaultOut(node);
    }

    public void caseAParamArgsParamDeclList(AParamArgsParamDeclList node)
    {
        inAParamArgsParamDeclList(node);
        if(node.getParamArg() != null)
        {
            node.getParamArg().apply(this);
        }
        {
            Object temp[] = node.getCommaParamArgList().toArray();
            for(int i = 0; i < temp.length; i++)
            {
                ((PCommaParamArgList) temp[i]).apply(this);
            }
        }
        outAParamArgsParamDeclList(node);
    }

    public void inAEmptyParamDeclList(AEmptyParamDeclList node)
    {
        defaultIn(node);
    }

    public void outAEmptyParamDeclList(AEmptyParamDeclList node)
    {
        defaultOut(node);
    }

    public void caseAEmptyParamDeclList(AEmptyParamDeclList node)
    {
        inAEmptyParamDeclList(node);
        outAEmptyParamDeclList(node);
    }

    public void inAIdentParamArg(AIdentParamArg node)
    {
        defaultIn(node);
    }

    public void outAIdentParamArg(AIdentParamArg node)
    {
        defaultOut(node);
    }

    public void caseAIdentParamArg(AIdentParamArg node)
    {
        inAIdentParamArg(node);
        if(node.getClassname() != null)
        {
            node.getClassname().apply(this);
        }
        if(node.getParam() != null)
        {
            node.getParam().apply(this);
        }
        outAIdentParamArg(node);
    }

    public void inAThisParamArg(AThisParamArg node)
    {
        defaultIn(node);
    }

    public void outAThisParamArg(AThisParamArg node)
    {
        defaultOut(node);
    }

    public void caseAThisParamArg(AThisParamArg node)
    {
        inAThisParamArg(node);
        if(node.getThis() != null)
        {
            node.getThis().apply(this);
        }
        if(node.getIdentifier() != null)
        {
            node.getIdentifier().apply(this);
        }
        outAThisParamArg(node);
    }

    public void inACommaParamArgList(ACommaParamArgList node)
    {
        defaultIn(node);
    }

    public void outACommaParamArgList(ACommaParamArgList node)
    {
        defaultOut(node);
    }

    public void caseACommaParamArgList(ACommaParamArgList node)
    {
        inACommaParamArgList(node);
        if(node.getComma() != null)
        {
            node.getComma().apply(this);
        }
        if(node.getParamArg() != null)
        {
            node.getParamArg().apply(this);
        }
        outACommaParamArgList(node);
    }

    public void inAFieldListFieldList(AFieldListFieldList node)
    {
        defaultIn(node);
    }

    public void outAFieldListFieldList(AFieldListFieldList node)
    {
        defaultOut(node);
    }

    public void caseAFieldListFieldList(AFieldListFieldList node)
    {
        inAFieldListFieldList(node);
        if(node.getFieldName() != null)
        {
            node.getFieldName().apply(this);
        }
        {
            Object temp[] = node.getCommaField().toArray();
            for(int i = 0; i < temp.length; i++)
            {
                ((PCommaField) temp[i]).apply(this);
            }
        }
        outAFieldListFieldList(node);
    }

    public void inAEmptyFieldList(AEmptyFieldList node)
    {
        defaultIn(node);
    }

    public void outAEmptyFieldList(AEmptyFieldList node)
    {
        defaultOut(node);
    }

    public void caseAEmptyFieldList(AEmptyFieldList node)
    {
        inAEmptyFieldList(node);
        outAEmptyFieldList(node);
    }

    public void inAFieldName(AFieldName node)
    {
        defaultIn(node);
    }

    public void outAFieldName(AFieldName node)
    {
        defaultOut(node);
    }

    public void caseAFieldName(AFieldName node)
    {
        inAFieldName(node);
        if(node.getIdentifier() != null)
        {
            node.getIdentifier().apply(this);
        }
        outAFieldName(node);
    }

    public void inACommaField(ACommaField node)
    {
        defaultIn(node);
    }

    public void outACommaField(ACommaField node)
    {
        defaultOut(node);
    }

    public void caseACommaField(ACommaField node)
    {
        inACommaField(node);
        if(node.getComma() != null)
        {
            node.getComma().apply(this);
        }
        if(node.getFieldName() != null)
        {
            node.getFieldName().apply(this);
        }
        outACommaField(node);
    }

    public void inAThisFieldAssig(AThisFieldAssig node)
    {
        defaultIn(node);
    }

    public void outAThisFieldAssig(AThisFieldAssig node)
    {
        defaultOut(node);
    }

    public void caseAThisFieldAssig(AThisFieldAssig node)
    {
        inAThisFieldAssig(node);
        if(node.getThis() != null)
        {
            node.getThis().apply(this);
        }
        if(node.getPeriod() != null)
        {
            node.getPeriod().apply(this);
        }
        if(node.getLeftField() != null)
        {
            node.getLeftField().apply(this);
        }
        if(node.getEq() != null)
        {
            node.getEq().apply(this);
        }
        if(node.getRightField() != null)
        {
            node.getRightField().apply(this);
        }
        if(node.getSemicolon() != null)
        {
            node.getSemicolon().apply(this);
        }
        outAThisFieldAssig(node);
    }

    public void inANonLeftRecTermTerm(ANonLeftRecTermTerm node)
    {
        defaultIn(node);
    }

    public void outANonLeftRecTermTerm(ANonLeftRecTermTerm node)
    {
        defaultOut(node);
    }

    public void caseANonLeftRecTermTerm(ANonLeftRecTermTerm node)
    {
        inANonLeftRecTermTerm(node);
        if(node.getNonLeftRecTerm() != null)
        {
            node.getNonLeftRecTerm().apply(this);
        }
        outANonLeftRecTermTerm(node);
    }

    public void inAFieldAccessTerm(AFieldAccessTerm node)
    {
        defaultIn(node);
    }

    public void outAFieldAccessTerm(AFieldAccessTerm node)
    {
        defaultOut(node);
    }

    public void caseAFieldAccessTerm(AFieldAccessTerm node)
    {
        inAFieldAccessTerm(node);
        if(node.getNonLeftRecTerm() != null)
        {
            node.getNonLeftRecTerm().apply(this);
        }
        if(node.getPeriod() != null)
        {
            node.getPeriod().apply(this);
        }
        if(node.getIdentifier() != null)
        {
            node.getIdentifier().apply(this);
        }
        outAFieldAccessTerm(node);
    }

    public void inAMethodCallTerm(AMethodCallTerm node)
    {
        defaultIn(node);
    }

    public void outAMethodCallTerm(AMethodCallTerm node)
    {
        defaultOut(node);
    }

    public void caseAMethodCallTerm(AMethodCallTerm node)
    {
        inAMethodCallTerm(node);
        if(node.getNonLeftRecTerm() != null)
        {
            node.getNonLeftRecTerm().apply(this);
        }
        if(node.getPeriod() != null)
        {
            node.getPeriod().apply(this);
        }
        if(node.getIdentifier() != null)
        {
            node.getIdentifier().apply(this);
        }
        if(node.getLPar() != null)
        {
            node.getLPar().apply(this);
        }
        if(node.getTermList() != null)
        {
            node.getTermList().apply(this);
        }
        if(node.getRPar() != null)
        {
            node.getRPar().apply(this);
        }
        outAMethodCallTerm(node);
    }

    public void inACastTerm(ACastTerm node)
    {
        defaultIn(node);
    }

    public void outACastTerm(ACastTerm node)
    {
        defaultOut(node);
    }

    public void caseACastTerm(ACastTerm node)
    {
        inACastTerm(node);
        if(node.getLSq() != null)
        {
            node.getLSq().apply(this);
        }
        if(node.getIdentifier() != null)
        {
            node.getIdentifier().apply(this);
        }
        if(node.getRSq() != null)
        {
            node.getRSq().apply(this);
        }
        if(node.getNonLeftRecTerm() != null)
        {
            node.getNonLeftRecTerm().apply(this);
        }
        outACastTerm(node);
    }

    public void inAVariableNonLeftRecTerm(AVariableNonLeftRecTerm node)
    {
        defaultIn(node);
    }

    public void outAVariableNonLeftRecTerm(AVariableNonLeftRecTerm node)
    {
        defaultOut(node);
    }

    public void caseAVariableNonLeftRecTerm(AVariableNonLeftRecTerm node)
    {
        inAVariableNonLeftRecTerm(node);
        if(node.getIdentifier() != null)
        {
            node.getIdentifier().apply(this);
        }
        outAVariableNonLeftRecTerm(node);
    }

    public void inAThisNonLeftRecTerm(AThisNonLeftRecTerm node)
    {
        defaultIn(node);
    }

    public void outAThisNonLeftRecTerm(AThisNonLeftRecTerm node)
    {
        defaultOut(node);
    }

    public void caseAThisNonLeftRecTerm(AThisNonLeftRecTerm node)
    {
        inAThisNonLeftRecTerm(node);
        if(node.getThis() != null)
        {
            node.getThis().apply(this);
        }
        outAThisNonLeftRecTerm(node);
    }

    public void inAObjectCreationNonLeftRecTerm(AObjectCreationNonLeftRecTerm node)
    {
        defaultIn(node);
    }

    public void outAObjectCreationNonLeftRecTerm(AObjectCreationNonLeftRecTerm node)
    {
        defaultOut(node);
    }

    public void caseAObjectCreationNonLeftRecTerm(AObjectCreationNonLeftRecTerm node)
    {
        inAObjectCreationNonLeftRecTerm(node);
        if(node.getNew() != null)
        {
            node.getNew().apply(this);
        }
        if(node.getIdentifier() != null)
        {
            node.getIdentifier().apply(this);
        }
        if(node.getLPar() != null)
        {
            node.getLPar().apply(this);
        }
        if(node.getTermList() != null)
        {
            node.getTermList().apply(this);
        }
        if(node.getRPar() != null)
        {
            node.getRPar().apply(this);
        }
        outAObjectCreationNonLeftRecTerm(node);
    }

    public void inABracketNonLeftRecTerm(ABracketNonLeftRecTerm node)
    {
        defaultIn(node);
    }

    public void outABracketNonLeftRecTerm(ABracketNonLeftRecTerm node)
    {
        defaultOut(node);
    }

    public void caseABracketNonLeftRecTerm(ABracketNonLeftRecTerm node)
    {
        inABracketNonLeftRecTerm(node);
        if(node.getLPar() != null)
        {
            node.getLPar().apply(this);
        }
        if(node.getTerm() != null)
        {
            node.getTerm().apply(this);
        }
        if(node.getRPar() != null)
        {
            node.getRPar().apply(this);
        }
        outABracketNonLeftRecTerm(node);
    }

    public void inATermListTermList(ATermListTermList node)
    {
        defaultIn(node);
    }

    public void outATermListTermList(ATermListTermList node)
    {
        defaultOut(node);
    }

    public void caseATermListTermList(ATermListTermList node)
    {
        inATermListTermList(node);
        if(node.getTerm() != null)
        {
            node.getTerm().apply(this);
        }
        {
            Object temp[] = node.getCommaTerm().toArray();
            for(int i = 0; i < temp.length; i++)
            {
                ((PCommaTerm) temp[i]).apply(this);
            }
        }
        outATermListTermList(node);
    }

    public void inAEmptyTermList(AEmptyTermList node)
    {
        defaultIn(node);
    }

    public void outAEmptyTermList(AEmptyTermList node)
    {
        defaultOut(node);
    }

    public void caseAEmptyTermList(AEmptyTermList node)
    {
        inAEmptyTermList(node);
        outAEmptyTermList(node);
    }

    public void inACommaTerm(ACommaTerm node)
    {
        defaultIn(node);
    }

    public void outACommaTerm(ACommaTerm node)
    {
        defaultOut(node);
    }

    public void caseACommaTerm(ACommaTerm node)
    {
        inACommaTerm(node);
        if(node.getComma() != null)
        {
            node.getComma().apply(this);
        }
        if(node.getTerm() != null)
        {
            node.getTerm().apply(this);
        }
        outACommaTerm(node);
    }
}
