private boolean lookAheadFor ( char expect ) { boolean matched = false ; int c ; while ( true ) { c = stream . getChar ( ) ; if ( c == ' ' ) { continue ; } else if ( c == expect ) { matched = true ; break ; } else { break ; } } stream . ungetChar ( c ) ; return matched ; }
Look ahead by advancing the character stream . Does not modify the token stream .