// THIS FILE IS GENERATED
// WARNING! All changes made in this file will be lost!

#ifndef PHP_DEBUG_VISITOR_H_INCLUDED
#define PHP_DEBUG_VISITOR_H_INCLUDED

#include "phpdefaultvisitor.h"

#include "parserexport.h"
#include <kdev-pg-token-stream.h>
#include <QtCore/QTextStream>
#include <QtCore/QDebug>

namespace Php
{

class KDEVPHPPARSER_EXPORT DebugVisitor: public DefaultVisitor
{
public:
    DebugVisitor(TokenStream *str, const QString& content = QString())
            : m_str(str), m_indent(0), m_content(content) {}
    virtual void visitAdditiveExpression(AdditiveExpressionAst *node)
    {
        printToken(node, "additiveExpression");
        if (node->expression) printToken(node->expression, "multiplicativeExpression", "expression");
        if (node->additionalExpressionSequence)
        {
            const KDevPG::ListNode<AdditiveExpressionRestAst*> *__it = node->additionalExpressionSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "additiveExpressionRest", "additionalExpression[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitAdditiveExpression(node);
        m_indent--;
    }

    virtual void visitAdditiveExpressionRest(AdditiveExpressionRestAst *node)
    {
        printToken(node, "additiveExpressionRest");
        if (node->expression) printToken(node->expression, "multiplicativeExpression", "expression");
        ++m_indent;
        DefaultVisitor::visitAdditiveExpressionRest(node);
        m_indent--;
    }

    virtual void visitArrayIndexSpecifier(ArrayIndexSpecifierAst *node)
    {
        printToken(node, "arrayIndexSpecifier");
        if (node->expr) printToken(node->expr, "expr", "expr");
        ++m_indent;
        DefaultVisitor::visitArrayIndexSpecifier(node);
        m_indent--;
    }

    virtual void visitArrayPairValue(ArrayPairValueAst *node)
    {
        printToken(node, "arrayPairValue");
        if (node->expr) printToken(node->expr, "expr", "expr");
        if (node->exprValue) printToken(node->exprValue, "expr", "exprValue");
        if (node->varValue) printToken(node->varValue, "variable", "varValue");
        if (node->variable) printToken(node->variable, "variable", "variable");
        ++m_indent;
        DefaultVisitor::visitArrayPairValue(node);
        m_indent--;
    }

    virtual void visitAssignmentExpression(AssignmentExpressionAst *node)
    {
        printToken(node, "assignmentExpression");
        if (node->expression) printToken(node->expression, "conditionalExpression", "expression");
        if (node->assignmentExpressionEqual) printToken(node->assignmentExpressionEqual, "assignmentExpressionEqual", "assignmentExpressionEqual");
        if (node->assignmentExpression) printToken(node->assignmentExpression, "assignmentExpression", "assignmentExpression");
        ++m_indent;
        DefaultVisitor::visitAssignmentExpression(node);
        m_indent--;
    }

    virtual void visitAssignmentExpressionCheckIfVariable(AssignmentExpressionCheckIfVariableAst *node)
    {
        printToken(node, "assignmentExpressionCheckIfVariable");
        ++m_indent;
        DefaultVisitor::visitAssignmentExpressionCheckIfVariable(node);
        m_indent--;
    }

    virtual void visitAssignmentExpressionEqual(AssignmentExpressionEqualAst *node)
    {
        printToken(node, "assignmentExpressionEqual");
        if (node->assignmentExpression) printToken(node->assignmentExpression, "assignmentExpression", "assignmentExpression");
        ++m_indent;
        DefaultVisitor::visitAssignmentExpressionEqual(node);
        m_indent--;
    }

    virtual void visitAssignmentList(AssignmentListAst *node)
    {
        printToken(node, "assignmentList");
        if (node->elementSequence)
        {
            const KDevPG::ListNode<AssignmentListElementAst*> *__it = node->elementSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "assignmentListElement", "element[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitAssignmentList(node);
        m_indent--;
    }

    virtual void visitAssignmentListElement(AssignmentListElementAst *node)
    {
        printToken(node, "assignmentListElement");
        if (node->variable) printToken(node->variable, "variable", "variable");
        if (node->assignmentList) printToken(node->assignmentList, "assignmentList", "assignmentList");
        ++m_indent;
        DefaultVisitor::visitAssignmentListElement(node);
        m_indent--;
    }

    virtual void visitBaseVariable(BaseVariableAst *node)
    {
        printToken(node, "baseVariable");
        if (node->var) printToken(node->var, "compoundVariableWithSimpleIndirectReference", "var");
        if (node->offsetItemsSequence)
        {
            const KDevPG::ListNode<DimListItemAst*> *__it = node->offsetItemsSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "dimListItem", "offsetItems[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        if (node->staticMember) printToken(node->staticMember, "staticMember", "staticMember");
        ++m_indent;
        DefaultVisitor::visitBaseVariable(node);
        m_indent--;
    }

    virtual void visitBaseVariableWithFunctionCalls(BaseVariableWithFunctionCallsAst *node)
    {
        printToken(node, "baseVariableWithFunctionCalls");
        if (node->functionCall) printToken(node->functionCall, "functionCall", "functionCall");
        if (node->arrayIndex) printToken(node->arrayIndex, "arrayIndexSpecifier", "arrayIndex");
        if (node->baseVariable) printToken(node->baseVariable, "baseVariable", "baseVariable");
        ++m_indent;
        DefaultVisitor::visitBaseVariableWithFunctionCalls(node);
        m_indent--;
    }

    virtual void visitBitAndExpression(BitAndExpressionAst *node)
    {
        printToken(node, "bitAndExpression");
        if (node->expressionSequence)
        {
            const KDevPG::ListNode<EqualityExpressionAst*> *__it = node->expressionSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "equalityExpression", "expression[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitBitAndExpression(node);
        m_indent--;
    }

    virtual void visitBitOrExpression(BitOrExpressionAst *node)
    {
        printToken(node, "bitOrExpression");
        if (node->expressionSequence)
        {
            const KDevPG::ListNode<BitXorExpressionAst*> *__it = node->expressionSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "bitXorExpression", "expression[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitBitOrExpression(node);
        m_indent--;
    }

    virtual void visitBitXorExpression(BitXorExpressionAst *node)
    {
        printToken(node, "bitXorExpression");
        if (node->expressionSequence)
        {
            const KDevPG::ListNode<BitAndExpressionAst*> *__it = node->expressionSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "bitAndExpression", "expression[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitBitXorExpression(node);
        m_indent--;
    }

    virtual void visitBooleanAndExpression(BooleanAndExpressionAst *node)
    {
        printToken(node, "booleanAndExpression");
        if (node->expressionSequence)
        {
            const KDevPG::ListNode<BitOrExpressionAst*> *__it = node->expressionSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "bitOrExpression", "expression[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitBooleanAndExpression(node);
        m_indent--;
    }

    virtual void visitBooleanOrExpression(BooleanOrExpressionAst *node)
    {
        printToken(node, "booleanOrExpression");
        if (node->expressionSequence)
        {
            const KDevPG::ListNode<BooleanAndExpressionAst*> *__it = node->expressionSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "booleanAndExpression", "expression[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitBooleanOrExpression(node);
        m_indent--;
    }

    virtual void visitCaseList(CaseListAst *node)
    {
        printToken(node, "caseList");
        if (node->caseItemsSequence)
        {
            const KDevPG::ListNode<Case_itemAst*> *__it = node->caseItemsSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "case_item", "caseItems[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitCaseList(node);
        m_indent--;
    }

    virtual void visitCase_item(Case_itemAst *node)
    {
        printToken(node, "case_item");
        if (node->expr) printToken(node->expr, "expr", "expr");
        if (node->statements) printToken(node->statements, "innerStatementList", "statements");
        ++m_indent;
        DefaultVisitor::visitCase_item(node);
        m_indent--;
    }

    virtual void visitCatchItem(CatchItemAst *node)
    {
        printToken(node, "catchItem");
        if (node->catchClass) printToken(node->catchClass, "namespacedIdentifier", "catchClass");
        if (node->var) printToken(node->var, "variableIdentifier", "var");
        if (node->statements) printToken(node->statements, "innerStatementList", "statements");
        ++m_indent;
        DefaultVisitor::visitCatchItem(node);
        m_indent--;
    }

    virtual void visitClassBody(ClassBodyAst *node)
    {
        printToken(node, "classBody");
        if (node->classStatementsSequence)
        {
            const KDevPG::ListNode<ClassStatementAst*> *__it = node->classStatementsSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "classStatement", "classStatements[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitClassBody(node);
        m_indent--;
    }

    virtual void visitClassDeclarationStatement(ClassDeclarationStatementAst *node)
    {
        printToken(node, "classDeclarationStatement");
        if (node->modifier) printToken(node->modifier, "optionalClassModifier", "modifier");
        if (node->className) printToken(node->className, "identifier", "className");
        if (node->extends) printToken(node->extends, "classExtends", "extends");
        if (node->implements) printToken(node->implements, "classImplements", "implements");
        if (node->body) printToken(node->body, "classBody", "body");
        ++m_indent;
        DefaultVisitor::visitClassDeclarationStatement(node);
        m_indent--;
    }

    virtual void visitClassExtends(ClassExtendsAst *node)
    {
        printToken(node, "classExtends");
        if (node->identifier) printToken(node->identifier, "namespacedIdentifier", "identifier");
        ++m_indent;
        DefaultVisitor::visitClassExtends(node);
        m_indent--;
    }

    virtual void visitClassImplements(ClassImplementsAst *node)
    {
        printToken(node, "classImplements");
        if (node->implementsSequence)
        {
            const KDevPG::ListNode<NamespacedIdentifierAst*> *__it = node->implementsSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "namespacedIdentifier", "implements[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitClassImplements(node);
        m_indent--;
    }

    virtual void visitClassNameReference(ClassNameReferenceAst *node)
    {
        printToken(node, "classNameReference");
        if (node->identifier) printToken(node->identifier, "namespacedIdentifier", "identifier");
        if (node->dynamicClassNameReference) printToken(node->dynamicClassNameReference, "dynamicClassNameReference", "dynamicClassNameReference");
        ++m_indent;
        DefaultVisitor::visitClassNameReference(node);
        m_indent--;
    }

    virtual void visitClassStatement(ClassStatementAst *node)
    {
        printToken(node, "classStatement");
        if (node->constsSequence)
        {
            const KDevPG::ListNode<ConstantDeclarationAst*> *__it = node->constsSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "constantDeclaration", "consts[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        if (node->variable) printToken(node->variable, "classVariableDeclaration", "variable");
        if (node->modifiers) printToken(node->modifiers, "optionalModifiers", "modifiers");
        if (node->methodName) printToken(node->methodName, "identifier", "methodName");
        if (node->parameters) printToken(node->parameters, "parameterList", "parameters");
        if (node->methodBody) printToken(node->methodBody, "methodBody", "methodBody");
        if (node->traitsSequence)
        {
            const KDevPG::ListNode<NamespacedIdentifierAst*> *__it = node->traitsSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "namespacedIdentifier", "traits[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        if (node->imports) printToken(node->imports, "traitAliasDeclaration", "imports");
        ++m_indent;
        DefaultVisitor::visitClassStatement(node);
        m_indent--;
    }

    virtual void visitClassVariable(ClassVariableAst *node)
    {
        printToken(node, "classVariable");
        if (node->variable) printToken(node->variable, "variableIdentifier", "variable");
        if (node->value) printToken(node->value, "staticScalar", "value");
        ++m_indent;
        DefaultVisitor::visitClassVariable(node);
        m_indent--;
    }

    virtual void visitClassVariableDeclaration(ClassVariableDeclarationAst *node)
    {
        printToken(node, "classVariableDeclaration");
        if (node->varsSequence)
        {
            const KDevPG::ListNode<ClassVariableAst*> *__it = node->varsSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "classVariable", "vars[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitClassVariableDeclaration(node);
        m_indent--;
    }

    virtual void visitClosure(ClosureAst *node)
    {
        printToken(node, "closure");
        if (node->parameters) printToken(node->parameters, "parameterList", "parameters");
        if (node->lexicalVars) printToken(node->lexicalVars, "lexicalVarList", "lexicalVars");
        if (node->functionBody) printToken(node->functionBody, "innerStatementList", "functionBody");
        ++m_indent;
        DefaultVisitor::visitClosure(node);
        m_indent--;
    }

    virtual void visitCommonScalar(CommonScalarAst *node)
    {
        printToken(node, "commonScalar");
        if (node->stringIndex) printToken(node->stringIndex, "stringIndexSpecifier", "stringIndex");
        ++m_indent;
        DefaultVisitor::visitCommonScalar(node);
        m_indent--;
    }

    virtual void visitCompoundVariable(CompoundVariableAst *node)
    {
        printToken(node, "compoundVariable");
        if (node->variable) printToken(node->variable, "variableIdentifier", "variable");
        if (node->expr) printToken(node->expr, "expr", "expr");
        ++m_indent;
        DefaultVisitor::visitCompoundVariable(node);
        m_indent--;
    }

    virtual void visitCompoundVariableWithSimpleIndirectReference(CompoundVariableWithSimpleIndirectReferenceAst *node)
    {
        printToken(node, "compoundVariableWithSimpleIndirectReference");
        if (node->indirectVariable) printToken(node->indirectVariable, "variableIdentifier", "indirectVariable");
        if (node->expr) printToken(node->expr, "expr", "expr");
        if (node->variable) printToken(node->variable, "variableIdentifier", "variable");
        ++m_indent;
        DefaultVisitor::visitCompoundVariableWithSimpleIndirectReference(node);
        m_indent--;
    }

    virtual void visitConditionalExpression(ConditionalExpressionAst *node)
    {
        printToken(node, "conditionalExpression");
        if (node->expression) printToken(node->expression, "booleanOrExpression", "expression");
        if (node->ifExpression) printToken(node->ifExpression, "expr", "ifExpression");
        if (node->elseExpression) printToken(node->elseExpression, "conditionalExpression", "elseExpression");
        ++m_indent;
        DefaultVisitor::visitConditionalExpression(node);
        m_indent--;
    }

    virtual void visitConstantDeclaration(ConstantDeclarationAst *node)
    {
        printToken(node, "constantDeclaration");
        if (node->identifier) printToken(node->identifier, "identifier", "identifier");
        if (node->scalar) printToken(node->scalar, "staticScalar", "scalar");
        ++m_indent;
        DefaultVisitor::visitConstantDeclaration(node);
        m_indent--;
    }

    virtual void visitConstantOrClassConst(ConstantOrClassConstAst *node)
    {
        printToken(node, "constantOrClassConst");
        if (node->constant) printToken(node->constant, "namespacedIdentifier", "constant");
        if (node->classConstant) printToken(node->classConstant, "identifier", "classConstant");
        ++m_indent;
        DefaultVisitor::visitConstantOrClassConst(node);
        m_indent--;
    }

    virtual void visitCtorArguments(CtorArgumentsAst *node)
    {
        printToken(node, "ctorArguments");
        if (node->parameterList) printToken(node->parameterList, "functionCallParameterList", "parameterList");
        ++m_indent;
        DefaultVisitor::visitCtorArguments(node);
        m_indent--;
    }

    virtual void visitDeclareItem(DeclareItemAst *node)
    {
        printToken(node, "declareItem");
        if (node->scalar) printToken(node->scalar, "staticScalar", "scalar");
        ++m_indent;
        DefaultVisitor::visitDeclareItem(node);
        m_indent--;
    }

    virtual void visitDeclareStatement(DeclareStatementAst *node)
    {
        printToken(node, "declareStatement");
        if (node->statement) printToken(node->statement, "statement", "statement");
        if (node->statements) printToken(node->statements, "innerStatementList", "statements");
        ++m_indent;
        DefaultVisitor::visitDeclareStatement(node);
        m_indent--;
    }

    virtual void visitDimListItem(DimListItemAst *node)
    {
        printToken(node, "dimListItem");
        if (node->arrayIndex) printToken(node->arrayIndex, "arrayIndexSpecifier", "arrayIndex");
        if (node->expr) printToken(node->expr, "expr", "expr");
        ++m_indent;
        DefaultVisitor::visitDimListItem(node);
        m_indent--;
    }

    virtual void visitDynamicClassNameReference(DynamicClassNameReferenceAst *node)
    {
        printToken(node, "dynamicClassNameReference");
        if (node->baseVariable) printToken(node->baseVariable, "baseVariable", "baseVariable");
        if (node->objectProperty) printToken(node->objectProperty, "objectProperty", "objectProperty");
        if (node->properties) printToken(node->properties, "dynamicClassNameVariableProperties", "properties");
        ++m_indent;
        DefaultVisitor::visitDynamicClassNameReference(node);
        m_indent--;
    }

    virtual void visitDynamicClassNameVariableProperties(DynamicClassNameVariablePropertiesAst *node)
    {
        printToken(node, "dynamicClassNameVariableProperties");
        if (node->propertiesSequence)
        {
            const KDevPG::ListNode<DynamicClassNameVariablePropertyAst*> *__it = node->propertiesSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "dynamicClassNameVariableProperty", "properties[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitDynamicClassNameVariableProperties(node);
        m_indent--;
    }

    virtual void visitDynamicClassNameVariableProperty(DynamicClassNameVariablePropertyAst *node)
    {
        printToken(node, "dynamicClassNameVariableProperty");
        if (node->property) printToken(node->property, "objectProperty", "property");
        ++m_indent;
        DefaultVisitor::visitDynamicClassNameVariableProperty(node);
        m_indent--;
    }

    virtual void visitElseSingle(ElseSingleAst *node)
    {
        printToken(node, "elseSingle");
        if (node->statement) printToken(node->statement, "statement", "statement");
        ++m_indent;
        DefaultVisitor::visitElseSingle(node);
        m_indent--;
    }

    virtual void visitElseifList(ElseifListAst *node)
    {
        printToken(node, "elseifList");
        if (node->elseifListItemSequence)
        {
            const KDevPG::ListNode<ElseifListItemAst*> *__it = node->elseifListItemSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "elseifListItem", "elseifListItem[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitElseifList(node);
        m_indent--;
    }

    virtual void visitElseifListItem(ElseifListItemAst *node)
    {
        printToken(node, "elseifListItem");
        if (node->expr) printToken(node->expr, "expr", "expr");
        if (node->statement) printToken(node->statement, "statement", "statement");
        ++m_indent;
        DefaultVisitor::visitElseifListItem(node);
        m_indent--;
    }

    virtual void visitEncaps(EncapsAst *node)
    {
        printToken(node, "encaps");
        if (node->var) printToken(node->var, "encapsVar", "var");
        ++m_indent;
        DefaultVisitor::visitEncaps(node);
        m_indent--;
    }

    virtual void visitEncapsList(EncapsListAst *node)
    {
        printToken(node, "encapsList");
        if (node->encapsSequence)
        {
            const KDevPG::ListNode<EncapsAst*> *__it = node->encapsSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "encaps", "encaps[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitEncapsList(node);
        m_indent--;
    }

    virtual void visitEncapsVar(EncapsVarAst *node)
    {
        printToken(node, "encapsVar");
        if (node->arrayIndex) printToken(node->arrayIndex, "arrayIndexSpecifier", "arrayIndex");
        if (node->expr) printToken(node->expr, "expr", "expr");
        if (node->variable) printToken(node->variable, "variableIdentifier", "variable");
        if (node->propertyIdentifier) printToken(node->propertyIdentifier, "identifier", "propertyIdentifier");
        if (node->offset) printToken(node->offset, "encapsVarOffset", "offset");
        ++m_indent;
        DefaultVisitor::visitEncapsVar(node);
        m_indent--;
    }

    virtual void visitEncapsVarOffset(EncapsVarOffsetAst *node)
    {
        printToken(node, "encapsVarOffset");
        ++m_indent;
        DefaultVisitor::visitEncapsVarOffset(node);
        m_indent--;
    }

    virtual void visitEqualityExpression(EqualityExpressionAst *node)
    {
        printToken(node, "equalityExpression");
        if (node->expression) printToken(node->expression, "relationalExpression", "expression");
        if (node->additionalExpressionSequence)
        {
            const KDevPG::ListNode<EqualityExpressionRestAst*> *__it = node->additionalExpressionSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "equalityExpressionRest", "additionalExpression[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitEqualityExpression(node);
        m_indent--;
    }

    virtual void visitEqualityExpressionRest(EqualityExpressionRestAst *node)
    {
        printToken(node, "equalityExpressionRest");
        if (node->expression) printToken(node->expression, "relationalExpression", "expression");
        ++m_indent;
        DefaultVisitor::visitEqualityExpressionRest(node);
        m_indent--;
    }

    virtual void visitExpr(ExprAst *node)
    {
        printToken(node, "expr");
        if (node->expression) printToken(node->expression, "logicalOrExpression", "expression");
        ++m_indent;
        DefaultVisitor::visitExpr(node);
        m_indent--;
    }

    virtual void visitForExpr(ForExprAst *node)
    {
        printToken(node, "forExpr");
        if (node->exprsSequence)
        {
            const KDevPG::ListNode<ExprAst*> *__it = node->exprsSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "expr", "exprs[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitForExpr(node);
        m_indent--;
    }

    virtual void visitForStatement(ForStatementAst *node)
    {
        printToken(node, "forStatement");
        if (node->statement) printToken(node->statement, "statement", "statement");
        if (node->statements) printToken(node->statements, "innerStatementList", "statements");
        ++m_indent;
        DefaultVisitor::visitForStatement(node);
        m_indent--;
    }

    virtual void visitForeachStatement(ForeachStatementAst *node)
    {
        printToken(node, "foreachStatement");
        if (node->statement) printToken(node->statement, "statement", "statement");
        if (node->statements) printToken(node->statements, "innerStatementList", "statements");
        ++m_indent;
        DefaultVisitor::visitForeachStatement(node);
        m_indent--;
    }

    virtual void visitForeachVariable(ForeachVariableAst *node)
    {
        printToken(node, "foreachVariable");
        if (node->variable) printToken(node->variable, "variable", "variable");
        ++m_indent;
        DefaultVisitor::visitForeachVariable(node);
        m_indent--;
    }

    virtual void visitFunctionCall(FunctionCallAst *node)
    {
        printToken(node, "functionCall");
        if (node->stringFunctionNameOrClass) printToken(node->stringFunctionNameOrClass, "namespacedIdentifier", "stringFunctionNameOrClass");
        if (node->stringParameterList) printToken(node->stringParameterList, "functionCallParameterList", "stringParameterList");
        if (node->stringFunctionName) printToken(node->stringFunctionName, "identifier", "stringFunctionName");
        if (node->varFunctionName) printToken(node->varFunctionName, "variableWithoutObjects", "varFunctionName");
        if (node->varParameterList) printToken(node->varParameterList, "functionCallParameterList", "varParameterList");
        ++m_indent;
        DefaultVisitor::visitFunctionCall(node);
        m_indent--;
    }

    virtual void visitFunctionCallParameterList(FunctionCallParameterListAst *node)
    {
        printToken(node, "functionCallParameterList");
        if (node->parametersSequence)
        {
            const KDevPG::ListNode<FunctionCallParameterListElementAst*> *__it = node->parametersSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "functionCallParameterListElement", "parameters[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitFunctionCallParameterList(node);
        m_indent--;
    }

    virtual void visitFunctionCallParameterListElement(FunctionCallParameterListElementAst *node)
    {
        printToken(node, "functionCallParameterListElement");
        if (node->variable) printToken(node->variable, "variable", "variable");
        if (node->expr) printToken(node->expr, "expr", "expr");
        ++m_indent;
        DefaultVisitor::visitFunctionCallParameterListElement(node);
        m_indent--;
    }

    virtual void visitFunctionDeclarationStatement(FunctionDeclarationStatementAst *node)
    {
        printToken(node, "functionDeclarationStatement");
        if (node->functionName) printToken(node->functionName, "identifier", "functionName");
        if (node->parameters) printToken(node->parameters, "parameterList", "parameters");
        if (node->functionBody) printToken(node->functionBody, "innerStatementList", "functionBody");
        ++m_indent;
        DefaultVisitor::visitFunctionDeclarationStatement(node);
        m_indent--;
    }

    virtual void visitGlobalVar(GlobalVarAst *node)
    {
        printToken(node, "globalVar");
        if (node->var) printToken(node->var, "variableIdentifier", "var");
        if (node->dollarVar) printToken(node->dollarVar, "variable", "dollarVar");
        if (node->expr) printToken(node->expr, "expr", "expr");
        ++m_indent;
        DefaultVisitor::visitGlobalVar(node);
        m_indent--;
    }

    virtual void visitIdentifier(IdentifierAst *node)
    {
        printToken(node, "identifier");
        ++m_indent;
        DefaultVisitor::visitIdentifier(node);
        m_indent--;
    }

    virtual void visitInnerStatementList(InnerStatementListAst *node)
    {
        printToken(node, "innerStatementList");
        if (node->statementsSequence)
        {
            const KDevPG::ListNode<TopStatementAst*> *__it = node->statementsSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "topStatement", "statements[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitInnerStatementList(node);
        m_indent--;
    }

    virtual void visitInstantiationAccess(InstantiationAccessAst *node)
    {
        printToken(node, "instantiationAccess");
        if (node->variableProperty) printToken(node->variableProperty, "variableProperty", "variableProperty");
        ++m_indent;
        DefaultVisitor::visitInstantiationAccess(node);
        m_indent--;
    }

    virtual void visitInterfaceDeclarationStatement(InterfaceDeclarationStatementAst *node)
    {
        printToken(node, "interfaceDeclarationStatement");
        if (node->interfaceName) printToken(node->interfaceName, "identifier", "interfaceName");
        if (node->extends) printToken(node->extends, "classImplements", "extends");
        if (node->body) printToken(node->body, "classBody", "body");
        ++m_indent;
        DefaultVisitor::visitInterfaceDeclarationStatement(node);
        m_indent--;
    }

    virtual void visitLexicalVar(LexicalVarAst *node)
    {
        printToken(node, "lexicalVar");
        if (node->variable) printToken(node->variable, "variableIdentifier", "variable");
        ++m_indent;
        DefaultVisitor::visitLexicalVar(node);
        m_indent--;
    }

    virtual void visitLexicalVarList(LexicalVarListAst *node)
    {
        printToken(node, "lexicalVarList");
        if (node->lexicalVarsSequence)
        {
            const KDevPG::ListNode<LexicalVarAst*> *__it = node->lexicalVarsSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "lexicalVar", "lexicalVars[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitLexicalVarList(node);
        m_indent--;
    }

    virtual void visitLogicalAndExpression(LogicalAndExpressionAst *node)
    {
        printToken(node, "logicalAndExpression");
        if (node->expressionSequence)
        {
            const KDevPG::ListNode<PrintExpressionAst*> *__it = node->expressionSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "printExpression", "expression[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitLogicalAndExpression(node);
        m_indent--;
    }

    virtual void visitLogicalOrExpression(LogicalOrExpressionAst *node)
    {
        printToken(node, "logicalOrExpression");
        if (node->expressionSequence)
        {
            const KDevPG::ListNode<LogicalXorExpressionAst*> *__it = node->expressionSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "logicalXorExpression", "expression[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitLogicalOrExpression(node);
        m_indent--;
    }

    virtual void visitLogicalXorExpression(LogicalXorExpressionAst *node)
    {
        printToken(node, "logicalXorExpression");
        if (node->expressionSequence)
        {
            const KDevPG::ListNode<LogicalAndExpressionAst*> *__it = node->expressionSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "logicalAndExpression", "expression[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitLogicalXorExpression(node);
        m_indent--;
    }

    virtual void visitMethodBody(MethodBodyAst *node)
    {
        printToken(node, "methodBody");
        if (node->statements) printToken(node->statements, "innerStatementList", "statements");
        ++m_indent;
        DefaultVisitor::visitMethodBody(node);
        m_indent--;
    }

    virtual void visitMultiplicativeExpression(MultiplicativeExpressionAst *node)
    {
        printToken(node, "multiplicativeExpression");
        if (node->expression) printToken(node->expression, "unaryExpression", "expression");
        if (node->additionalExpressionSequence)
        {
            const KDevPG::ListNode<MultiplicativeExpressionRestAst*> *__it = node->additionalExpressionSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "multiplicativeExpressionRest", "additionalExpression[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitMultiplicativeExpression(node);
        m_indent--;
    }

    virtual void visitMultiplicativeExpressionRest(MultiplicativeExpressionRestAst *node)
    {
        printToken(node, "multiplicativeExpressionRest");
        if (node->expression) printToken(node->expression, "unaryExpression", "expression");
        ++m_indent;
        DefaultVisitor::visitMultiplicativeExpressionRest(node);
        m_indent--;
    }

    virtual void visitNamespaceDeclarationStatement(NamespaceDeclarationStatementAst *node)
    {
        printToken(node, "namespaceDeclarationStatement");
        if (node->namespaceNameSequence)
        {
            const KDevPG::ListNode<IdentifierAst*> *__it = node->namespaceNameSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "identifier", "namespaceName[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        if (node->body) printToken(node->body, "innerStatementList", "body");
        ++m_indent;
        DefaultVisitor::visitNamespaceDeclarationStatement(node);
        m_indent--;
    }

    virtual void visitNamespacedIdentifier(NamespacedIdentifierAst *node)
    {
        printToken(node, "namespacedIdentifier");
        if (node->namespaceNameSequence)
        {
            const KDevPG::ListNode<IdentifierAst*> *__it = node->namespaceNameSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "identifier", "namespaceName[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitNamespacedIdentifier(node);
        m_indent--;
    }

    virtual void visitNewElseSingle(NewElseSingleAst *node)
    {
        printToken(node, "newElseSingle");
        if (node->statements) printToken(node->statements, "innerStatementList", "statements");
        ++m_indent;
        DefaultVisitor::visitNewElseSingle(node);
        m_indent--;
    }

    virtual void visitNewElseifList(NewElseifListAst *node)
    {
        printToken(node, "newElseifList");
        if (node->newElseifListItemSequence)
        {
            const KDevPG::ListNode<NewelseifListItemAst*> *__it = node->newElseifListItemSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "newelseifListItem", "newElseifListItem[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitNewElseifList(node);
        m_indent--;
    }

    virtual void visitNewelseifListItem(NewelseifListItemAst *node)
    {
        printToken(node, "newelseifListItem");
        if (node->expr) printToken(node->expr, "expr", "expr");
        if (node->statements) printToken(node->statements, "innerStatementList", "statements");
        ++m_indent;
        DefaultVisitor::visitNewelseifListItem(node);
        m_indent--;
    }

    virtual void visitObjectDimList(ObjectDimListAst *node)
    {
        printToken(node, "objectDimList");
        if (node->variableName) printToken(node->variableName, "variableName", "variableName");
        if (node->offsetItemsSequence)
        {
            const KDevPG::ListNode<DimListItemAst*> *__it = node->offsetItemsSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "dimListItem", "offsetItems[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitObjectDimList(node);
        m_indent--;
    }

    virtual void visitObjectOperator(ObjectOperatorAst *node)
    {
        printToken(node, "objectOperator");
        ++m_indent;
        DefaultVisitor::visitObjectOperator(node);
        m_indent--;
    }

    virtual void visitObjectProperty(ObjectPropertyAst *node)
    {
        printToken(node, "objectProperty");
        if (node->objectDimList) printToken(node->objectDimList, "objectDimList", "objectDimList");
        if (node->variableWithoutObjects) printToken(node->variableWithoutObjects, "variableWithoutObjects", "variableWithoutObjects");
        ++m_indent;
        DefaultVisitor::visitObjectProperty(node);
        m_indent--;
    }

    virtual void visitOptionalClassModifier(OptionalClassModifierAst *node)
    {
        printToken(node, "optionalClassModifier");
        ++m_indent;
        DefaultVisitor::visitOptionalClassModifier(node);
        m_indent--;
    }

    virtual void visitOptionalModifiers(OptionalModifiersAst *node)
    {
        printToken(node, "optionalModifiers");
        ++m_indent;
        DefaultVisitor::visitOptionalModifiers(node);
        m_indent--;
    }

    virtual void visitOuterTopStatement(OuterTopStatementAst *node)
    {
        printToken(node, "outerTopStatement");
        if (node->namespaceDeclaration) printToken(node->namespaceDeclaration, "namespaceDeclarationStatement", "namespaceDeclaration");
        if (node->statement) printToken(node->statement, "topStatement", "statement");
        ++m_indent;
        DefaultVisitor::visitOuterTopStatement(node);
        m_indent--;
    }

    virtual void visitParameter(ParameterAst *node)
    {
        printToken(node, "parameter");
        if (node->parameterType) printToken(node->parameterType, "namespacedIdentifier", "parameterType");
        if (node->variable) printToken(node->variable, "variableIdentifier", "variable");
        if (node->defaultValue) printToken(node->defaultValue, "staticScalar", "defaultValue");
        ++m_indent;
        DefaultVisitor::visitParameter(node);
        m_indent--;
    }

    virtual void visitParameterList(ParameterListAst *node)
    {
        printToken(node, "parameterList");
        if (node->parametersSequence)
        {
            const KDevPG::ListNode<ParameterAst*> *__it = node->parametersSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "parameter", "parameters[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitParameterList(node);
        m_indent--;
    }

    virtual void visitPostprefixOperator(PostprefixOperatorAst *node)
    {
        printToken(node, "postprefixOperator");
        ++m_indent;
        DefaultVisitor::visitPostprefixOperator(node);
        m_indent--;
    }

    virtual void visitPrintExpression(PrintExpressionAst *node)
    {
        printToken(node, "printExpression");
        if (node->expression) printToken(node->expression, "assignmentExpression", "expression");
        ++m_indent;
        DefaultVisitor::visitPrintExpression(node);
        m_indent--;
    }

    virtual void visitRelationalExpression(RelationalExpressionAst *node)
    {
        printToken(node, "relationalExpression");
        if (node->expression) printToken(node->expression, "shiftExpression", "expression");
        if (node->additionalExpressionSequence)
        {
            const KDevPG::ListNode<RelationalExpressionRestAst*> *__it = node->additionalExpressionSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "relationalExpressionRest", "additionalExpression[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        if (node->instanceofType) printToken(node->instanceofType, "classNameReference", "instanceofType");
        ++m_indent;
        DefaultVisitor::visitRelationalExpression(node);
        m_indent--;
    }

    virtual void visitRelationalExpressionRest(RelationalExpressionRestAst *node)
    {
        printToken(node, "relationalExpressionRest");
        if (node->expression) printToken(node->expression, "shiftExpression", "expression");
        ++m_indent;
        DefaultVisitor::visitRelationalExpressionRest(node);
        m_indent--;
    }

    virtual void visitScalar(ScalarAst *node)
    {
        printToken(node, "scalar");
        if (node->commonScalar) printToken(node->commonScalar, "commonScalar", "commonScalar");
        if (node->constantOrClassConst) printToken(node->constantOrClassConst, "constantOrClassConst", "constantOrClassConst");
        if (node->encapsList) printToken(node->encapsList, "encapsList", "encapsList");
        if (node->stringIndex) printToken(node->stringIndex, "stringIndexSpecifier", "stringIndex");
        ++m_indent;
        DefaultVisitor::visitScalar(node);
        m_indent--;
    }

    virtual void visitSemicolonOrCloseTag(SemicolonOrCloseTagAst *node)
    {
        printToken(node, "semicolonOrCloseTag");
        ++m_indent;
        DefaultVisitor::visitSemicolonOrCloseTag(node);
        m_indent--;
    }

    virtual void visitShiftExpression(ShiftExpressionAst *node)
    {
        printToken(node, "shiftExpression");
        if (node->expression) printToken(node->expression, "additiveExpression", "expression");
        if (node->additionalExpressionSequence)
        {
            const KDevPG::ListNode<ShiftExpressionRestAst*> *__it = node->additionalExpressionSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "shiftExpressionRest", "additionalExpression[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitShiftExpression(node);
        m_indent--;
    }

    virtual void visitShiftExpressionRest(ShiftExpressionRestAst *node)
    {
        printToken(node, "shiftExpressionRest");
        if (node->expression) printToken(node->expression, "additiveExpression", "expression");
        ++m_indent;
        DefaultVisitor::visitShiftExpressionRest(node);
        m_indent--;
    }

    virtual void visitStart(StartAst *node)
    {
        printToken(node, "start");
        if (node->statementsSequence)
        {
            const KDevPG::ListNode<OuterTopStatementAst*> *__it = node->statementsSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "outerTopStatement", "statements[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitStart(node);
        m_indent--;
    }

    virtual void visitStatement(StatementAst *node)
    {
        printToken(node, "statement");
        if (node->statements) printToken(node->statements, "innerStatementList", "statements");
        if (node->ifExpr) printToken(node->ifExpr, "expr", "ifExpr");
        if (node->ifStatement) printToken(node->ifStatement, "statement", "ifStatement");
        if (node->elseifList) printToken(node->elseifList, "elseifList", "elseifList");
        if (node->elseSingle) printToken(node->elseSingle, "elseSingle", "elseSingle");
        if (node->whileExpr) printToken(node->whileExpr, "expr", "whileExpr");
        if (node->whileStatement) printToken(node->whileStatement, "whileStatement", "whileStatement");
        if (node->forExpr1) printToken(node->forExpr1, "forExpr", "forExpr1");
        if (node->forExpr2) printToken(node->forExpr2, "forExpr", "forExpr2");
        if (node->forExpr3) printToken(node->forExpr3, "forExpr", "forExpr3");
        if (node->forStatement) printToken(node->forStatement, "forStatement", "forStatement");
        if (node->swtichExpr) printToken(node->swtichExpr, "expr", "swtichExpr");
        if (node->switchCaseList) printToken(node->switchCaseList, "switchCaseList", "switchCaseList");
        if (node->foreachVar) printToken(node->foreachVar, "variable", "foreachVar");
        if (node->foreachVarAsVar) printToken(node->foreachVarAsVar, "foreachVariable", "foreachVarAsVar");
        if (node->foreachExpr) printToken(node->foreachExpr, "expr", "foreachExpr");
        if (node->foreachExprAsVar) printToken(node->foreachExprAsVar, "variable", "foreachExprAsVar");
        if (node->foreachVariable) printToken(node->foreachVariable, "foreachVariable", "foreachVariable");
        if (node->foreachStatement) printToken(node->foreachStatement, "foreachStatement", "foreachStatement");
        if (node->declareItem) printToken(node->declareItem, "declareItem", "declareItem");
        if (node->catchesSequence)
        {
            const KDevPG::ListNode<CatchItemAst*> *__it = node->catchesSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "catchItem", "catches[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        if (node->unsetVariablesSequence)
        {
            const KDevPG::ListNode<VariableAst*> *__it = node->unsetVariablesSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "variable", "unsetVariables[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        if (node->expr) printToken(node->expr, "expr", "expr");
        if (node->doStatement) printToken(node->doStatement, "statement", "doStatement");
        if (node->breakExpr) printToken(node->breakExpr, "expr", "breakExpr");
        if (node->continueExpr) printToken(node->continueExpr, "expr", "continueExpr");
        if (node->returnExpr) printToken(node->returnExpr, "expr", "returnExpr");
        if (node->globalVarsSequence)
        {
            const KDevPG::ListNode<GlobalVarAst*> *__it = node->globalVarsSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "globalVar", "globalVars[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        if (node->staticVarsSequence)
        {
            const KDevPG::ListNode<StaticVarAst*> *__it = node->staticVarsSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "staticVar", "staticVars[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        if (node->echoExprsSequence)
        {
            const KDevPG::ListNode<ExprAst*> *__it = node->echoExprsSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "expr", "echoExprs[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        if (node->throwExpr) printToken(node->throwExpr, "expr", "throwExpr");
        if (node->constsSequence)
        {
            const KDevPG::ListNode<ConstantDeclarationAst*> *__it = node->constsSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "constantDeclaration", "consts[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        if (node->useNamespaceSequence)
        {
            const KDevPG::ListNode<UseNamespaceAst*> *__it = node->useNamespaceSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "useNamespace", "useNamespace[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitStatement(node);
        m_indent--;
    }

    virtual void visitStaticArrayPairValue(StaticArrayPairValueAst *node)
    {
        printToken(node, "staticArrayPairValue");
        if (node->val1Sequence)
        {
            const KDevPG::ListNode<StaticScalarAst*> *__it = node->val1Sequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "staticScalar", "val1[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        if (node->val2Sequence)
        {
            const KDevPG::ListNode<StaticScalarAst*> *__it = node->val2Sequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "staticScalar", "val2[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitStaticArrayPairValue(node);
        m_indent--;
    }

    virtual void visitStaticMember(StaticMemberAst *node)
    {
        printToken(node, "staticMember");
        if (node->className) printToken(node->className, "namespacedIdentifier", "className");
        if (node->variable) printToken(node->variable, "variableWithoutObjects", "variable");
        ++m_indent;
        DefaultVisitor::visitStaticMember(node);
        m_indent--;
    }

    virtual void visitStaticScalar(StaticScalarAst *node)
    {
        printToken(node, "staticScalar");
        if (node->value) printToken(node->value, "commonScalar", "value");
        if (node->constantOrClassConst) printToken(node->constantOrClassConst, "constantOrClassConst", "constantOrClassConst");
        if (node->plusValue) printToken(node->plusValue, "staticScalar", "plusValue");
        if (node->minusValue) printToken(node->minusValue, "staticScalar", "minusValue");
        if (node->arrayValuesSequence)
        {
            const KDevPG::ListNode<StaticArrayPairValueAst*> *__it = node->arrayValuesSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "staticArrayPairValue", "arrayValues[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitStaticScalar(node);
        m_indent--;
    }

    virtual void visitStaticVar(StaticVarAst *node)
    {
        printToken(node, "staticVar");
        if (node->var) printToken(node->var, "variableIdentifier", "var");
        if (node->value) printToken(node->value, "staticScalar", "value");
        ++m_indent;
        DefaultVisitor::visitStaticVar(node);
        m_indent--;
    }

    virtual void visitStringIndexSpecifier(StringIndexSpecifierAst *node)
    {
        printToken(node, "stringIndexSpecifier");
        if (node->expr) printToken(node->expr, "expr", "expr");
        ++m_indent;
        DefaultVisitor::visitStringIndexSpecifier(node);
        m_indent--;
    }

    virtual void visitSwitchCaseList(SwitchCaseListAst *node)
    {
        printToken(node, "switchCaseList");
        if (node->caseList) printToken(node->caseList, "caseList", "caseList");
        ++m_indent;
        DefaultVisitor::visitSwitchCaseList(node);
        m_indent--;
    }

    virtual void visitTopStatement(TopStatementAst *node)
    {
        printToken(node, "topStatement");
        if (node->statement) printToken(node->statement, "statement", "statement");
        if (node->functionDeclaration) printToken(node->functionDeclaration, "functionDeclarationStatement", "functionDeclaration");
        if (node->classDeclaration) printToken(node->classDeclaration, "classDeclarationStatement", "classDeclaration");
        if (node->traitDeclaration) printToken(node->traitDeclaration, "traitDeclarationStatement", "traitDeclaration");
        if (node->interfaceDeclaration) printToken(node->interfaceDeclaration, "interfaceDeclarationStatement", "interfaceDeclaration");
        ++m_indent;
        DefaultVisitor::visitTopStatement(node);
        m_indent--;
    }

    virtual void visitTraitAliasDeclaration(TraitAliasDeclarationAst *node)
    {
        printToken(node, "traitAliasDeclaration");
        if (node->statementsSequence)
        {
            const KDevPG::ListNode<TraitAliasStatementAst*> *__it = node->statementsSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "traitAliasStatement", "statements[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitTraitAliasDeclaration(node);
        m_indent--;
    }

    virtual void visitTraitAliasIdentifier(TraitAliasIdentifierAst *node)
    {
        printToken(node, "traitAliasIdentifier");
        if (node->identifier) printToken(node->identifier, "namespacedIdentifier", "identifier");
        if (node->methodIdentifier) printToken(node->methodIdentifier, "identifier", "methodIdentifier");
        ++m_indent;
        DefaultVisitor::visitTraitAliasIdentifier(node);
        m_indent--;
    }

    virtual void visitTraitAliasStatement(TraitAliasStatementAst *node)
    {
        printToken(node, "traitAliasStatement");
        if (node->importIdentifier) printToken(node->importIdentifier, "traitAliasIdentifier", "importIdentifier");
        if (node->modifiers) printToken(node->modifiers, "optionalModifiers", "modifiers");
        if (node->aliasIdentifier) printToken(node->aliasIdentifier, "identifier", "aliasIdentifier");
        if (node->conflictIdentifierSequence)
        {
            const KDevPG::ListNode<NamespacedIdentifierAst*> *__it = node->conflictIdentifierSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "namespacedIdentifier", "conflictIdentifier[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitTraitAliasStatement(node);
        m_indent--;
    }

    virtual void visitTraitDeclarationStatement(TraitDeclarationStatementAst *node)
    {
        printToken(node, "traitDeclarationStatement");
        if (node->traitName) printToken(node->traitName, "identifier", "traitName");
        if (node->body) printToken(node->body, "classBody", "body");
        ++m_indent;
        DefaultVisitor::visitTraitDeclarationStatement(node);
        m_indent--;
    }

    virtual void visitUnaryExpression(UnaryExpressionAst *node)
    {
        printToken(node, "unaryExpression");
        if (node->unaryExpression) printToken(node->unaryExpression, "unaryExpression", "unaryExpression");
        if (node->assignmentList) printToken(node->assignmentList, "assignmentList", "assignmentList");
        if (node->expression) printToken(node->expression, "expr", "expression");
        if (node->includeExpression) printToken(node->includeExpression, "unaryExpression", "includeExpression");
        if (node->unaryExpressionNotPlusminus) printToken(node->unaryExpressionNotPlusminus, "unaryExpressionNotPlusminus", "unaryExpressionNotPlusminus");
        ++m_indent;
        DefaultVisitor::visitUnaryExpression(node);
        m_indent--;
    }

    virtual void visitUnaryExpressionNotPlusminus(UnaryExpressionNotPlusminusAst *node)
    {
        printToken(node, "unaryExpressionNotPlusminus");
        if (node->prefixOperatorSequence)
        {
            const KDevPG::ListNode<PostprefixOperatorAst*> *__it = node->prefixOperatorSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "postprefixOperator", "prefixOperator[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        if (node->varExpression) printToken(node->varExpression, "varExpression", "varExpression");
        if (node->postfixOperatorSequence)
        {
            const KDevPG::ListNode<PostprefixOperatorAst*> *__it = node->postfixOperatorSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "postprefixOperator", "postfixOperator[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitUnaryExpressionNotPlusminus(node);
        m_indent--;
    }

    virtual void visitUseNamespace(UseNamespaceAst *node)
    {
        printToken(node, "useNamespace");
        if (node->identifier) printToken(node->identifier, "namespacedIdentifier", "identifier");
        if (node->aliasIdentifier) printToken(node->aliasIdentifier, "identifier", "aliasIdentifier");
        ++m_indent;
        DefaultVisitor::visitUseNamespace(node);
        m_indent--;
    }

    virtual void visitVarExpression(VarExpressionAst *node)
    {
        printToken(node, "varExpression");
        if (node->variable) printToken(node->variable, "variable", "variable");
        if (node->newObject) printToken(node->newObject, "varExpressionNewObject", "newObject");
        if (node->varExpressionNormal) printToken(node->varExpressionNormal, "varExpressionNormal", "varExpressionNormal");
        if (node->varExpressionArray) printToken(node->varExpressionArray, "varExpressionArray", "varExpressionArray");
        if (node->arrayIndex) printToken(node->arrayIndex, "arrayIndexSpecifier", "arrayIndex");
        ++m_indent;
        DefaultVisitor::visitVarExpression(node);
        m_indent--;
    }

    virtual void visitVarExpressionArray(VarExpressionArrayAst *node)
    {
        printToken(node, "varExpressionArray");
        if (node->arrayValuesSequence)
        {
            const KDevPG::ListNode<ArrayPairValueAst*> *__it = node->arrayValuesSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "arrayPairValue", "arrayValues[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitVarExpressionArray(node);
        m_indent--;
    }

    virtual void visitVarExpressionNewObject(VarExpressionNewObjectAst *node)
    {
        printToken(node, "varExpressionNewObject");
        if (node->className) printToken(node->className, "classNameReference", "className");
        if (node->ctor) printToken(node->ctor, "ctorArguments", "ctor");
        ++m_indent;
        DefaultVisitor::visitVarExpressionNewObject(node);
        m_indent--;
    }

    virtual void visitVarExpressionNormal(VarExpressionNormalAst *node)
    {
        printToken(node, "varExpressionNormal");
        if (node->newObject) printToken(node->newObject, "varExpressionNewObject", "newObject");
        if (node->variablePropertiesSequence)
        {
            const KDevPG::ListNode<InstantiationAccessAst*> *__it = node->variablePropertiesSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "instantiationAccess", "variableProperties[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        if (node->expression) printToken(node->expression, "expr", "expression");
        if (node->encapsList) printToken(node->encapsList, "encapsList", "encapsList");
        if (node->variable) printToken(node->variable, "variable", "variable");
        if (node->scalar) printToken(node->scalar, "scalar", "scalar");
        if (node->issetVariableSequence)
        {
            const KDevPG::ListNode<VariableAst*> *__it = node->issetVariableSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "variable", "issetVariable[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        if (node->emptyVarialbe) printToken(node->emptyVarialbe, "variable", "emptyVarialbe");
        if (node->cloneCar) printToken(node->cloneCar, "varExpressionNormal", "cloneCar");
        if (node->closure) printToken(node->closure, "closure", "closure");
        ++m_indent;
        DefaultVisitor::visitVarExpressionNormal(node);
        m_indent--;
    }

    virtual void visitVariable(VariableAst *node)
    {
        printToken(node, "variable");
        if (node->var) printToken(node->var, "baseVariableWithFunctionCalls", "var");
        if (node->variablePropertiesSequence)
        {
            const KDevPG::ListNode<VariableObjectPropertyAst*> *__it = node->variablePropertiesSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "variableObjectProperty", "variableProperties[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitVariable(node);
        m_indent--;
    }

    virtual void visitVariableIdentifier(VariableIdentifierAst *node)
    {
        printToken(node, "variableIdentifier");
        ++m_indent;
        DefaultVisitor::visitVariableIdentifier(node);
        m_indent--;
    }

    virtual void visitVariableName(VariableNameAst *node)
    {
        printToken(node, "variableName");
        if (node->name) printToken(node->name, "identifier", "name");
        if (node->expr) printToken(node->expr, "expr", "expr");
        ++m_indent;
        DefaultVisitor::visitVariableName(node);
        m_indent--;
    }

    virtual void visitVariableObjectProperty(VariableObjectPropertyAst *node)
    {
        printToken(node, "variableObjectProperty");
        if (node->variableProperty) printToken(node->variableProperty, "variableProperty", "variableProperty");
        ++m_indent;
        DefaultVisitor::visitVariableObjectProperty(node);
        m_indent--;
    }

    virtual void visitVariableProperty(VariablePropertyAst *node)
    {
        printToken(node, "variableProperty");
        if (node->variable) printToken(node->variable, "variable", "variable");
        if (node->objectProperty) printToken(node->objectProperty, "objectProperty", "objectProperty");
        if (node->parameterList) printToken(node->parameterList, "functionCallParameterList", "parameterList");
        if (node->arrayIndex) printToken(node->arrayIndex, "arrayIndexSpecifier", "arrayIndex");
        ++m_indent;
        DefaultVisitor::visitVariableProperty(node);
        m_indent--;
    }

    virtual void visitVariableWithoutObjects(VariableWithoutObjectsAst *node)
    {
        printToken(node, "variableWithoutObjects");
        if (node->variable) printToken(node->variable, "compoundVariableWithSimpleIndirectReference", "variable");
        if (node->offsetItemsSequence)
        {
            const KDevPG::ListNode<DimListItemAst*> *__it = node->offsetItemsSequence->front(), *__end = __it;
            do
            {
                printToken(__it->element, "dimListItem", "offsetItems[]");
                __it = __it->next;
            }
            while (__it != __end);
        }
        ++m_indent;
        DefaultVisitor::visitVariableWithoutObjects(node);
        m_indent--;
    }

    virtual void visitWhileStatement(WhileStatementAst *node)
    {
        printToken(node, "whileStatement");
        if (node->statement) printToken(node->statement, "statement", "statement");
        if (node->statements) printToken(node->statements, "innerStatementList", "statements");
        ++m_indent;
        DefaultVisitor::visitWhileStatement(node);
        m_indent--;
    }

private:
    void printToken(AstNode *node, const QString &mType, const QString &mName = QString())
    {
        QString tokenString;
        if (!m_content.isEmpty())
        {
            TokenStream::Token startToken = m_str->at(node->startToken);
            TokenStream::Token endToken = m_str->at(node->endToken);
            int begin = startToken.begin;
            int end = endToken.end;
            if (end-begin > 30)
            {
                tokenString = m_content.mid(begin, 10);
                tokenString += " ...";
                tokenString += QString("%1 more").arg(end-begin-20);
                tokenString += "... ";
                tokenString += m_content.mid(end-10, 10);
            }
            else
            {
                tokenString = m_content.mid(begin, end-begin+1);
            }
            tokenString = tokenString.replace('\n', "\\n");
            tokenString = tokenString.replace('\r', "\\r");
        }
        qint64 beginLine,endLine,beginCol,endCol;
        m_str->startPosition(node->startToken, &beginLine, &beginCol);
        m_str->endPosition(node->endToken, &endLine, &endCol);
        qDebug() << QString().fill(' ', m_indent) + mName + (!mName.isEmpty() ? "->" : "") + mType + "[" << m_str->at( node->startToken ).begin << "," << beginLine << "," << beginCol << "] --- [" << m_str->at( node->endToken ).end << "," << endLine << "," << endCol << "] " << tokenString;
    }
    TokenStream *m_str;
    int m_indent;
    QString m_content;
};

} // end of namespace Php

#endif

