private static void print ( StringBuilder buf , Node < PluralType > node ) { switch ( node . type ( ) ) { case RULE : join ( buf , node , " " ) ; break ; case AND_CONDITION : join ( buf , node , " and " ) ; break ; case OR_CONDITION : join ( buf , node , " or " ) ; break ; case RANGELIST : join ( buf , node , "," ) ; break ; case RANGE : join ( buf , node , ".." ) ; break ; case EXPR : join ( buf , node , " " ) ; break ; case MODOP : buf . append ( "% " ) . append ( node . asAtom ( ) . value ( ) ) ; break ; case INTEGER : case OPERAND : case RELOP : case SAMPLE : buf . append ( node . asAtom ( ) . value ( ) ) ; break ; } }
Recursively visit the structs and atoms in the pluralization node or tree appending the representations to a string buffer .