private boolean is ( final TokenType mType , final boolean mIgnoreWhitespace ) { if ( mType != mToken . getType ( ) ) { return false ; } do { // scan next token mToken = mScanner . nextToken ( ) ; } while ( mIgnoreWhitespace && mToken . getType ( ) == TokenType . SPACE ) ; return true ; }
Returns true or false if a token has the expected type . If so a new token is retrieved from the scanner . If that new token is of type whitespace and the ignoreWhitespace parameter is true a new token is retrieved until the current token is not of type whitespace .