## net.percederberg.mib.asn1.analysis
Class TreePrinter

    java.lang.Object
      |
      +--net.percederberg.mib.asn1.analysis.TreeWalker
            |
            +--net.percederberg.mib.asn1.analysis.DepthFirstAdapter
                  |
                  +--net.percederberg.mib.asn1.analysis.TreePrinter

All Implemented Interfaces:
  Switch

public class TreePrinter
extends DepthFirstAdapter

This class provides a tree printing mechanism. The tree is traversed in depth first order and all nodes in it are printed.

Author:
  Per Cederberg, per@percederberg.net

Constructor Summary
`TreePrinter(java.io.PrintStream os)` Creates a new tree printer with an indentation step of 2.
`TreePrinter(java.io.PrintStream os, int indentStep)` Creates a new tree printer with the given indentation step.

Method Summary
`protected void` `defaultIn(Node node)` A default method called from all inXXX methods.
`protected void` `defaultOut(Node node)` A default method called from all outXXX methods.

Methods inherited from class net.percederberg.mib.asn1.analysis.DepthFirstAdapter

`caseAlphabetConstraint, caseAnyType, caseAssignment, caseAssignmentList, caseBinaryString, caseBitStringType, caseBooleanValue, caseBuiltinType, caseBuiltinValue, caseCharString, caseChoiceType, caseClass, caseClassNumber, caseConstraint, caseConstraintList, caseDefinedMacroName, caseDefinedMacroType, caseDefinedType, caseDefinedValue, caseElementType, caseElementTypeList, caseEnumeratedType, caseEOF, caseExports, caseHexString, caseIdentifier, caseImports, caseIntegerType, caseLowerEndPoint, caseMacroBody, caseMacroDefinition, caseMacroReference, caseModuleBody, caseModuleDefinition, caseModuleIdentifier, caseModuleReference, caseNameAndNumberForm, caseNamedNumber, caseNamedNumberList, caseNamedType, caseNamedValue, caseNullValue, caseNumber, caseObjectIdentifierValue, caseObjIdComponent, caseObjIdComponentList, caseSelectionType, caseSequenceOfType, caseSequenceType, caseSetOfType, caseSetType, caseSignedNumber, caseSizeConstraint, caseSkipToEND, caseSnmpAccessPart, caseSnmpDefValPart, caseSnmpDescrPart, caseSnmpIndexPart, caseSnmpObjectTypeMacroType, caseSnmpReferPart, caseSnmpStatusPart, caseSnmpTrapTypeMacroType, caseSnmpVarPart, caseSpecialRealValue, caseStart, caseStringType, caseSymbol, caseSymbolList, caseSymbolsFromModule, caseSymbolsFromModuleList, caseTABSENT, caseTACCESS, caseTag, caseTagDefault, caseTaggedType, caseTANY, caseTAPPLICATION, caseTASSIGN, caseTBAR, caseTBEGIN, caseTBINSTRING, caseTBIT, caseTBOOLEAN, caseTBY, caseTCHOICE, caseTCOMMA, caseTCOMPONENT, caseTCOMPONENTS, caseTCSTRING, caseTDEFAULT, caseTDEFINED, caseTDEFINITIONS, caseTDEFVAL, caseTDESCRIPTION, caseTDOT, caseTEND, caseTENTERPRISE, caseTENUMERATED, caseTEXPLICIT, caseTEXPORTS, caseTFALSE, caseTFROM, caseTHEXSTRING, caseTIDENTIFIER, caseTIMPLICIT, caseTIMPORTS, caseTINCLUDES, caseTINDEX, caseTINTEGER, caseTLCASEFIRST_IDENT, caseTLEFTBRACE, caseTLEFTBRACKET, caseTLEFTPAREN, caseTLESSTHAN, caseTMACRO, caseTMAX, caseTMIN, caseTMINUS_INFINITY, caseTMINUS, caseTNULL, caseTNUMBER, caseTOBJECT_TYPE, caseTOBJECT, caseTOCTET, caseTOF, caseTOPTIONAL, caseTPLUS_INFINITY, caseTPRESENT, caseTPRIVATE, caseTREAL, caseTREFERENCE, caseTRIGHTBRACE, caseTRIGHTBRACKET, caseTRIGHTPAREN, caseTSEMI_COLON, caseTSEQUENCE, caseTSET, caseTSIZE, caseTSTATUS, caseTSTRING, caseTSYNTAX, caseTTAGS, caseTTRAP_TYPE, caseTTRUE, caseTUCASEFIRST_IDENT, caseTUNIVERSAL, caseTVARIABLES, caseTWITH, caseType, caseTypeAssignment, caseTypeOrValue, caseTypeOrValueList, caseTypeReference, caseUpperEndPoint, caseValue, caseValueAssignment, caseValueConstraint, caseValueRange, caseVarTypes, defaultCase, inAlphabetConstraint, inAnyType, inAssignment, inAssignmentList, inBinaryString, inBitStringType, inBooleanValue, inBuiltinType, inBuiltinValue, inCharString, inChoiceType, inClass, inClassNumber, inConstraint, inConstraintList, inDefinedMacroName, inDefinedMacroType, inDefinedType, inDefinedValue, inElementType, inElementTypeList, inEnumeratedType, inEOF, inExports, inHexString, inIdentifier, inImports, inIntegerType, inLowerEndPoint, inMacroBody, inMacroDefinition, inMacroReference, inModuleBody, inModuleDefinition, inModuleIdentifier, inModuleReference, inNameAndNumberForm, inNamedNumber, inNamedNumberList, inNamedType, inNamedValue, inNullValue, inNumber, inObjectIdentifierValue, inObjIdComponent, inObjIdComponentList, inSelectionType, inSequenceOfType, inSequenceType, inSetOfType, inSetType, inSignedNumber, inSizeConstraint, inSkipToEND, inSnmpAccessPart, inSnmpDefValPart, inSnmpDescrPart, inSnmpIndexPart, inSnmpObjectTypeMacroType, inSnmpReferPart, inSnmpStatusPart, inSnmpTrapTypeMacroType, inSnmpVarPart, inSpecialRealValue, inStart, inStringType, inSymbol, inSymbolList, inSymbolsFromModule, inSymbolsFromModuleList, inTABSENT, inTACCESS, inTag, inTagDefault, inTaggedType, inTANY, inTAPPLICATION, inTASSIGN, inTBAR, inTBEGIN, inTBINSTRING, inTBIT, inTBOOLEAN, inTBY, inTCHOICE, inTCOMMA, inTCOMPONENT, inTCOMPONENTS, inTCSTRING, inTDEFAULT, inTDEFINED, inTDEFINITIONS, inTDEFVAL, inTDESCRIPTION, inTDOT, inTEND, inTENTERPRISE, inTENUMERATED, inTEXPLICIT, inTEXPORTS, inTFALSE, inTFROM, inTHEXSTRING, inTIDENTIFIER, inTIMPLICIT, inTIMPORTS, inTINCLUDES, inTINDEX, inTINTEGER, inTLCASEFIRST_IDENT, inTLEFTBRACE, inTLEFTBRACKET, inTLEFTPAREN, inTLESSTHAN, inTMACRO, inTMAX, inTMIN, inTMINUS_INFINITY, inTMINUS, inTNULL, inTNUMBER, inTOBJECT_TYPE, inTOBJECT, inTOCTET, inTOF, inTOPTIONAL, inTPLUS_INFINITY, inTPRESENT, inTPRIVATE, inTREAL, inTREFERENCE, inTRIGHTBRACE, inTRIGHTBRACKET, inTRIGHTPAREN, inTSEMI_COLON, inTSEQUENCE, inTSET, inTSIZE, inTSTATUS, inTSTRING, inTSYNTAX, inTTAGS, inTTRAP_TYPE, inTTRUE, inTUCASEFIRST_IDENT, inTUNIVERSAL, inTVARIABLES, inTWITH, inType, inTypeAssignment, inTypeOrValue, inTypeOrValueList, inTypeReference, inUpperEndPoint, inValue, inValueAssignment, inValueConstraint, inValueRange, inVarTypes, outAlphabetConstraint, outAnyType, outAssignment, outAssignmentList, outBinaryString, outBitStringType, outBooleanValue, outBuiltinType, outBuiltinValue, outCharString, outChoiceType, outClass, outClassNumber, outConstraint, outConstraintList, outDefinedMacroName, outDefinedMacroType, outDefinedType, outDefinedValue, outElementType, outElementTypeList, outEnumeratedType, outEOF, outExports, outHexString, outIdentifier, outImports, outIntegerType, outLowerEndPoint, outMacroBody, outMacroDefinition, outMacroReference, outModuleBody, outModuleDefinition, outModuleIdentifier, outModuleReference, outNameAndNumberForm, outNamedNumber, outNamedNumberList, outNamedType, outNamedValue, outNullValue, outNumber, outObjectIdentifierValue, outObjIdComponent, outObjIdComponentList, outSelectionType, outSequenceOfType, outSequenceType, outSetOfType, outSetType, outSignedNumber, outSizeConstraint, outSkipToEND, outSnmpAccessPart, outSnmpDefValPart, outSnmpDescrPart, outSnmpIndexPart, outSnmpObjectTypeMacroType, outSnmpReferPart, outSnmpStatusPart, outSnmpTrapTypeMacroType, outSnmpVarPart, outSpecialRealValue, outStart, outStringType, outSymbol, outSymbolList, outSymbolsFromModule, outSymbolsFromModuleList, outTABSENT, outTACCESS, outTag, outTagDefault, outTaggedType, outTANY, outTAPPLICATION, outTASSIGN, outTBAR, outTBEGIN, outTBINSTRING, outTBIT, outTBOOLEAN, outTBY, outTCHOICE, outTCOMMA, outTCOMPONENT, outTCOMPONENTS, outTCSTRING, outTDEFAULT, outTDEFINED, outTDEFINITIONS, outTDEFVAL, outTDESCRIPTION, outTDOT, outTEND, outTENTERPRISE, outTENUMERATED, outTEXPLICIT, outTEXPORTS, outTFALSE, outTFROM, outTHEXSTRING, outTIDENTIFIER, outTIMPLICIT, outTIMPORTS, outTINCLUDES, outTINDEX, outTINTEGER, outTLCASEFIRST_IDENT, outTLEFTBRACE, outTLEFTBRACKET, outTLEFTPAREN, outTLESSTHAN, outTMACRO, outTMAX, outTMIN, outTMINUS_INFINITY, outTMINUS, outTNULL, outTNUMBER, outTOBJECT_TYPE, outTOBJECT, outTOCTET, outTOF, outTOPTIONAL, outTPLUS_INFINITY, outTPRESENT, outTPRIVATE, outTREAL, outTREFERENCE, outTRIGHTBRACE, outTRIGHTBRACKET, outTRIGHTPAREN, outTSEMI_COLON, outTSEQUENCE, outTSET, outTSIZE, outTSTATUS, outTSTRING, outTSYNTAX, outTTAGS, outTTRAP_TYPE, outTTRUE, outTUCASEFIRST_IDENT, outTUNIVERSAL, outTVARIABLES, outTWITH, outType, outTypeAssignment, outTypeOrValue, outTypeOrValueList, outTypeReference, outUpperEndPoint, outValue, outValueAssignment, outValueConstraint, outValueRange, outVarTypes`

Methods inherited from class net.percederberg.mib.asn1.analysis.TreeWalker
`getIn, getOut, setIn, setOut`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TreePrinter

    public TreePrinter(java.io.PrintStream os)

  Creates a new tree printer with an indentation step of 2.
  Parameters:
    `os` - the selected output stream

### TreePrinter

    public TreePrinter(java.io.PrintStream os,
                       int indentStep)

  Creates a new tree printer with the given indentation step.
  Parameters:
    `os` - the selected output stream
    `indentStep` - the size of each indentation step

Method Detail

### defaultIn

    protected void defaultIn(Node node)

  A default method called from all inXXX methods. Override this method in a subclass to handle the default case.
  Overrides:
    `defaultIn` in class `DepthFirstAdapter`
  Parameters:
    `node` - a parse tree node

### defaultOut

    protected void defaultOut(Node node)

  A default method called from all outXXX methods. Override this method in a subclass to handle the default case.
  Overrides:
    `defaultOut` in class `DepthFirstAdapter`
  Parameters:
    `node` - a parse tree node