public void SetLocation(QUT.Gppg.LexLocation loc) { if (loc != null) { line = loc.StartLine; column = loc.StartColumn; } }
void SetCursor(string filename, QUT.Gppg.LexLocation location) { //tbEditor.Focus(); //doesn't work after replacing listbox with treeview; //Костыль: посылаю сигнал о нажатии кнопки Tab и за счет свойств TabIndex и TabStop переходим на TextBox SendKeys.Send("{TAB}"); if (location.StartLine < 1) { return; } int sl = location.StartLine < 0 ? 0 : location.StartLine; int sc = location.StartColumn < 0 ? 0 : location.StartColumn; int el = location.EndLine < 0 ? 0 : location.EndLine; int ec = location.EndColumn < 0 ? 0 : location.EndColumn; int start; if (el <= tbEditor.Lines.Length) { start = tbEditor.GetFirstCharIndexFromLine(sl - 1) + sc; } else { start = tbEditor.Text.Length; } int end; if (el <= tbEditor.Lines.Length) { end = tbEditor.GetFirstCharIndexFromLine(el - 1) + ec; } else { end = tbEditor.Text.Length; } if (start > tbEditor.Text.Length) { tbEditor.SelectionStart = tbEditor.Text.Length; } else { tbEditor.SelectionStart = start; } if (end - start < 0) { tbEditor.SelectionLength = 0; } else { tbEditor.SelectionLength = end - start; } tbEditor.ScrollToCaret(); }
private void lbCandidates_SelectedIndexChanged(object sender, EventArgs e) { PointOfInterest currentPoint = _search[lbCandidates.SelectedIndex]; currentPoint.Text = _point.Text; int line = currentPoint.Location.StartLine; int col = currentPoint.Location.StartColumn; if (_point.Text != "") { QUT.Gppg.LexLocation Loc = TreeSearchEngine.FindTextPosition(currentPoint, _treeManager.GetText(currentPoint.FileName)); line = Loc.StartLine; col = Loc.StartColumn; } _ide.NavigateToFileAndPosition(currentPoint.FileName, line, 0); }
internal void ResetYYLLoc() { yylloc = new QUT.Gppg.LexLocation(1,0,1,0); }
// ============== The main tokenizer code ================= int Scan() { try { for (; ; ) { int next; // next state to enter #if LEFTANCHORS for (;;) { // Discard characters that do not start any pattern. // Must check the left anchor condition after *every* GetCode! state = ((cCol == 0) ? anchorState[currentScOrd] : currentStart); if ((next = NextState()) != goStart) break; // LOOP EXIT HERE... GetCode(); } #else // !LEFTANCHORS state = currentStart; while ((next = NextState()) == goStart) { // At this point, the current character has no // transition from the current state. We discard // the "no-match" char. In traditional LEX such // characters are echoed to the console. GetCode(); } #endif // LEFTANCHORS // At last, a valid transition ... MarkToken(); state = next; GetCode(); #if BACKUP bool contextSaved = false; while ((next = NextState()) > eofNum) { // Exit for goStart AND for eofNum if (state <= maxAccept && next > maxAccept) { // need to prepare backup data // Store data for the *latest* accept state that was found. SaveStateAndPos( ref ctx ); contextSaved = true; } state = next; GetCode(); } if (state > maxAccept && contextSaved) RestoreStateAndPos( ref ctx ); #else // BACKUP while ((next = NextState()) > eofNum) { // Exit for goStart AND for eofNum state = next; GetCode(); } #endif // BACKUP if (state <= maxAccept) { MarkEnd(); #region ActionSwitch #pragma warning disable 162, 1522 switch (state) { case eofNum: if (yywrap()) return (int)Tokens.EOF; break; case 1: case 2: case 10: case 11: case 12: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.Sign; break; case 3: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkLT; break; case 4: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkGT; break; case 5: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkPC; break; case 6: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkBOpen; break; case 7: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkBClose; break; case 8: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.ID; break; case 9: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.NL; break; case 13: case 14: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.RegexItem; break; case 15: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkPC2; break; case 16: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkPCX; break; case 17: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkPCS; break; case 18: GoToSkipState(Anon2); break; case 19: GoToSkipState(Anon1); break; case 20: GoToSkipState(Anon2); break; case 21: GoToSkipState(Anon1); break; case 22: ReturnToLastState(); break; case 23: ReturnToLastState(); break; default: break; } #pragma warning restore 162, 1522 #endregion } } } // end try finally { // User-specified epilog to scan() yylloc = new QUT.Gppg.LexLocation(tokLin+LineAdd, tokCol, tokELin+LineAdd, tokECol); yylval.type_Token.Location = yylloc; // End, user-specified epilog } // end finally }
public void SetLocation(QUT.Gppg.LexLocation loc) { this.line = loc.StartLine; this.column = loc.StartColumn + 1; }
// ============== The main tokenizer code ================= int Scan() { try { for (; ; ) { int next; // next state to enter #if BACKUP Result rslt = Result.noMatch; #endif // BACKUP #if LEFTANCHORS for (;;) { // Discard characters that do not start any pattern. // Must check the left anchor condition after *every* GetCode! state = ((cCol == 0) ? anchorState[currentScOrd] : currentStart); if ((next = NextState()) != goStart) break; // LOOP EXIT HERE... GetCode(); } #else // !LEFTANCHORS state = currentStart; while ((next = NextState()) == goStart) // At this point, the current character has no // transition from the current state. We discard // the "no-match" char. In traditional LEX such // characters are echoed to the console. GetCode(); #endif // LEFTANCHORS // At last, a valid transition ... MarkToken(); state = next; GetCode(); while ((next = NextState()) > eofNum) // Exit for goStart AND for eofNum #if BACKUP if (state <= maxAccept && next > maxAccept) // need to prepare backup data { // ctx is an object. The fields may be // mutated by the call to Recurse2. // On return the data in ctx is the // *latest* accept state that was found. rslt = Recurse2(ref ctx, next); if (rslt == Result.noMatch) RestoreStateAndPos(ref ctx); break; } else #endif // BACKUP { state = next; GetCode(); } if (state <= maxAccept) { MarkEnd(); #region ActionSwitch #pragma warning disable 162 switch (state) { case eofNum: switch (currentStart) { case 50: PT.AddError("Комментарий не закрыт", yylloc); break; } if (yywrap()) return (int)Tokens.EOF; break; case 1: return (int)Tokens.COLON; break; case 2: return (int)Tokens.EQ; break; case 3: return (int)Tokens.SEMICOLUMN; break; case 4: return (int)Tokens.MINUS; break; case 5: return (int)Tokens.PLUS; break; case 6: return (int)Tokens.MULT; break; case 7: return (int)Tokens.DIVIDE; break; case 8: return (int)Tokens.LT; break; case 9: return (int)Tokens.GT; break; case 10: return (int)Tokens.NE; break; case 11: return (int)Tokens.LPAREN; break; case 12: return (int)Tokens.RPAREN; break; case 13: return (int)Tokens.COLUMN; break; case 14: return (int)Tokens.NOT; break; case 15: return (int)Tokens.AND; break; case 16: return (int)Tokens.COMMA; break; case 17: return (int)Tokens.EXCLAMATION; break; case 18: return (int)Tokens.LBRACE; break; case 19: return (int)Tokens.RBRACE; break; case 20: return (int)Tokens.LBRACKET; break; case 21: return (int)Tokens.RBRACKET; break; case 22: return (int)Tokens.PIPE; break; case 23: return (int)Tokens.INVISIBLE; break; case 24: int res = Keywords.KeywordOrIDToken(yytext); if (res == (int)Tokens.ID){ yylval.sVal = yytext; PT.LastIdentificator = yytext; } return res; break; case 25: int tryParseInt; if (int.TryParse(yytext, out tryParseInt)){ yylval.iVal = tryParseInt; return (int)Tokens.INTNUM; } System.Int64 tryParseLong; if (System.Int64.TryParse(yytext, out tryParseLong)){ yylval.lVal = tryParseLong; return (int)Tokens.LONGINTNUM; } PT.AddError("Слишком длинное целое", yylloc); break; case 26: yylval.sVal = PT.GetStringContent(yytext); return (int)Tokens.STRING_CONST; break; case 27: try{ yylval.cVal = PT.GetStringContent(yytext)[0]; return (int)Tokens.CHAR_CONST; } catch (System.ArgumentException){ PT.AddError("Некорректный код символа", yylloc); } break; case 28: case 30: double tryParseDouble; var correctDouble = PT.GetCorrectDoubleStr(yytext); if (double.TryParse(correctDouble, out tryParseDouble)){ yylval.rVal = tryParseDouble; return (int)Tokens.REALNUM; } PT.AddError("Слишком длинное вещественное", yylloc); break; case 29: var _yytext = yytext.Substring(0, yytext.Length - 1); int tryParseHexInt; if (int.TryParse(_yytext, System.Globalization.NumberStyles.AllowHexSpecifier, null, out tryParseHexInt)){ yylval.iVal = tryParseHexInt; return (int)Tokens.INTNUM; } System.Int64 tryParseHexLong; if (System.Int64.TryParse(_yytext, System.Globalization.NumberStyles.AllowHexSpecifier, null, out tryParseHexLong)){ yylval.lVal = tryParseHexLong; return (int)Tokens.LONGINTNUM; } PT.AddError("Слишком длинное шестнадцатеричное целое", yylloc); break; case 31: return (int)Tokens.DOUBLEPOINT; break; case 32: BEGIN(COMMENT); mlCommentCnt = 1; break; case 33: return (int)Tokens.GE; break; case 34: return (int)Tokens.LE; break; case 35: BEGIN(COMMENT_S); break; case 36: return (int)Tokens.ASSIGN; break; case 37: ++mlCommentCnt; break; case 38: --mlCommentCnt; if (mlCommentCnt == 0) BEGIN(INITIAL); break; case 39: BEGIN(INITIAL); break; default: break; } #pragma warning restore 162 #endregion } } } // end try finally { // User-specified epilog to scan() yylloc = new QUT.Gppg.LexLocation(tokLin, tokCol, tokELin, tokECol); // End, user-specified epilog } // end finally }
// ============== The main tokenizer code ================= int Scan() { // User-specified prolog to scan() string unformattedText = ""; int spaces = 0; int nls = 0; int tbl = 0; // End, user-specified prolog try { for (; ; ) { int next; // next state to enter #if BACKUP Result rslt = Result.noMatch; #endif // BACKUP #if LEFTANCHORS for (;;) { // Discard characters that do not start any pattern. // Must check the left anchor condition after *every* GetCode! state = ((cCol == 0) ? anchorState[currentScOrd] : currentStart); if ((next = NextState()) != goStart) break; // LOOP EXIT HERE... GetCode(); } #else // !LEFTANCHORS state = currentStart; while ((next = NextState()) == goStart) // At this point, the current character has no // transition from the current state. We discard // the "no-match" char. In traditional LEX such // characters are echoed to the console. GetCode(); #endif // LEFTANCHORS // At last, a valid transition ... MarkToken(); state = next; GetCode(); while ((next = NextState()) > eofNum) // Exit for goStart AND for eofNum #if BACKUP if (state <= maxAccept && next > maxAccept) // need to prepare backup data { // ctx is an object. The fields may be // mutated by the call to Recurse2. // On return the data in ctx is the // *latest* accept state that was found. rslt = Recurse2(ref ctx, next); if (rslt == Result.noMatch) RestoreStateAndPos(ref ctx); break; } else #endif // BACKUP { state = next; GetCode(); } if (state <= maxAccept) { MarkEnd(); #region ActionSwitch #pragma warning disable 162 switch (state) { case eofNum: switch (currentStart) { case 436: case 612: /* to process, or not to process? */ break; } if (yywrap()) return (int)Tokens.EOF; break; case 1: // Recognized '[^#\$%\^&_\{\}\\[:IsWhiteSpace:]]', Shortest string "d" BEGIN(str); yyless(0); unformattedText = ""; spaces = 0; nls = 0; break; case 2: // Recognized '^{wsp}', Shortest string "^\t" /*ignore*/ break; case 3: // Recognized '\{', Shortest string "{" return '{'; break; case 4: // Recognized '\}', Shortest string "}" return '}'; break; case 5: // Recognized '\$', Shortest string "$" BEGIN(math); unformattedText = "$"; spaces = 0; nls = 0; break; case 6: // Recognized '%.*\r?\n?{ws}', Shortest string "%" case 8: // Recognized '%.*\r?\n?{ws}', Shortest string "%\n" /*ignore*/ break; case 7: // Recognized '&', Shortest string "&" return '&'; break; case 9: // Recognized '\\\\|\\cr', Shortest string "\\\\" case 346: // Recognized '\\\\|\\cr', Shortest string "\\cr" BEGIN(pre_optional); if(tabular) return (int) Tokens.ENDROW; else return (int) Tokens.NL; break; case 10: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\d" case 11: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\o" case 12: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\c" case 13: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\u" case 14: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\m" case 15: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\e" case 16: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\n" case 17: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\t" case 18: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\l" case 19: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\a" case 20: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\s" case 21: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\p" case 22: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\g" case 23: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\i" case 24: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\h" case 25: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\b" case 28: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\f" case 30: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\L" case 31: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\H" case 37: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\v" case 38: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\ve" case 39: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\ver" case 40: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\verb" case 44: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\Hu" case 45: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\Hug" case 48: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\La" case 49: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\LA" case 50: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\LAR" case 51: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\LARG" case 54: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\Lar" case 55: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\LaT" case 56: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\LaTe" case 59: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\Larg" case 62: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\fo" case 63: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\fr" case 64: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\fra" case 65: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\fram" case 67: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\framet" case 68: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\frames" case 69: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\framesu" case 70: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\framesub" case 71: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\framesubt" case 72: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\framesubti" case 73: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\framesubtit" case 74: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\framesubtitl" case 76: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\frameti" case 77: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\frametit" case 78: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\frametitl" case 80: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\foo" case 81: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\foot" case 82: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\footn" case 83: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\footno" case 84: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\footnot" case 85: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\footnote" case 86: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\footnotes" case 87: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\footnotesi" case 88: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\footnotesiz" case 91: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\be" case 92: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\bf" case 93: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\bfs" case 94: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\bfse" case 95: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\bfser" case 96: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\bfseri" case 97: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\bfserie" case 100: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\beg" case 101: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\begi" case 102: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\begin" case 112: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\hu" case 113: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\hl" case 114: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\hli" case 115: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\hlin" case 117: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\hug" case 120: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\in" case 121: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\it" case 122: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\ite" case 123: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\its" case 124: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\itsh" case 125: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\itsha" case 126: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\itshap" case 130: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\inc" case 131: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\ins" case 132: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\inst" case 133: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\insti" case 134: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\instit" case 135: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\institu" case 136: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\institut" case 138: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\incl" case 139: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\inclu" case 140: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\includ" case 141: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\include" case 142: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\includeg" case 143: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\includegr" case 144: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\includegra" case 145: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\includegrap" case 146: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\includegraph" case 147: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\includegraphi" case 148: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\includegraphic" case 150: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\gr" case 151: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\gra" case 152: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\grap" case 153: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\graph" case 154: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\graphi" case 155: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\graphic" case 156: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\graphics" case 157: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\graphicsp" case 158: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\graphicspa" case 159: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\graphicspat" case 161: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\pa" case 162: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\pau" case 163: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\paus" case 165: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\sc" case 166: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\su" case 167: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\sm" case 168: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\se" case 169: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\sec" case 170: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\sect" case 171: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\secti" case 172: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\sectio" case 174: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\sma" case 175: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\smal" case 178: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\sub" case 179: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\subs" case 180: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\subsu" case 181: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\subse" case 182: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\subsec" case 183: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\subsect" case 184: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\subsecti" case 185: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\subsectio" case 187: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\subsub" case 188: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\subsubs" case 189: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\subsubse" case 190: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\subsubsec" case 191: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\subsubsect" case 192: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\subsubsecti" case 193: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\subsubsectio" case 195: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\scs" case 196: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\scr" case 197: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\scri" case 198: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\scrip" case 199: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\script" case 200: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\scripts" case 201: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\scriptsi" case 202: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\scriptsiz" case 205: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\scsh" case 206: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\scsha" case 207: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\scshap" case 210: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\au" case 211: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\an" case 213: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\aut" case 214: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\auth" case 215: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\autho" case 217: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\la" case 218: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\lar" case 219: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\larg" case 222: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\to" case 223: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\te" case 224: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\tt" case 225: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\ti" case 226: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\tin" case 227: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\tit" case 228: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\titl" case 230: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\titlep" case 231: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\titlepa" case 232: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\titlepag" case 236: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\ttf" case 237: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\ttfa" case 238: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\ttfam" case 239: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\ttfami" case 240: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\ttfamil" case 243: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\tex" case 244: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\text" case 245: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textc" case 246: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textt" case 247: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\texta" case 248: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\texts" case 249: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textp" case 250: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\texti" case 251: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textb" case 252: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textba" case 254: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textbac" case 255: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textback" case 256: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textbacks" case 257: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textbacksl" case 258: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textbacksla" case 259: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textbackslas" case 260: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textbackslash" case 263: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textpi" case 264: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textpip" case 268: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textas" case 269: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textasc" case 270: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textasci" case 271: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textascii" case 272: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textasciic" case 273: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textasciici" case 274: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textasciicir" case 275: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textasciicirc" case 276: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textasciicircu" case 277: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textasciicircum" case 280: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textco" case 281: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textcol" case 282: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\textcolo" case 284: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\tod" case 285: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\toda" case 287: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\no" case 288: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\ne" case 289: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\new" case 290: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\newl" case 291: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\newli" case 292: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\newlin" case 294: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\nor" case 295: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\norm" case 296: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\norma" case 297: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\normal" case 298: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\normals" case 299: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\normalsi" case 300: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\normalsiz" case 303: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\en" case 304: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\end" case 312: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\mu" case 313: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\mul" case 314: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\mult" case 315: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\multi" case 316: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\multic" case 317: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\multico" case 318: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\multicol" case 319: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\multicolu" case 320: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\multicolum" case 322: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\un" case 323: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\us" case 324: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\use" case 325: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\uset" case 326: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\usep" case 327: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\usepa" case 328: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\usepac" case 329: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\usepack" case 330: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\usepacka" case 331: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\usepackag" case 333: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\useth" case 334: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\usethe" case 335: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\usethem" case 337: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\und" case 338: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\unde" case 339: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\under" case 340: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\underl" case 341: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\underli" case 342: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\underlin" case 344: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\co" case 345: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\cl" case 347: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\cli" case 348: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\clin" case 350: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\col" case 351: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\colo" case 353: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\do" case 354: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\da" case 355: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\dat" case 357: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\doc" case 358: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\docu" case 359: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\docum" case 360: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\docume" case 361: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\documen" case 362: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\document" case 363: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\documentc" case 364: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\documentcl" case 365: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\documentcla" case 366: // Recognized '\\[[:IsLetter:]]+', Shortest string "\\documentclas" BEGIN(bpre_overlay); printWarning("Unknown command " + yytext); break; case 26: // Recognized '\\\{', Shortest string "\\{" BEGIN(str); unformattedText += @"{"; spaces = 0; nls = 0; break; case 27: // Recognized '\\\}', Shortest string "\\}" BEGIN(str); unformattedText += @"}"; spaces = 0; nls = 0; break; case 29: // Recognized '\\[ ]', Shortest string "\\\x20" BEGIN(str); unformattedText += @" "; spaces = 1; nls = 0; break; case 32: // Recognized '\\#', Shortest string "\\#" BEGIN(str); unformattedText += @"#"; spaces = 0; nls = 0; break; case 33: // Recognized '\\\$', Shortest string "\\$" BEGIN(str); unformattedText += @"$"; spaces = 0; nls = 0; break; case 34: // Recognized '\\%', Shortest string "\\%" BEGIN(str); unformattedText += @"%"; spaces = 0; nls = 0; break; case 35: // Recognized '\\&', Shortest string "\\&" BEGIN(str); unformattedText += @"&"; spaces = 0; nls = 0; break; case 36: // Recognized '\\_', Shortest string "\\_" BEGIN(str); unformattedText += @"_"; spaces = 0; nls = 0; break; case 41: // Recognized '\\verb.', Shortest string "\\verb\\" case 42: // Recognized '\\verb.', Shortest string "\\verbd" BEGIN(verb); unformattedText = ""; spaces = 0; nls = 0; verbBoundary = yytext[yytext.Length - 1]; break; case 43: // Recognized '\\~\{\}', Shortest string "\\~{}" BEGIN(str); unformattedText += @"~"; spaces = 0; nls = 0; break; case 46: // Recognized '\\Huge[ ]?', Shortest string "\\Huge" case 47: // Recognized '\\Huge[ ]?', Shortest string "\\Huge\x20" return (int) Tokens.HUGE2; break; case 52: // Recognized '\\LARGE[ ]?', Shortest string "\\LARGE" case 53: // Recognized '\\LARGE[ ]?', Shortest string "\\LARGE\x20" return (int) Tokens.LARGE3; break; case 57: // Recognized '\\LaTeX[ ]?', Shortest string "\\LaTeX" case 58: // Recognized '\\LaTeX[ ]?', Shortest string "\\LaTeX\x20" BEGIN(str); unformattedText = @"LaTeX"; spaces = 0; nls = 0; break; case 60: // Recognized '\\Large[ ]?', Shortest string "\\Large" case 61: // Recognized '\\Large[ ]?', Shortest string "\\Large\x20" return (int) Tokens.LARGE2; break; case 66: // Recognized '\\frame', Shortest string "\\frame" BEGIN(pre_optional); return (int) Tokens.FRAME; break; case 75: // Recognized '\\framesubtitle', Shortest string "\\framesubtitle" BEGIN(pre_overlay); return (int) Tokens.FRAMESUBTITLE; break; case 79: // Recognized '\\frametitle', Shortest string "\\frametitle" BEGIN(pre_overlay); return (int) Tokens.FRAMETITLE; break; case 89: // Recognized '\\footnotesize[ ]?', Shortest string "\\footnotesize" case 90: // Recognized '\\footnotesize[ ]?', Shortest string "\\footnotesize\x20" return (int) Tokens.FOOTNOTESIZE; break; case 98: // Recognized '\\bfseries[ ]?', Shortest string "\\bfseries" case 99: // Recognized '\\bfseries[ ]?', Shortest string "\\bfseries\x20" return (int) Tokens.BFSERIES; break; case 103: // Recognized '{envBegin}\{[^\}]+\}', Shortest string "\\begin{\\}" case 106: // Recognized '{envBegin}\{[^\}]+\}', Shortest string "\\begin{tabular}" BEGIN(bpre_overlay); printWarning("Unknown environment " + yytext); break; case 104: // Recognized '{envBegin}\{frame\}', Shortest string "\\begin{frame}" BEGIN(pre_optional); return (int) Tokens.BEGIN_FRAME; break; case 105: // Recognized '{envBegin}\{itemize\}', Shortest string "\\begin{itemize}" BEGIN(pre_optional); return (int) Tokens.BEGIN_ITEMIZE; break; case 107: // Recognized '{envBegin}\{tabular\}{ws}(\[[bct]\]{ws})?\{', Shortest string "\\begin{tabular}{" tabular = true; BEGIN(tabular_arg); tbl = 0; unformattedText = ""; return (int) Tokens.BEGIN_TABULAR; break; case 108: // Recognized '{envBegin}\{enumerate\}', Shortest string "\\begin{enumerate}" BEGIN(pre_optional); return (int) Tokens.BEGIN_ENUMERATE; break; case 109: // Recognized '{envBegin}\{comment\}', Shortest string "\\begin{comment}" BEGIN(comment); break; case 110: // Recognized '{envBegin}\{description\}', Shortest string "\\begin{description}" BEGIN(pre_optional); return (int) Tokens.BEGIN_DESCRIPTION; break; case 111: // Recognized '{envBegin}\{document\}', Shortest string "\\begin{document}" inBody = true; BEGIN(body); return (int) Tokens.BEGIN_DOCUMENT; break; case 116: // Recognized '\\hline', Shortest string "\\hline" return (int) Tokens.HLINE; break; case 118: // Recognized '\\huge[ ]?', Shortest string "\\huge" case 119: // Recognized '\\huge[ ]?', Shortest string "\\huge\x20" return (int) Tokens.HUGE; break; case 127: // Recognized '\\itshape[ ]?', Shortest string "\\itshape" case 128: // Recognized '\\itshape[ ]?', Shortest string "\\itshape\x20" return (int) Tokens.ITSHAPE; break; case 129: // Recognized '\\item', Shortest string "\\item" BEGIN(pre_overlay); return (int) Tokens.ITEM; break; case 137: // Recognized '\\institute', Shortest string "\\institute" BEGIN(pre_optional); return (int) Tokens.INSTITUTE; break; case 149: // Recognized '\\includegraphics', Shortest string "\\includegraphics" BEGIN(pre_optional); return (int) Tokens.INCLUDEGRAPHICS; break; case 160: // Recognized '\\graphicspath', Shortest string "\\graphicspath" return (int) Tokens.GRAPHICSPATH; break; case 164: // Recognized '\\pause', Shortest string "\\pause" return (int) Tokens.PAUSE; break; case 173: // Recognized '\\section', Shortest string "\\section" return (int) Tokens.SECTION; break; case 176: // Recognized '\\small[ ]?', Shortest string "\\small" case 177: // Recognized '\\small[ ]?', Shortest string "\\small\x20" return (int) Tokens.SMALL; break; case 186: // Recognized '\\subsection', Shortest string "\\subsection" return (int) Tokens.SUBSECTION; break; case 194: // Recognized '\\subsubsection', Shortest string "\\subsubsection" return (int) Tokens.SUBSUBSECTION; break; case 203: // Recognized '\\scriptsize[ ]?', Shortest string "\\scriptsize" case 204: // Recognized '\\scriptsize[ ]?', Shortest string "\\scriptsize\x20" return (int) Tokens.SCRIPTSIZE; break; case 208: // Recognized '\\scshape[ ]?', Shortest string "\\scshape" case 209: // Recognized '\\scshape[ ]?', Shortest string "\\scshape\x20" return (int) Tokens.SCSHAPE; break; case 212: // Recognized '\\and', Shortest string "\\and" return (int) Tokens.AND; break; case 216: // Recognized '\\author', Shortest string "\\author" BEGIN(pre_optional); return (int) Tokens.AUTHOR; break; case 220: // Recognized '\\large[ ]?', Shortest string "\\large" case 221: // Recognized '\\large[ ]?', Shortest string "\\large\x20" return (int) Tokens.LARGE; break; case 229: // Recognized '\\title', Shortest string "\\title" return (int) Tokens.TITLE; break; case 233: // Recognized '\\titlepage', Shortest string "\\titlepage" return (int) Tokens.TITLEPAGE; break; case 234: // Recognized '\\tiny[ ]?', Shortest string "\\tiny" case 235: // Recognized '\\tiny[ ]?', Shortest string "\\tiny\x20" return (int) Tokens.TINY; break; case 241: // Recognized '\\ttfamily[ ]?', Shortest string "\\ttfamily" case 242: // Recognized '\\ttfamily[ ]?', Shortest string "\\ttfamily\x20" return (int) Tokens.TTFAMILY; break; case 253: // Recognized '\\textbf', Shortest string "\\textbf" BEGIN(pre_overlay); return (int) Tokens.TEXTBF; break; case 261: // Recognized '\\textbackslash\{\}', Shortest string "\\textbackslash{}" BEGIN(str); unformattedText += @"\"; spaces = 0; nls = 0; break; case 262: // Recognized '\\textit', Shortest string "\\textit" BEGIN(pre_overlay); return (int) Tokens.TEXTIT; break; case 265: // Recognized '\\textpipe(\{\})?', Shortest string "\\textpipe" case 266: // Recognized '\\textpipe(\{\})?', Shortest string "\\textpipe{}" BEGIN(str); unformattedText += @"|"; spaces = 0; nls = 0; break; case 267: // Recognized '\\textsc', Shortest string "\\textsc" BEGIN(pre_overlay); return (int) Tokens.TEXTSC; break; case 278: // Recognized '\\textasciicircum\{\}', Shortest string "\\textasciicircum{}" BEGIN(str); unformattedText += @"^"; spaces = 0; nls = 0; break; case 279: // Recognized '\\texttt', Shortest string "\\texttt" BEGIN(pre_overlay); return (int) Tokens.TEXTTT; break; case 283: // Recognized '\\textcolor', Shortest string "\\textcolor" BEGIN(pre_overlay); return (int) Tokens.TEXTCOLOR; break; case 286: // Recognized '\\today', Shortest string "\\today" return (int) Tokens.TODAY; break; case 293: // Recognized '\\newline', Shortest string "\\newline" return (int) Tokens.NL; break; case 301: // Recognized '\\normalsize[ ]?', Shortest string "\\normalsize" case 302: // Recognized '\\normalsize[ ]?', Shortest string "\\normalsize\x20" return (int) Tokens.NORMALSIZE; break; case 305: // Recognized '{envEnd}\{[^\}]+\}', Shortest string "\\end{\\}" BEGIN(bpre_overlay); printWarning("Unknown environment " + yytext); break; case 306: // Recognized '{envEnd}\{frame\}', Shortest string "\\end{frame}" return (int) Tokens.END_FRAME; break; case 307: // Recognized '{envEnd}\{itemize\}', Shortest string "\\end{itemize}" return (int) Tokens.END_ITEMIZE; break; case 308: // Recognized '{envEnd}\{tabular\}', Shortest string "\\end{tabular}" tabular = false; return (int) Tokens.END_TABULAR; break; case 309: // Recognized '{envEnd}\{enumerate\}', Shortest string "\\end{enumerate}" return (int) Tokens.END_ENUMERATE; break; case 310: // Recognized '{envEnd}\{description\}', Shortest string "\\end{description}" return (int) Tokens.END_DESCRIPTION; break; case 311: // Recognized '{envEnd}\{document\}', Shortest string "\\end{document}" inBody = false; BEGIN(INITIAL); return (int) Tokens.END_DOCUMENT; break; case 321: // Recognized '\\multicolumn', Shortest string "\\multicolumn" return (int) Tokens.MULTICOLUMN; break; case 332: // Recognized '\\usepackage', Shortest string "\\usepackage" BEGIN(pre_optional); return (int) Tokens.USEPACKAGE; break; case 336: // Recognized '\\usetheme', Shortest string "\\usetheme" return (int) Tokens.USETHEME; break; case 343: // Recognized '\\underline', Shortest string "\\underline" BEGIN(pre_overlay); return (int) Tokens.UNDERLINE; break; case 349: // Recognized '\\cline', Shortest string "\\cline" return (int) Tokens.CLINE; break; case 352: // Recognized '\\color', Shortest string "\\color" BEGIN(pre_overlay); return (int) Tokens.COLOR; break; case 356: // Recognized '\\date', Shortest string "\\date" return (int) Tokens.DATE; break; case 367: // Recognized '\\documentclass', Shortest string "\\documentclass" BEGIN(pre_optional); return (int) Tokens.DOCUMENTCLASS; break; case 368: // In <str> Recognized '[^#\$%\^&_\{\}~\\ \n\t\r]*', Shortest string "" case 369: // In <str> Recognized '[^#\$%\^&_\{\}~\\ \n\t\r]*', Shortest string "d" unformattedText += yytext; spaces = 0; nls = 0; break; case 370: // In <str> Recognized '[#\$\^&_\{\}\\]', Shortest string "\\" case 374: // In <str> Recognized '[#\$\^&_\{\}\\]', Shortest string "{" if(inBody) BEGIN(body); else BEGIN(INITIAL); yyless(0); // return text only if it contains text or new line if(unformattedText.IndexOf('\n') != -1 || unformattedText.Trim().Length != 0) { yylval.Text = unformattedText; return (int) Tokens.STRING; } break; case 371: // In <str> Recognized '" "|\t', Shortest string "\t" spaces++; if(spaces == 1) unformattedText += @" "; break; case 372: // In <str> Recognized '\r', Shortest string "\r" /* ignore */ break; case 373: // In <str> Recognized '\n', Shortest string "\n" nls++; if(nls == 1 && spaces == 0) { // if one empty line add space unformattedText += @" "; spaces++; } if(nls == 2) { // if two empty lines remove space and add new line // need to remove last space if(unformattedText.Length > 0 && unformattedText.EndsWith(" ")) unformattedText.Remove(unformattedText.Length - 1, 1); unformattedText += "\n"; } break; case 375: // In <str> Recognized '%.*\n?{ws}', Shortest string "%" case 377: // In <str> Recognized '%.*\n?{ws}', Shortest string "%\n" /* ignore comment inside plaintext */ break; case 376: // In <str> Recognized '~', Shortest string "~" spaces++; unformattedText += "\u00A0"; break; case 378: // In <str> Recognized '\\\{', Shortest string "\\{" unformattedText += @"{"; spaces = 0; nls = 0; break; case 379: // In <str> Recognized '\\\}', Shortest string "\\}" unformattedText += @"}"; spaces = 0; nls = 0; break; case 380: // In <str> Recognized '\\#', Shortest string "\\#" unformattedText += @"#"; spaces = 0; nls = 0; break; case 381: // In <str> Recognized '\\\$', Shortest string "\\$" unformattedText += @"$"; spaces = 0; nls = 0; break; case 382: // In <str> Recognized '\\%', Shortest string "\\%" unformattedText += @"%"; spaces = 0; nls = 0; break; case 383: // In <str> Recognized '\\&', Shortest string "\\&" unformattedText += @"&"; spaces = 0; nls = 0; break; case 384: // In <str> Recognized '\\_', Shortest string "\\_" unformattedText += @"_"; spaces = 0; nls = 0; break; case 385: // In <str> Recognized '\\~\{\}', Shortest string "\\~{}" unformattedText += @"~"; spaces = 0; nls = 0; break; case 386: // In <str> Recognized '\\LaTeX[ ]?', Shortest string "\\LaTeX" case 387: // In <str> Recognized '\\LaTeX[ ]?', Shortest string "\\LaTeX\x20" unformattedText += @"LaTeX"; spaces = 0; nls = 0; break; case 388: // In <str> Recognized '\\textbackslash\{\}', Shortest string "\\textbackslash{}" unformattedText += @"\"; spaces = 0; nls = 0; break; case 389: // In <str> Recognized '\\textpipe(\{\})?', Shortest string "\\textpipe" case 390: // In <str> Recognized '\\textpipe(\{\})?', Shortest string "\\textpipe{}" unformattedText += @"|"; spaces = 0; nls = 0; break; case 391: // In <str> Recognized '\\textasciicircum\{\}', Shortest string "\\textasciicircum{}" unformattedText += @"^"; spaces = 0; nls = 0; break; case 392: // In <overlay> Recognized '[^>]*', Shortest string "" case 394: // In <overlay> Recognized '[^>]*', Shortest string "\\" unformattedText += yytext; break; case 393: // In <overlay> Recognized '>', Shortest string "" BEGIN(pre_optional); yylval.Text = unformattedText; return (int) Tokens.OVERLAY; break; case 395: // In <optional> Recognized '[^\]]*', Shortest string "" case 396: // In <optional> Recognized '[^\]]*', Shortest string "\\" unformattedText += yytext; break; case 397: // In <optional> Recognized '\]', Shortest string "]" if(inBody) BEGIN(body); else BEGIN(INITIAL); yylval.Text = unformattedText; return (int) Tokens.OPTIONAL; break; case 398: // In <pre_overlay> Recognized '{wsl}[^<]', Shortest string "\\" case 399: // In <pre_overlay> Recognized '{wsl}[^<]', Shortest string "\t" case 400: // In <pre_overlay> Recognized '{wsl}[^<]', Shortest string "\r" case 401: // In <pre_overlay> Recognized '{wsl}[^<]', Shortest string "\n" BEGIN(pre_optional); yyless(0); break; case 402: // In <pre_overlay> Recognized '{wsl}<', Shortest string "<" BEGIN(overlay); unformattedText = ""; break; case 403: // In <pre_optional> Recognized '{wsl}[^[]', Shortest string "\\" case 404: // In <pre_optional> Recognized '{wsl}[^[]', Shortest string "\t" case 405: // In <pre_optional> Recognized '{wsl}[^[]', Shortest string "\r" case 406: // In <pre_optional> Recognized '{wsl}[^[]', Shortest string "\n" if(inBody) BEGIN(body); else BEGIN(INITIAL); yyless(0); break; case 407: // In <pre_optional> Recognized '{wsl}\[', Shortest string "[" BEGIN(optional); unformattedText = ""; break; case 408: // In <tabular_arg> Recognized '[^{}]*', Shortest string "" case 409: // In <tabular_arg> Recognized '[^{}]*', Shortest string "\\" unformattedText += yytext; break; case 410: // In <tabular_arg> Recognized '\{', Shortest string "{" tbl++; unformattedText += @"{"; break; case 411: // In <tabular_arg> Recognized '\}', Shortest string "}" tbl--; if(tbl < 0) { yylval.Text = unformattedText; BEGIN(INITIAL); return (int) Tokens.STRING; } unformattedText += @"}"; break; case 412: // In <boverlay> Recognized '[^>]*', Shortest string "" case 414: // In <boverlay> Recognized '[^>]*', Shortest string "\\" {} break; case 413: // In <boverlay> Recognized '>', Shortest string "" BEGIN(bpre_optional); break; case 415: // In <boptional> Recognized '[^\]]*', Shortest string "" case 416: // In <boptional> Recognized '[^\]]*', Shortest string "\\" {} break; case 417: // In <boptional> Recognized '\]', Shortest string "]" if(inBody) BEGIN(body); else BEGIN(INITIAL); break; case 418: // In <bpre_overlay> Recognized '{wsl}[^<]', Shortest string "\\" case 419: // In <bpre_overlay> Recognized '{wsl}[^<]', Shortest string "\t" case 420: // In <bpre_overlay> Recognized '{wsl}[^<]', Shortest string "\r" case 421: // In <bpre_overlay> Recognized '{wsl}[^<]', Shortest string "\n" BEGIN(bpre_optional); yyless(0); break; case 422: // In <bpre_overlay> Recognized '{wsl}<', Shortest string "<" BEGIN(boverlay); break; case 423: // In <bpre_optional> Recognized '{wsl}[^[]', Shortest string "\\" case 424: // In <bpre_optional> Recognized '{wsl}[^[]', Shortest string "\t" case 425: // In <bpre_optional> Recognized '{wsl}[^[]', Shortest string "\r" case 426: // In <bpre_optional> Recognized '{wsl}[^[]', Shortest string "\n" if(inBody) BEGIN(body); else BEGIN(INITIAL); yyless(0); break; case 427: // In <bpre_optional> Recognized '{wsl}\[', Shortest string "[" BEGIN(boptional); break; case 428: // In <math> Recognized '[^\$]', Shortest string "\\" unformattedText += yytext; break; case 429: // In <math> Recognized '\$', Shortest string "$" if(inBody) BEGIN(body); else BEGIN(INITIAL); yylval.Text = unformattedText + "$"; return (int) Tokens.STRING; break; case 430: // In <comment> Recognized '[^\\]*', Shortest string "" case 431: // In <comment> Recognized '[^\\]*', Shortest string "d" /* ignore */ break; case 432: // In <comment> Recognized '\\', Shortest string "\\" /* ignore */ break; case 433: // In <comment> Recognized '{envEnd}\{comment\}', Shortest string "\\end{comment}" if(inBody) BEGIN(body); else BEGIN(INITIAL); break; case 434: // In <verb> Recognized '.', Shortest string "\\" if(yytext[0] != verbBoundary) unformattedText += yytext; else { if(inBody) BEGIN(body); else BEGIN(INITIAL); yylval.Text = unformattedText; return (int) Tokens.VERB; } break; case 435: // In <body> Recognized '[^#\$%\^&_\{\}\\]', Shortest string "d" BEGIN(str); yyless(0); unformattedText = ""; nls = 0; break; default: break; } #pragma warning restore 162 #endregion } } } // end try finally { // User-specified epilog to scan() yylloc = new QUT.Gppg.LexLocation(tokLin, tokCol, tokELin, tokECol); // End, user-specified epilog } // end finally }
public void SetLocation(QUT.Gppg.LexLocation loc) { Line = loc.StartLine; Column = loc.StartColumn; }
// ============== The main tokenizer code ================= int Scan() { try { for (; ; ) { int next; // next state to enter #if BACKUP Result rslt = Result.noMatch; #endif // BACKUP #if LEFTANCHORS for (;;) { // Discard characters that do not start any pattern. // Must check the left anchor condition after *every* GetCode! state = ((cCol == 0) ? anchorState[currentScOrd] : currentStart); if ((next = NextState()) != goStart) break; // LOOP EXIT HERE... GetCode(); } #else // !LEFTANCHORS state = currentStart; while ((next = NextState()) == goStart) // At this point, the current character has no // transition from the current state. We discard // the "no-match" char. In traditional LEX such // characters are echoed to the console. GetCode(); #endif // LEFTANCHORS // At last, a valid transition ... MarkToken(); state = next; GetCode(); while ((next = NextState()) > eofNum) // Exit for goStart AND for eofNum #if BACKUP if (state <= maxAccept && next > maxAccept) // need to prepare backup data { // ctx is an object. The fields may be // mutated by the call to Recurse2. // On return the data in ctx is the // *latest* accept state that was found. rslt = Recurse2(ref ctx, next); if (rslt == Result.noMatch) RestoreStateAndPos(ref ctx); break; } else #endif // BACKUP { state = next; GetCode(); } if (state <= maxAccept) { MarkEnd(); #region ActionSwitch #pragma warning disable 162 switch (state) { case eofNum: if (yywrap()) return (int)Tokens.EOF; break; case 1: case 2: yylval.sVal = "\n"; return (int)Tokens.ENDL; break; case 3: case 34: BEGIN(INITIAL); break; case 4: return (int)Tokens.TK_NEWLINE; break; case 5: return (int)Tokens.MULT; break; case 6: return (int)Tokens.COLON; break; case 7: return (int)Tokens.EQ; break; case 8: return (int)Tokens.SEMICOLUMN; break; case 9: return (int)Tokens.MINUS; break; case 10: return (int)Tokens.PLUS; break; case 11: return (int)Tokens.DIVIDE; break; case 12: return (int)Tokens.LT; break; case 13: return (int)Tokens.GT; break; case 14: return (int)Tokens.LPAREN; break; case 15: return (int)Tokens.RPAREN; break; case 16: return (int)Tokens.COLUMN; break; case 17: return (int)Tokens.COMMA; break; case 18: return (int)Tokens.TK_SQUARE_OPEN; break; case 19: return (int)Tokens.TK_SQUARE_CLOSE; break; case 20: return (int)Tokens.INVISIBLE; break; case 21: int res = ScannerHelper.GetIDToken(yytext); if (res == (int)Tokens.ID) yylval.sVal = yytext; return res; break; case 22: yylval.iVal = int.Parse(yytext); return (int)Tokens.INTNUM; break; case 23: case 24: case 27: yylval.sVal = yytext.Substring(1,yytext.Length - 2); return (int)Tokens.STRING; break; case 25: case 26: yylval.chVal = yytext[1]; return (int)Tokens.CHAR; break; case 28: yylval.rVal = double.Parse(yytext,new System.Globalization.CultureInfo("en-US")); return (int)Tokens.REAL; break; case 29: return (int)Tokens.GE; break; case 30: return (int)Tokens.LE; break; case 31: return (int)Tokens.NE; break; case 32: return (int)Tokens.ASSIGN; break; case 33: return (int)Tokens.TK_POWER; break; default: break; } #pragma warning restore 162 #endregion } } } // end try finally { // User-specified epilog to scan() yylloc = new QUT.Gppg.LexLocation(tokLin, tokCol, tokELin, tokECol); // End, user-specified epilog } // end finally }
// ============== The main tokenizer code ================= int Scan() { try { for (; ; ) { int next; // next state to enter #if LEFTANCHORS for (;;) { // Discard characters that do not start any pattern. // Must check the left anchor condition after *every* GetCode! state = ((cCol == 0) ? anchorState[currentScOrd] : currentStart); if ((next = NextState()) != goStart) break; // LOOP EXIT HERE... GetCode(); } #else // !LEFTANCHORS state = currentStart; while ((next = NextState()) == goStart) { // At this point, the current character has no // transition from the current state. We discard // the "no-match" char. In traditional LEX such // characters are echoed to the console. GetCode(); } #endif // LEFTANCHORS // At last, a valid transition ... MarkToken(); state = next; GetCode(); #if BACKUP bool contextSaved = false; while ((next = NextState()) > eofNum) { // Exit for goStart AND for eofNum if (state <= maxAccept && next > maxAccept) { // need to prepare backup data // Store data for the *latest* accept state that was found. SaveStateAndPos( ref ctx ); contextSaved = true; } state = next; GetCode(); } if (state > maxAccept && contextSaved) RestoreStateAndPos( ref ctx ); #else // BACKUP while ((next = NextState()) > eofNum) { // Exit for goStart AND for eofNum state = next; GetCode(); } #endif // BACKUP if (state <= maxAccept) { MarkEnd(); #region ActionSwitch #pragma warning disable 162, 1522 switch (state) { case eofNum: if (yywrap()) return (int)Tokens.EOF; break; case 1: case 6: case 7: case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19: case 26: case 27: case 28: case 30: case 31: case 32: case 33: case 34: case 35: case 36: case 37: case 39: case 40: case 41: case 42: case 44: case 45: case 46: case 47: case 48: case 49: case 50: case 51: case 52: case 54: case 55: case 56: case 57: case 58: case 59: case 60: case 61: case 63: case 64: case 65: case 66: case 67: case 68: case 70: case 71: case 73: case 74: case 75: case 76: case 78: case 79: case 80: case 81: case 82: case 84: case 85: case 86: case 87: case 88: case 89: case 90: case 91: case 93: case 94: case 95: case 96: case 98: case 99: case 100: case 102: case 103: case 104: case 106: case 107: case 108: case 109: case 110: case 112: case 113: case 114: case 115: case 116: case 117: case 118: case 120: case 121: case 122: case 125: case 126: case 127: case 128: case 129: case 131: case 132: case 133: case 134: case 135: case 137: case 138: case 140: case 142: case 143: case 144: case 145: case 146: case 147: case 148: case 149: case 150: case 151: case 152: case 153: case 154: case 156: case 157: case 158: case 159: case 160: case 161: case 162: case 163: case 165: case 167: case 168: case 169: case 170: case 171: case 172: case 173: case 174: case 175: case 176: case 178: case 179: case 180: case 181: case 182: case 183: case 184: case 185: case 187: case 188: case 189: case 190: case 191: case 192: case 193: case 194: case 195: case 198: case 199: case 200: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.LetterDigits; break; case 2: case 4: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.Sign; break; case 3: GoToSkipState(Anon2); break; case 5: GoToSkipState(Anon4); break; case 20: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens._Ropen; break; case 21: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens._Rclose; break; case 22: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens._Scolon; break; case 23: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens._Sopen; break; case 24: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens._Sclose; break; case 25: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens._Dot; break; case 29: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens._where; break; case 38: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkMethod; break; case 43: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkDirective; break; case 53: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkInitFinal; break; case 62: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkMethod; break; case 69: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens._override; break; case 72: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens._var; break; case 77: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens._virtual; break; case 83: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkClassVisModifier; break; case 92: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkClassVisModifier; break; case 97: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkMethod; break; case 101: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkClassVisModifier; break; case 105: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens._label; break; case 111: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens._record; break; case 119: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens._reintroduce; break; case 123: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens._type; break; case 124: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkCodeOpen; break; case 130: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens._const; break; case 136: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkMethod; break; case 139: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens._class; break; case 141: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkCodeOpen; break; case 155: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkImpl; break; case 164: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens._interface; break; case 166: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkClassVisModifier; break; case 177: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkInitFinal; break; case 186: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkDirective; break; case 196: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens._extensionmethod; break; case 197: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens._end; break; case 201: yylval = new ValueType(); yylval.type_Token = new Token(yytext, yylloc); return (int)Tokens.tkCodeOpen; break; case 202: GoToSkipState(Anon1); break; case 203: GoToSkipState(Anon3); break; case 204: GoToSkipState(Anon2); break; case 205: GoToSkipState(Anon4); break; case 206: GoToSkipState(Anon1); break; case 207: GoToSkipState(Anon3); break; case 208: ReturnToLastState(); break; case 209: ReturnToLastState(); break; case 210: ReturnToLastState(); break; case 211: ReturnToLastState(); break; case 212: { } break; default: break; } #pragma warning restore 162, 1522 #endregion } } } // end try finally { // User-specified epilog to scan() yylloc = new QUT.Gppg.LexLocation(tokLin+LineAdd, tokCol, tokELin+LineAdd, tokECol); yylval.type_Token.Location = yylloc; // End, user-specified epilog } // end finally }
// ============== The main tokenizer code ================= int Scan() { try { for (; ; ) { int next; // next state to enter #if LEFTANCHORS for (;;) { // Discard characters that do not start any pattern. // Must check the left anchor condition after *every* GetCode! state = ((cCol == 0) ? anchorState[currentScOrd] : currentStart); if ((next = NextState()) != goStart) break; // LOOP EXIT HERE... GetCode(); } #else // !LEFTANCHORS state = currentStart; while ((next = NextState()) == goStart) { // At this point, the current character has no // transition from the current state. We discard // the "no-match" char. In traditional LEX such // characters are echoed to the console. GetCode(); } #endif // LEFTANCHORS // At last, a valid transition ... MarkToken(); state = next; GetCode(); #if BACKUP bool contextSaved = false; while ((next = NextState()) > eofNum) { // Exit for goStart AND for eofNum if (state <= maxAccept && next > maxAccept) { // need to prepare backup data // Store data for the *latest* accept state that was found. SaveStateAndPos( ref ctx ); contextSaved = true; } state = next; GetCode(); } if (state > maxAccept && contextSaved) RestoreStateAndPos( ref ctx ); #else // BACKUP while ((next = NextState()) > eofNum) { // Exit for goStart AND for eofNum state = next; GetCode(); } #endif // BACKUP if (state <= maxAccept) { MarkEnd(); #region ActionSwitch #pragma warning disable 162, 1522 switch (state) { case eofNum: if (yywrap()) return (int)Tokens.EOF; break; case 1: yylval.sVal = yytext; int token = Keywords.KeywordOrIDToken(yytext); if (token != (int)Tokens.LetterDigit) { EnteringContainer = true; } return token; break; case 2: case 3: case 4: case 5: yylval.sVal = yytext; if (yytext == ";") return (int)Tokens.tkSemicolon; if (yytext == "{") { if (!EnteringContainer) { OpenBraceCount = 1; yy_push_state(SKIPBODY); } EnteringContainer = false; return (int)Tokens.LBRACE; } if (yytext == "}") { EnteringContainer = false; return (int)Tokens.RBRACE; } return (int)Tokens.SIGN; break; case 6: ProcessDirectiveInNonSkipState(yytext); break; case 7: ProcessComment(yytext.Substring(2)); break; case 8: ProcessComment(yytext.Substring(2, yytext.Length-4)); break; case 9: yylval.sVal = yytext; return (int)Tokens.STRING; break; case 10: case 11: case 12: if (yytext == "{") { OpenBraceCount += 1; } if (yytext == "}") { OpenBraceCount -=1; if (OpenBraceCount == 0) { yy_pop_state(); return (int)Tokens.RBRACE; } } break; case 13: ProcessDirectiveInNonSkipState(yytext); break; case 14: ProcessComment(yytext.Substring(2)); break; case 15: ProcessComment(yytext.Substring(2, yytext.Length-4)); break; case 16: yylval.sVal = yytext; return (int)Tokens.STRING; break; case 17: ProcessDirectiveInSkipState(yytext); break; case 18: ProcessComment(yytext.Substring(2)); break; case 19: ProcessComment(yytext.Substring(2, yytext.Length-4)); break; case 20: yylval.sVal = yytext; return (int)Tokens.STRING; break; default: break; } #pragma warning restore 162, 1522 #endregion } } } // end try finally { // User-specified epilog to scan() yylloc = new QUT.Gppg.LexLocation(tokLin, tokCol, tokELin, tokECol); // End, user-specified epilog } // end finally }
// ============== The main tokenizer code ================= int Scan() { try { for (; ; ) { int next; // next state to enter #if LEFTANCHORS for (;;) { // Discard characters that do not start any pattern. // Must check the left anchor condition after *every* GetCode! state = ((cCol == 0) ? anchorState[currentScOrd] : currentStart); if ((next = NextState()) != goStart) break; // LOOP EXIT HERE... GetCode(); } #else // !LEFTANCHORS state = currentStart; while ((next = NextState()) == goStart) { // At this point, the current character has no // transition from the current state. We discard // the "no-match" char. In traditional LEX such // characters are echoed to the console. GetCode(); } #endif // LEFTANCHORS // At last, a valid transition ... MarkToken(); state = next; GetCode(); #if BACKUP bool contextSaved = false; while ((next = NextState()) > eofNum) { // Exit for goStart AND for eofNum if (state <= maxAccept && next > maxAccept) { // need to prepare backup data // Store data for the *latest* accept state that was found. SaveStateAndPos( ref ctx ); contextSaved = true; } state = next; GetCode(); } if (state > maxAccept && contextSaved) RestoreStateAndPos( ref ctx ); #else // BACKUP while ((next = NextState()) > eofNum) { // Exit for goStart AND for eofNum state = next; GetCode(); } #endif // BACKUP if (state <= maxAccept) { MarkEnd(); #region ActionSwitch #pragma warning disable 162, 1522 switch (state) { case eofNum: if (yywrap()) return (int)Tokens.EOF; break; case 1: yylval = new ValueType(); yylval.sVal = yytext; return Keywords.KeywordOrIDToken(yytext); break; case 2: case 3: case 4: case 5: yylval = new ValueType(); yylval.sVal = yytext; return Keywords.KeywordOrIDToken(yytext); break; case 6: { } break; case 7: yylval = new ValueType(); yylval.sVal = yytext; if (yylval.sVal.StartsWith("'")) yylval.sVal = "\"" + yylval.sVal.Substring(1, yylval.sVal.Length-2) + "\""; return Keywords.KeywordOrIDToken(yytext); break; case 8: yylval = new ValueType(); yylval.sVal = yytext; BEGIN(INITIAL); return (int)Tokens.RegExp; break; default: break; } #pragma warning restore 162, 1522 #endregion } } } // end try finally { // User-specified epilog to scan() yylloc = new QUT.Gppg.LexLocation(tokLin, tokCol, tokELin, tokECol); // End, user-specified epilog } // end finally }