private Token token ( Token prev ) { if ( curChar == EOF ) { return null ; } if ( curChar == ' ' ) { char nextChar = lookahead ( ) ; if ( nextChar == ' ' ) { return leftCurlyBracket ( prev ) ; } else if ( nextChar >= ' ' && nextChar <= ' ' ) { return key ( prev ) ; } else { throw new IllegalArgumentException ( "Unexpected first character '" + nextChar + "'; must be lower case a-z." ) ; } } return text ( prev ) ; }
Returns the next token from the input pattern or null when finished parsing .