public void consumeUntil ( Parser recognizer , IntervalSet follow , CSSLexerState . RecoveryMode mode , CSSLexerState ls ) { CSSToken t ; boolean finish ; TokenStream input = recognizer . getInputStream ( ) ; do { Token next = input . LT ( 1 ) ; if ( next instanceof CSSToken ) { t = ( CSSToken ) input . LT ( 1 ) ; if ( t . getType ( ) == Token . EOF ) { logger . trace ( "token eof " ) ; break ; } } else break ; /* not a CSSToken, probably EOF */ // consume token if does not match finish = ( t . getLexerState ( ) . isBalanced ( mode , ls , t ) && follow . contains ( t . getType ( ) ) ) ; if ( ! finish ) { logger . trace ( "Skipped: {}" , t ) ; input . consume ( ) ; } } while ( ! finish ) ; }
Consumes token until lexer state is function - balanced and token from follow is matched .