question: String parseToken ( boolean quoted ) throws JasperException { StringBuilder stringBuffer = new StringBuilder ( ) ; skipSpaces ( ) ; stringBuffer . setLength ( 0 ) ; if ( ! hasMoreInput ( ) ) { return "" ; } int ch = peekChar ( ) ; if ( quoted ) { if ( ch == '"' || ch == '\'' ) { char endQuote = ch == '"' ? '"' : '\'' ; ch = nextChar ( ) ; for ( ch = nextChar ( ) ; ch != - 1 && ch != endQuote ; ch = nextChar ( ) ) { if ( ch == '\\' ) ch = nextChar ( ) ; stringBuffer . append ( ( char ) ch ) ; } if ( ch == - 1 ) { err . jspError ( mark ( ) , "jsp.error.quotes.unterminated" ) ; } } else { err . jspError ( mark ( ) , "jsp.error.attr.quoted" ) ; } } else { if ( ! isDelimiter ( ) ) { do { ch = nextChar ( ) ; if ( ch == '\\' ) { if ( peekChar ( ) == '"' || peekChar ( ) == '\'' || peekChar ( ) == '>' || peekChar ( ) == '%' ) ch = nextChar ( ) ; } stringBuffer . append ( ( char ) ch ) ; } while ( ! isDelimiter ( ) ) ; } } return stringBuffer . toString ( ) ; }
target:  Parse a space delimited token. If quoted the token will consume all characters up to a matching quote, otherwise, it consumes up to the first delimiter character.