/** * This function puts last n symbols back */ protected final void backup(int n, int lastChar) { if (lastChar == '\t') { if (lineColomn == 6) { lineColomn = n; } } lineColomn -= n; input.backup(n); }
private void ungetCharIgnoreLineEnd(int c) { // <netbeans> if (lexerInput != null) { lexerInput.backup(1); return; } // </netbeans> ungetBuffer[ungetCursor++] = c; }
protected final void backup(int n) { input.backup(n + escapedEatenChars); lastTokenEndedByEscapedLine = escapedEatenChars; tokenSplittedByEscapedLine -= escapedEatenChars; }
private void backup(int count) { input.backup(count); } }
public void backup(int howMany) { switch (howMany) { case 1: assert currentLength != (-1); input.backup(currentLength); currentLength = previousLength; previousLength = (-1); break; case 2: assert currentLength != (-1) && previousLength != (-1); input.backup(currentLength + previousLength); currentLength = previousLength = (-1); break; default: assert false : howMany; } }
public void setIndex (int index) { while (this.index < index) read (); input.backup (this.index - index); this.index = index; }
public char next () { char ch = (char) input.read (); input.backup (1); return ch; }
private void ungetChar(int c) { // <netbeans> if (lexerInput != null) { lexerInput.backup(1); return; } // </netbeans> // can not unread past across line boundary // <netbeans> // For the XML processing use of ungetChar we need this -- see for example issue 131832 if (!skipUngetCheck) // </netbeans> if (ungetCursor != 0 && ungetBuffer[ungetCursor - 1] == '\n') Kit.codeBug(); ungetBuffer[ungetCursor++] = c; }
private boolean followsScriptletExpressionDelimiter(int actChar) { if(actChar == '<') { int next = input.read(); if(next == '%') { next = input.read(); if(next == '=') { //yes, it follows return true; } else { input.backup(2); //backup %+next } } else { input.backup(1); //backup next } } return false; }
/** * Pushes the specified amount of characters back into the input stream. * * They will be read again by then next call of the scanning method * * @param number the number of characters to be read again. * This number must not be greater than yylength()! */ public void yypushback(int number) { if ( number > yylength() ) zzScanError(ZZ_PUSHBACK_2BIG); input.backup(number); //zzMarkedPos -= number; }
/** * Pushes the specified amount of characters back into the input stream. * * They will be read again by then next call of the scanning method * * @param number the number of characters to be read again. * This number must not be greater than yylength()! */ public void yypushback(int number) { if ( number > yylength() ) zzScanError(ZZ_PUSHBACK_2BIG); input.backup(number); //zzMarkedPos -= number; }
/** * Pushes the specified amount of characters back into the input stream. * <p> * They will be read again by then next call of the scanning method * * @param number the number of characters to be read again. This number must not be greater than yylength()! */ public void yypushback(int number) { if (number > yylength()) { zzScanError(ZZ_PUSHBACK_2BIG); } input.backup(number); //zzMarkedPos -= number; }
private CharSequence getPossibleTagName() { int actChar; int prev_read = input.readLength(); //remember the size of the read sequence int read = 0; while(true) { actChar = input.read(); read++; if(!(Character.isLetter(actChar) || Character.isDigit(actChar) || (actChar == '_') || (actChar == '-') || (actChar == ':') || (actChar == '.') || (actChar == '/')) || (actChar == EOF)) { // EOL or not alpha //end of tagname CharSequence tagName = input.readText().subSequence(prev_read, prev_read + read - 1); input.backup(read); //put the lookahead text back to the buffer return tagName; } } }
case '\r': case '\n': input.backup(1); return PartType.START; case EOF:
@SuppressWarnings("fallthrough") protected final int read() { boolean skipEscapedLF = true; int c = input.read(); if (skipEscapedLF) { // skip escaped LF int next; while (c == '\\') { switch (input.read()) { case '\r': input.consumeNewline(); // nobreak case '\n': escapedLF = true; next = input.read(); break; default: input.backup(1); assert c == '\\' : "must be backslash " + (char)c; return c; // normal backslash, not escaped LF } c = next; } } return c; }
break; default: input.backup(1); escapedEatenChars--; assert c == '\\' : "must be backslash " + (char)c;
input.backup(1); return token(DoxygenTokenId.IDENT); input.backup(1); first = false; if ((wasFirst && !CndLexerUtilities.isCppIdentifierStart(ch)) || (!CndLexerUtilities.isCppIdentifierPart(ch))) { input.backup(1); if (input.readLength() > 1) { return tokenFactory.createToken(DoxygenTokenId.TAG, input.readLength());
input.backup(input.readLength() - tokenLength);