public void execute(Lexer lexer, CharStream input, int startIndex) {boolean requiresSeek = false;int stopIndex = input.index();try {for (LexerAction lexerAction : lexerActions) {if (lexerAction instanceof LexerIndexedCustomAction) {int offset = ((LexerIndexedCustomAction)lexerAction).getOffset();input.seek(startIndex + offset);lexerAction = ((LexerIndexedCustomAction)lexerAction).getAction();requiresSeek = (startIndex + offset) != stopIndex;}else if (lexerAction.isPositionDependent()) {input.seek(stopIndex);requiresSeek = false;}lexerAction.execute(lexer);}}finally {if (requiresSeek) {input.seek(stopIndex);}}}

public void execute ( Lexer lexer , CharStream input , int startIndex ) { boolean requiresSeek = false ; int stopIndex = input . index ( ) ; try { for ( LexerAction lexerAction : lexerActions ) { if ( lexerAction instanceof LexerIndexedCustomAction ) { int offset = ( ( LexerIndexedCustomAction ) lexerAction ) . getOffset ( ) ; input . seek ( startIndex + offset ) ; lexerAction = ( ( LexerIndexedCustomAction ) lexerAction ) . getAction ( ) ; requiresSeek = ( startIndex + offset ) != stopIndex ; } else if ( lexerAction . isPositionDependent ( ) ) { input . seek ( stopIndex ) ; requiresSeek = false ; } lexerAction . execute ( lexer ) ; } } finally { if ( requiresSeek ) { input . seek ( stopIndex ) ; } } }
public virtual void Execute(Lexer lexer, ICharStream input, int startIndex){bool requiresSeek = false;int stopIndex = input.Index;try{foreach (ILexerAction lexerAction in lexerActions){ILexerAction action = lexerAction;if (action is LexerIndexedCustomAction){int offset = ((LexerIndexedCustomAction)action).Offset;input.Seek(startIndex + offset);action = ((LexerIndexedCustomAction)action).Action;requiresSeek = (startIndex + offset) != stopIndex;}else{if (action.IsPositionDependent){input.Seek(stopIndex);requiresSeek = false;}}action.Execute(lexer);}}finally{if (requiresSeek){input.Seek(stopIndex);}}}
