@Override public void seek(int index) { stream.seek(index); }
@Override public void seek(final int index) { stream.seek(index); }
@Override public void seek(int index) { stream.seek(index); }
private boolean match(String delimiter) { for (int i = 0; i < delimiter.length(); i++) { if (_input.LA(i + 1) != delimiter.charAt(i)) { return false; } } _input.seek(_input.index() + delimiter.length()); return true; } }
public void skipCurrentTokenConsuming() { _input.seek(_input.index() - 1); }
protected void resetAcceptPosition(CharStream input, int index, int line, int charPositionInLine) { input.seek(index); this.line = line; this.charPositionInLine = charPositionInLine; consume(input); } }
protected void accept(CharStream input, LexerActionExecutor lexerActionExecutor, int startIndex, int index, int line, int charPos) { if ( debug ) { System.out.format(Locale.getDefault(), "ACTION %s\n", lexerActionExecutor); } // seek to after last char in token input.seek(index); this.line = line; this.charPositionInLine = charPos; if (lexerActionExecutor != null && recog != null) { lexerActionExecutor.execute(recog, input, startIndex); } }
if (lexerAction instanceof LexerIndexedCustomAction) { int offset = ((LexerIndexedCustomAction)lexerAction).getOffset(); input.seek(startIndex + offset); lexerAction = ((LexerIndexedCustomAction)lexerAction).getAction(); requiresSeek = (startIndex + offset) != stopIndex; input.seek(stopIndex); requiresSeek = false; input.seek(stopIndex);
public void reset() { // wack Lexer state variables if ( _input !=null ) { _input.seek(0); // rewind the input } _token = null; _type = Token.INVALID_TYPE; _channel = Token.DEFAULT_CHANNEL; _tokenStartCharIndex = -1; _tokenStartCharPositionInLine = -1; _tokenStartLine = -1; _text = null; _hitEOF = false; _mode = Lexer.DEFAULT_MODE; _modeStack.clear(); getInterpreter().reset(); }
@Override public void seek(int index) { stream.seek(index); }
@Override public void seek(int index) { stream.seek(index); }
@Override public void seek(int index) { stream.seek(index); }
@Override public void seek(int index) { stream.seek(index); }
charPositionInLine = savedCharPositionInLine; line = savedLine; input.seek(index); input.release(marker);
private void rewind(CharStream inputTape, int offset) { if (offset < 0) { throw new IllegalArgumentException(String.format("Offset should be positive. Got %d", offset)); } else if (offset == 0) { } else { int rewindIndex = inputTape.index() - offset; inputTape.seek(rewindIndex); } }
private void rewind(CharStream inputTape, int offset) { if (offset < 0) { throw new IllegalArgumentException(String.format("Offset should be positive. Got %d", offset)); } else if (offset == 0) { } else { int rewindIndex = inputTape.index() - offset; inputTape.seek(rewindIndex); } }
private boolean match(String delimiter) { for (int i = 0; i < delimiter.length(); i++) { if (_input.LA(i + 1) != delimiter.charAt(i)) { return false; } } _input.seek(_input.index() + delimiter.length()); return true; } }
private boolean match(String delimiter) { for (int i = 0; i < delimiter.length(); i++) { if (_input.LA(i + 1) != delimiter.charAt(i)) { return false; } } _input.seek(_input.index() + delimiter.length()); return true; } }
private boolean match(String delimiter) { for (int i = 0; i < delimiter.length(); i++) { if (_input.LA(i + 1) != delimiter.charAt(i)) { return false; } } _input.seek(_input.index() + delimiter.length()); return true; } }
private boolean match(String delimiter) { for (int i = 0; i < delimiter.length(); i++) { if (_input.LA(i + 1) != delimiter.charAt(i)) { return false; } } _input.seek(_input.index() + delimiter.length()); return true; } }