protected void consumeUntilGreedy ( Parser recognizer , IntervalSet follow ) { logger . trace ( "CONSUME UNTIL GREEDY {}" , follow . toString ( ) ) ; for ( int ttype = recognizer . getInputStream ( ) . LA ( 1 ) ; ttype != - 1 && ! follow . contains ( ttype ) ; ttype = recognizer . getInputStream ( ) . LA ( 1 ) ) { Token t = recognizer . consume ( ) ; logger . trace ( "Skipped greedy: {}" , t . getText ( ) ) ; } Token t = recognizer . consume ( ) ; logger . trace ( "Skipped greedy: {} follow: {}" , t . getText ( ) , follow ) ; }
Consumes token until lexer state is balanced and token from follow is matched . Matched token is also consumed