/// <summary>Get the next Token.</summary> public Token GetNextToken() { Token matchedToken; int curPos = 0; for (;;) { try { curChar = input_stream.BeginToken(); } catch (System.IO.IOException) { jjmatchedKind = 0; matchedToken = JjFillToken(); return(matchedToken); } switch (curLexState) { case 0: jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = JjMoveStringLiteralDfa0_0(); break; case 1: jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = JjMoveStringLiteralDfa0_1(); break; } if (jjmatchedKind != 0x7fffffff) { if (jjmatchedPos + 1 < curPos) { input_stream.Backup(curPos - jjmatchedPos - 1); } matchedToken = JjFillToken(); if (jjnewLexState[jjmatchedKind] != -1) { curLexState = jjnewLexState[jjmatchedKind]; } return(matchedToken); } int error_line = input_stream.GetEndLine(); int error_column = input_stream.GetEndColumn(); string error_after = null; bool EOFSeen = false; try { input_stream.ReadChar(); input_stream.Backup(1); } catch (System.IO.IOException) { EOFSeen = true; error_after = curPos <= 1 ? "" : input_stream.GetImage(); if (curChar == '\n' || curChar == '\r') { error_line++; error_column = 0; } else { error_column++; } } if (!EOFSeen) { input_stream.Backup(1); error_after = curPos <= 1 ? "" : input_stream.GetImage(); } throw new TokenManagerException(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenManagerException.ErrorCodes.LexicalError); } }
public Token GetNextToken() { int kind; Token specialToken = null; Token matchedToken; int curPos = 0; for (;;) { try { curChar = input_stream.BeginToken(); } catch (System.IO.IOException) { mccmatchedKind = 0; matchedToken = mccFillToken(); return(matchedToken); } mccmatchedKind = Int32.MaxValue; mccmatchedPos = 0; curPos = mccMoveStringLiteralDfa0_0(); if (mccmatchedKind != Int32.MaxValue) { if (mccmatchedPos + 1 < curPos) { input_stream.Backup(curPos - mccmatchedPos - 1); } if ((mcctoToken[mccmatchedKind >> 6] & (1L << (mccmatchedKind & 63))) != 0L) { matchedToken = mccFillToken(); return(matchedToken); } else { goto EOFLoop; } } int error_line = input_stream.EndLine; int error_column = input_stream.EndColumn; string error_after = null; bool EOFSeen = false; try { input_stream.ReadChar(); input_stream.Backup(1); } catch (System.IO.IOException) { EOFSeen = true; error_after = curPos <= 1 ? "" : input_stream.GetImage(); if (curChar == '\n' || curChar == '\r') { error_line++; error_column = 0; } else { error_column++; } } if (!EOFSeen) { input_stream.Backup(1); error_after = curPos <= 1 ? "" : input_stream.GetImage(); } throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LexicalError); EOFLoop :; } }