protected Array < Actor > parse ( ) { actors = GdxArrays . newArray ( Actor . class ) ; invokePreListeners ( actors ) ; final StringBuilder builder = new StringBuilder ( ) ; while ( templateReader . hasNextCharacter ( ) ) { final char character = templateReader . nextCharacter ( ) ; if ( character == syntax . getArgumentOpening ( ) ) { // Found an argument opening. This needs to be replaced. processArgument ( ) ; } else if ( character == syntax . getTagOpening ( ) ) { // Tag was just opened. This might be a comment, though. if ( isNextCharacterCommentOpening ( ) ) { processComment ( ) ; continue ; } // This is not a comment, since we're there. Parsing a new tag. if ( currentParentTag != null ) { currentParentTag . handleDataBetweenTags ( builder ) ; } Strings . clearBuilder ( builder ) ; processTag ( builder ) ; } else { // Just your regular letter outside of a tag: builder . append ( character ) ; } } if ( currentParentTag != null ) { throwError ( ' ' + currentParentTag . getTagName ( ) + "\" tag was never closed." ) ; } invokePortListeners ( actors ) ; return actors ; }
Does the actual parsing