protected void AdjustBuffSize() { if (available == bufsize) { if (tokenBegin > 2048) { bufpos = 0; available = tokenBegin; } else ExpandBuff(false); } else if (available > tokenBegin) available = bufsize; else if ((tokenBegin - available) < 2048) ExpandBuff(true); else available = tokenBegin; }
protected char ReadByte() throws java.io.IOException { if (++nextCharInd >= maxNextCharInd) FillBuff(); return nextCharBuf[nextCharInd]; }
protected Token jjFillToken() { Token t = Token.newToken(jjmatchedKind); t.kind = jjmatchedKind; String im = jjstrLiteralImages[jjmatchedKind]; t.image = (im == null) ? input_stream.GetImage() : im; t.beginLine = input_stream.getBeginLine(); t.beginColumn = input_stream.getBeginColumn(); t.endLine = input_stream.getEndLine(); t.endColumn = input_stream.getEndColumn(); return t; }
/** Explicitly re-initialize just the token reader. This seems to be necessary to avoid certain looping errors when reading bogus input. See Interpreter. */ void reInitTokenInput( Reader in ) { jj_input_stream.ReInit( in, jj_input_stream.getEndLine(), jj_input_stream.getEndColumn() ); }
curChar = input_stream.BeginToken(); input_stream.backup(curPos - jjmatchedPos - 1); if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) int error_line = input_stream.getEndLine(); int error_column = input_stream.getEndColumn(); String error_after = null; boolean EOFSeen = false; try { input_stream.readChar(); input_stream.backup(1); } catch (java.io.IOException e1) { EOFSeen = true; error_after = curPos <= 1 ? "" : input_stream.GetImage(); if (curChar == '\n' || curChar == '\r') { error_line++; input_stream.backup(1); error_after = curPos <= 1 ? "" : input_stream.GetImage();
AdjustBuffSize(); if ((buffer[bufpos] = c = ReadByte()) == '\\') UpdateLineColumn(c); AdjustBuffSize(); if ((buffer[bufpos] = c = ReadByte()) != '\\') UpdateLineColumn(c); backup(backSlashCnt); return '\\'; backup(backSlashCnt-1); UpdateLineColumn(c); backSlashCnt++; while ((c = ReadByte()) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval(ReadByte()) << 8 | hexval(ReadByte()) << 4 | hexval(ReadByte())); backup(backSlashCnt - 1);
/** Reinitialise. */ public void ReInit(java.io.Reader dstream) { ReInit(dstream, 1, 1, 4096); } /** Constructor. */
/** Reinitialise. */ public void ReInit(java.io.Reader stream) { if (jj_input_stream == null) { jj_input_stream = new JavaCharStream(stream, 1, 1); } else { jj_input_stream.ReInit(stream, 1, 1); } if (token_source == null) { token_source = new ParserTokenManager(jj_input_stream); } token_source.ReInit(jj_input_stream); token = new Token(); jj_ntk = -1; jj_gen = 0; for (int i = 0; i < 99; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); }
/** Constructor with InputStream and supplied encoding */ public Parser(java.io.InputStream stream, String encoding) { try { jj_input_stream = new JavaCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } token_source = new ParserTokenManager(jj_input_stream); token = new Token(); jj_ntk = -1; }
protected void FillBuff() throws java.io.IOException { int i; if (maxNextCharInd == 4096) maxNextCharInd = nextCharInd = 0; try { if ((i = inputStream.read(nextCharBuf, maxNextCharInd, 4096 - maxNextCharInd)) == -1) { inputStream.close(); throw new java.io.IOException(); } else maxNextCharInd += i; return; } catch(java.io.IOException e) { if (bufpos != 0) { --bufpos; backup(0); } else { bufline[bufpos] = line; bufcolumn[bufpos] = column; } throw e; } }
curChar = input_stream.BeginToken(); input_stream.backup(curPos - jjmatchedPos - 1); if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) int error_line = input_stream.getEndLine(); int error_column = input_stream.getEndColumn(); String error_after = null; boolean EOFSeen = false; try { input_stream.readChar(); input_stream.backup(1); } catch (final java.io.IOException e1) { EOFSeen = true; error_after = curPos <= 1 ? "" : input_stream.GetImage(); if (curChar == '\n' || curChar == '\r') { error_line++; input_stream.backup(1); error_after = curPos <= 1 ? "" : input_stream.GetImage();
AdjustBuffSize(); if ((buffer[bufpos] = c = ReadByte()) == '\\') if (trackLineColumn) { UpdateLineColumn(c); } AdjustBuffSize(); if ((buffer[bufpos] = c = ReadByte()) != '\\') if (trackLineColumn) { UpdateLineColumn(c); } backup(backSlashCnt); return '\\'; backup(backSlashCnt-1); if (trackLineColumn) { UpdateLineColumn(c); } backSlashCnt++; while ((c = ReadByte()) == 'u') ++column; buffer[bufpos] = c = (char)(hexval(c) << 12 | hexval(ReadByte()) << 8 | hexval(ReadByte()) << 4 | hexval(ReadByte())); backup(backSlashCnt - 1);
/** Reinitialise. */ public void ReInit(java.io.InputStream dstream, int startline, int startcolumn) { ReInit(dstream, startline, startcolumn, 4096); } /** Reinitialise. */
/** Explicitly re-initialize just the token reader. This seems to be necessary to avoid certain looping errors when reading bogus input. See Interpreter. */ void reInitTokenInput( Reader in ) { jj_input_stream.ReInit( in, jj_input_stream.getEndLine(), jj_input_stream.getEndColumn() ); }
/** Constructor. */ public Parser(java.io.Reader stream) { jj_input_stream = new JavaCharStream(stream, 1, 1); token_source = new ParserTokenManager(jj_input_stream); token = new Token(); jj_ntk = -1; }
protected void FillBuff() throws java.io.IOException { int i; if (maxNextCharInd == 4096) maxNextCharInd = nextCharInd = 0; try { if ((i = inputStream.read(nextCharBuf, maxNextCharInd, 4096 - maxNextCharInd)) == -1) { inputStream.close(); throw new java.io.IOException(); } else maxNextCharInd += i; return; } catch(java.io.IOException e) { if (bufpos != 0) { --bufpos; backup(0); } else { bufline[bufpos] = line; bufcolumn[bufpos] = column; } throw e; } }
protected Token jjFillToken() { final Token t; final String curTokenImage; final int beginLine; final int endLine; final int beginColumn; final int endColumn; String im = jjstrLiteralImages[jjmatchedKind]; curTokenImage = (im == null) ? input_stream.GetImage() : im; beginLine = input_stream.getBeginLine(); beginColumn = input_stream.getBeginColumn(); endLine = input_stream.getEndLine(); endColumn = input_stream.getEndColumn(); t = Token.newToken(jjmatchedKind); t.kind = jjmatchedKind; t.image = curTokenImage; t.beginLine = beginLine; t.endLine = endLine; t.beginColumn = beginColumn; t.endColumn = endColumn; return t; } static final int[] jjnextStates = {
/** Reinitialise. */ public void ReInit(java.io.Reader dstream, int startline, int startcolumn) { ReInit(dstream, startline, startcolumn, 4096); }
/** Constructor with InputStream and supplied encoding */ public Parser(final java.io.InputStream stream, final String encoding) { try { jj_input_stream = new JavaCharStream(stream, encoding, 1, 1); } catch(final java.io.UnsupportedEncodingException e) { throw new IllegalStateException(e); } token_source = new ParserTokenManager(jj_input_stream); token = new Token(); jj_ntk = -1; jj_gen = 0; for (int i = 0; i < 99; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); }
protected char ReadByte() throws java.io.IOException { if (++nextCharInd >= maxNextCharInd) FillBuff(); return nextCharBuf[nextCharInd]; }