How to use UnexpectedEOFException class of Gherkin package

Best Gherkin-dotnet code snippet using Gherkin.UnexpectedEOFException

Parser.cs

Source:Parser.cs Github

copy

Full Screen

...381            382            const string stateComment = "State: 0 - Start";383            token.Detach();384            var expectedTokens = new string[] {"#EOF", "#Language", "#TagLine", "#FeatureLine", "#Comment", "#Empty"};385            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 386                : new UnexpectedTokenException(token, expectedTokens, stateComment);387            if (StopAtFirstError)388                throw error;389            390            AddError(context, error);391            return 0;392        }393        394        395        // GherkinDocument:0>Feature:0>Feature_Header:0>#Language:0396        int MatchTokenAt_1(Token token, ParserContext context)397        {398            if (Match_TagLine(context, token))399            {400                StartRule(context, RuleType.Tags);401                Build(context, token);402                return 2;403            }404            if (Match_FeatureLine(context, token))405            {406                Build(context, token);407                return 3;408            }409            if (Match_Comment(context, token))410            {411                Build(context, token);412                return 1;413            }414            if (Match_Empty(context, token))415            {416                Build(context, token);417                return 1;418            }419            420            const string stateComment = "State: 1 - GherkinDocument:0>Feature:0>Feature_Header:0>#Language:0";421            token.Detach();422            var expectedTokens = new string[] {"#TagLine", "#FeatureLine", "#Comment", "#Empty"};423            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 424                : new UnexpectedTokenException(token, expectedTokens, stateComment);425            if (StopAtFirstError)426                throw error;427            428            AddError(context, error);429            return 1;430        }431        432        433        // GherkinDocument:0>Feature:0>Feature_Header:1>Tags:0>#TagLine:0434        int MatchTokenAt_2(Token token, ParserContext context)435        {436            if (Match_TagLine(context, token))437            {438                Build(context, token);439                return 2;440            }441            if (Match_FeatureLine(context, token))442            {443                EndRule(context, RuleType.Tags);444                Build(context, token);445                return 3;446            }447            if (Match_Comment(context, token))448            {449                Build(context, token);450                return 2;451            }452            if (Match_Empty(context, token))453            {454                Build(context, token);455                return 2;456            }457            458            const string stateComment = "State: 2 - GherkinDocument:0>Feature:0>Feature_Header:1>Tags:0>#TagLine:0";459            token.Detach();460            var expectedTokens = new string[] {"#TagLine", "#FeatureLine", "#Comment", "#Empty"};461            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 462                : new UnexpectedTokenException(token, expectedTokens, stateComment);463            if (StopAtFirstError)464                throw error;465            466            AddError(context, error);467            return 2;468        }469        470        471        // GherkinDocument:0>Feature:0>Feature_Header:2>#FeatureLine:0472        int MatchTokenAt_3(Token token, ParserContext context)473        {474            if (Match_EOF(context, token))475            {476                EndRule(context, RuleType.Feature_Header);477                EndRule(context, RuleType.Feature);478                Build(context, token);479                return 22;480            }481            if (Match_Empty(context, token))482            {483                Build(context, token);484                return 3;485            }486            if (Match_Comment(context, token))487            {488                StartRule(context, RuleType.Description);489                Build(context, token);490                return 4;491            }492            if (Match_BackgroundLine(context, token))493            {494                EndRule(context, RuleType.Feature_Header);495                StartRule(context, RuleType.Background);496                Build(context, token);497                return 5;498            }499            if (Match_TagLine(context, token))500            {501                EndRule(context, RuleType.Feature_Header);502                StartRule(context, RuleType.Scenario_Definition);503                StartRule(context, RuleType.Tags);504                Build(context, token);505                return 9;506            }507            if (Match_ScenarioLine(context, token))508            {509                EndRule(context, RuleType.Feature_Header);510                StartRule(context, RuleType.Scenario_Definition);511                StartRule(context, RuleType.Scenario);512                Build(context, token);513                return 10;514            }515            if (Match_ScenarioOutlineLine(context, token))516            {517                EndRule(context, RuleType.Feature_Header);518                StartRule(context, RuleType.Scenario_Definition);519                StartRule(context, RuleType.ScenarioOutline);520                Build(context, token);521                return 14;522            }523            if (Match_Other(context, token))524            {525                StartRule(context, RuleType.Description);526                Build(context, token);527                return 4;528            }529            530            const string stateComment = "State: 3 - GherkinDocument:0>Feature:0>Feature_Header:2>#FeatureLine:0";531            token.Detach();532            var expectedTokens = new string[] {"#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"};533            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 534                : new UnexpectedTokenException(token, expectedTokens, stateComment);535            if (StopAtFirstError)536                throw error;537            538            AddError(context, error);539            return 3;540        }541        542        543        // GherkinDocument:0>Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:1>Description:0>__alt2:0>#Other:0544        int MatchTokenAt_4(Token token, ParserContext context)545        {546            if (Match_EOF(context, token))547            {548                EndRule(context, RuleType.Description);549                EndRule(context, RuleType.Feature_Header);550                EndRule(context, RuleType.Feature);551                Build(context, token);552                return 22;553            }554            if (Match_Comment(context, token))555            {556                Build(context, token);557                return 4;558            }559            if (Match_BackgroundLine(context, token))560            {561                EndRule(context, RuleType.Description);562                EndRule(context, RuleType.Feature_Header);563                StartRule(context, RuleType.Background);564                Build(context, token);565                return 5;566            }567            if (Match_TagLine(context, token))568            {569                EndRule(context, RuleType.Description);570                EndRule(context, RuleType.Feature_Header);571                StartRule(context, RuleType.Scenario_Definition);572                StartRule(context, RuleType.Tags);573                Build(context, token);574                return 9;575            }576            if (Match_ScenarioLine(context, token))577            {578                EndRule(context, RuleType.Description);579                EndRule(context, RuleType.Feature_Header);580                StartRule(context, RuleType.Scenario_Definition);581                StartRule(context, RuleType.Scenario);582                Build(context, token);583                return 10;584            }585            if (Match_ScenarioOutlineLine(context, token))586            {587                EndRule(context, RuleType.Description);588                EndRule(context, RuleType.Feature_Header);589                StartRule(context, RuleType.Scenario_Definition);590                StartRule(context, RuleType.ScenarioOutline);591                Build(context, token);592                return 14;593            }594            if (Match_Other(context, token))595            {596                Build(context, token);597                return 4;598            }599            600            const string stateComment = "State: 4 - GherkinDocument:0>Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:1>Description:0>__alt2:0>#Other:0";601            token.Detach();602            var expectedTokens = new string[] {"#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"};603            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 604                : new UnexpectedTokenException(token, expectedTokens, stateComment);605            if (StopAtFirstError)606                throw error;607            608            AddError(context, error);609            return 4;610        }611        612        613        // GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:0614        int MatchTokenAt_5(Token token, ParserContext context)615        {616            if (Match_EOF(context, token))617            {618                EndRule(context, RuleType.Background);619                EndRule(context, RuleType.Feature);620                Build(context, token);621                return 22;622            }623            if (Match_Empty(context, token))624            {625                Build(context, token);626                return 5;627            }628            if (Match_Comment(context, token))629            {630                StartRule(context, RuleType.Description);631                Build(context, token);632                return 6;633            }634            if (Match_StepLine(context, token))635            {636                StartRule(context, RuleType.Step);637                Build(context, token);638                return 7;639            }640            if (Match_TagLine(context, token))641            {642                EndRule(context, RuleType.Background);643                StartRule(context, RuleType.Scenario_Definition);644                StartRule(context, RuleType.Tags);645                Build(context, token);646                return 9;647            }648            if (Match_ScenarioLine(context, token))649            {650                EndRule(context, RuleType.Background);651                StartRule(context, RuleType.Scenario_Definition);652                StartRule(context, RuleType.Scenario);653                Build(context, token);654                return 10;655            }656            if (Match_ScenarioOutlineLine(context, token))657            {658                EndRule(context, RuleType.Background);659                StartRule(context, RuleType.Scenario_Definition);660                StartRule(context, RuleType.ScenarioOutline);661                Build(context, token);662                return 14;663            }664            if (Match_Other(context, token))665            {666                StartRule(context, RuleType.Description);667                Build(context, token);668                return 6;669            }670            671            const string stateComment = "State: 5 - GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:0";672            token.Detach();673            var expectedTokens = new string[] {"#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"};674            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 675                : new UnexpectedTokenException(token, expectedTokens, stateComment);676            if (StopAtFirstError)677                throw error;678            679            AddError(context, error);680            return 5;681        }682        683        684        // GherkinDocument:0>Feature:1>Background:1>Background_Description:0>Description_Helper:1>Description:0>__alt2:0>#Other:0685        int MatchTokenAt_6(Token token, ParserContext context)686        {687            if (Match_EOF(context, token))688            {689                EndRule(context, RuleType.Description);690                EndRule(context, RuleType.Background);691                EndRule(context, RuleType.Feature);692                Build(context, token);693                return 22;694            }695            if (Match_Comment(context, token))696            {697                Build(context, token);698                return 6;699            }700            if (Match_StepLine(context, token))701            {702                EndRule(context, RuleType.Description);703                StartRule(context, RuleType.Step);704                Build(context, token);705                return 7;706            }707            if (Match_TagLine(context, token))708            {709                EndRule(context, RuleType.Description);710                EndRule(context, RuleType.Background);711                StartRule(context, RuleType.Scenario_Definition);712                StartRule(context, RuleType.Tags);713                Build(context, token);714                return 9;715            }716            if (Match_ScenarioLine(context, token))717            {718                EndRule(context, RuleType.Description);719                EndRule(context, RuleType.Background);720                StartRule(context, RuleType.Scenario_Definition);721                StartRule(context, RuleType.Scenario);722                Build(context, token);723                return 10;724            }725            if (Match_ScenarioOutlineLine(context, token))726            {727                EndRule(context, RuleType.Description);728                EndRule(context, RuleType.Background);729                StartRule(context, RuleType.Scenario_Definition);730                StartRule(context, RuleType.ScenarioOutline);731                Build(context, token);732                return 14;733            }734            if (Match_Other(context, token))735            {736                Build(context, token);737                return 6;738            }739            740            const string stateComment = "State: 6 - GherkinDocument:0>Feature:1>Background:1>Background_Description:0>Description_Helper:1>Description:0>__alt2:0>#Other:0";741            token.Detach();742            var expectedTokens = new string[] {"#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"};743            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 744                : new UnexpectedTokenException(token, expectedTokens, stateComment);745            if (StopAtFirstError)746                throw error;747            748            AddError(context, error);749            return 6;750        }751        752        753        // GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:0>#StepLine:0754        int MatchTokenAt_7(Token token, ParserContext context)755        {756            if (Match_EOF(context, token))757            {758                EndRule(context, RuleType.Step);759                EndRule(context, RuleType.Background);760                EndRule(context, RuleType.Feature);761                Build(context, token);762                return 22;763            }764            if (Match_TableRow(context, token))765            {766                StartRule(context, RuleType.DataTable);767                Build(context, token);768                return 8;769            }770            if (Match_DocStringSeparator(context, token))771            {772                StartRule(context, RuleType.DocString);773                Build(context, token);774                return 27;775            }776            if (Match_StepLine(context, token))777            {778                EndRule(context, RuleType.Step);779                StartRule(context, RuleType.Step);780                Build(context, token);781                return 7;782            }783            if (Match_TagLine(context, token))784            {785                EndRule(context, RuleType.Step);786                EndRule(context, RuleType.Background);787                StartRule(context, RuleType.Scenario_Definition);788                StartRule(context, RuleType.Tags);789                Build(context, token);790                return 9;791            }792            if (Match_ScenarioLine(context, token))793            {794                EndRule(context, RuleType.Step);795                EndRule(context, RuleType.Background);796                StartRule(context, RuleType.Scenario_Definition);797                StartRule(context, RuleType.Scenario);798                Build(context, token);799                return 10;800            }801            if (Match_ScenarioOutlineLine(context, token))802            {803                EndRule(context, RuleType.Step);804                EndRule(context, RuleType.Background);805                StartRule(context, RuleType.Scenario_Definition);806                StartRule(context, RuleType.ScenarioOutline);807                Build(context, token);808                return 14;809            }810            if (Match_Comment(context, token))811            {812                Build(context, token);813                return 7;814            }815            if (Match_Empty(context, token))816            {817                Build(context, token);818                return 7;819            }820            821            const string stateComment = "State: 7 - GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:0>#StepLine:0";822            token.Detach();823            var expectedTokens = new string[] {"#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"};824            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 825                : new UnexpectedTokenException(token, expectedTokens, stateComment);826            if (StopAtFirstError)827                throw error;828            829            AddError(context, error);830            return 7;831        }832        833        834        // GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0835        int MatchTokenAt_8(Token token, ParserContext context)836        {837            if (Match_EOF(context, token))838            {839                EndRule(context, RuleType.DataTable);840                EndRule(context, RuleType.Step);841                EndRule(context, RuleType.Background);842                EndRule(context, RuleType.Feature);843                Build(context, token);844                return 22;845            }846            if (Match_TableRow(context, token))847            {848                Build(context, token);849                return 8;850            }851            if (Match_StepLine(context, token))852            {853                EndRule(context, RuleType.DataTable);854                EndRule(context, RuleType.Step);855                StartRule(context, RuleType.Step);856                Build(context, token);857                return 7;858            }859            if (Match_TagLine(context, token))860            {861                EndRule(context, RuleType.DataTable);862                EndRule(context, RuleType.Step);863                EndRule(context, RuleType.Background);864                StartRule(context, RuleType.Scenario_Definition);865                StartRule(context, RuleType.Tags);866                Build(context, token);867                return 9;868            }869            if (Match_ScenarioLine(context, token))870            {871                EndRule(context, RuleType.DataTable);872                EndRule(context, RuleType.Step);873                EndRule(context, RuleType.Background);874                StartRule(context, RuleType.Scenario_Definition);875                StartRule(context, RuleType.Scenario);876                Build(context, token);877                return 10;878            }879            if (Match_ScenarioOutlineLine(context, token))880            {881                EndRule(context, RuleType.DataTable);882                EndRule(context, RuleType.Step);883                EndRule(context, RuleType.Background);884                StartRule(context, RuleType.Scenario_Definition);885                StartRule(context, RuleType.ScenarioOutline);886                Build(context, token);887                return 14;888            }889            if (Match_Comment(context, token))890            {891                Build(context, token);892                return 8;893            }894            if (Match_Empty(context, token))895            {896                Build(context, token);897                return 8;898            }899            900            const string stateComment = "State: 8 - GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0";901            token.Detach();902            var expectedTokens = new string[] {"#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"};903            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 904                : new UnexpectedTokenException(token, expectedTokens, stateComment);905            if (StopAtFirstError)906                throw error;907            908            AddError(context, error);909            return 8;910        }911        912        913        // GherkinDocument:0>Feature:2>Scenario_Definition:0>Tags:0>#TagLine:0914        int MatchTokenAt_9(Token token, ParserContext context)915        {916            if (Match_TagLine(context, token))917            {918                Build(context, token);919                return 9;920            }921            if (Match_ScenarioLine(context, token))922            {923                EndRule(context, RuleType.Tags);924                StartRule(context, RuleType.Scenario);925                Build(context, token);926                return 10;927            }928            if (Match_ScenarioOutlineLine(context, token))929            {930                EndRule(context, RuleType.Tags);931                StartRule(context, RuleType.ScenarioOutline);932                Build(context, token);933                return 14;934            }935            if (Match_Comment(context, token))936            {937                Build(context, token);938                return 9;939            }940            if (Match_Empty(context, token))941            {942                Build(context, token);943                return 9;944            }945            946            const string stateComment = "State: 9 - GherkinDocument:0>Feature:2>Scenario_Definition:0>Tags:0>#TagLine:0";947            token.Detach();948            var expectedTokens = new string[] {"#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"};949            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 950                : new UnexpectedTokenException(token, expectedTokens, stateComment);951            if (StopAtFirstError)952                throw error;953            954            AddError(context, error);955            return 9;956        }957        958        959        // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:0>#ScenarioLine:0960        int MatchTokenAt_10(Token token, ParserContext context)961        {962            if (Match_EOF(context, token))963            {964                EndRule(context, RuleType.Scenario);965                EndRule(context, RuleType.Scenario_Definition);966                EndRule(context, RuleType.Feature);967                Build(context, token);968                return 22;969            }970            if (Match_Empty(context, token))971            {972                Build(context, token);973                return 10;974            }975            if (Match_Comment(context, token))976            {977                StartRule(context, RuleType.Description);978                Build(context, token);979                return 11;980            }981            if (Match_StepLine(context, token))982            {983                StartRule(context, RuleType.Step);984                Build(context, token);985                return 12;986            }987            if (Match_TagLine(context, token))988            {989                EndRule(context, RuleType.Scenario);990                EndRule(context, RuleType.Scenario_Definition);991                StartRule(context, RuleType.Scenario_Definition);992                StartRule(context, RuleType.Tags);993                Build(context, token);994                return 9;995            }996            if (Match_ScenarioLine(context, token))997            {998                EndRule(context, RuleType.Scenario);999                EndRule(context, RuleType.Scenario_Definition);1000                StartRule(context, RuleType.Scenario_Definition);1001                StartRule(context, RuleType.Scenario);1002                Build(context, token);1003                return 10;1004            }1005            if (Match_ScenarioOutlineLine(context, token))1006            {1007                EndRule(context, RuleType.Scenario);1008                EndRule(context, RuleType.Scenario_Definition);1009                StartRule(context, RuleType.Scenario_Definition);1010                StartRule(context, RuleType.ScenarioOutline);1011                Build(context, token);1012                return 14;1013            }1014            if (Match_Other(context, token))1015            {1016                StartRule(context, RuleType.Description);1017                Build(context, token);1018                return 11;1019            }1020            1021            const string stateComment = "State: 10 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:0>#ScenarioLine:0";1022            token.Detach();1023            var expectedTokens = new string[] {"#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"};1024            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 1025                : new UnexpectedTokenException(token, expectedTokens, stateComment);1026            if (StopAtFirstError)1027                throw error;1028            1029            AddError(context, error);1030            return 10;1031        }1032        1033        1034        // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:1>Description:0>__alt2:0>#Other:01035        int MatchTokenAt_11(Token token, ParserContext context)1036        {1037            if (Match_EOF(context, token))1038            {1039                EndRule(context, RuleType.Description);1040                EndRule(context, RuleType.Scenario);1041                EndRule(context, RuleType.Scenario_Definition);1042                EndRule(context, RuleType.Feature);1043                Build(context, token);1044                return 22;1045            }1046            if (Match_Comment(context, token))1047            {1048                Build(context, token);1049                return 11;1050            }1051            if (Match_StepLine(context, token))1052            {1053                EndRule(context, RuleType.Description);1054                StartRule(context, RuleType.Step);1055                Build(context, token);1056                return 12;1057            }1058            if (Match_TagLine(context, token))1059            {1060                EndRule(context, RuleType.Description);1061                EndRule(context, RuleType.Scenario);1062                EndRule(context, RuleType.Scenario_Definition);1063                StartRule(context, RuleType.Scenario_Definition);1064                StartRule(context, RuleType.Tags);1065                Build(context, token);1066                return 9;1067            }1068            if (Match_ScenarioLine(context, token))1069            {1070                EndRule(context, RuleType.Description);1071                EndRule(context, RuleType.Scenario);1072                EndRule(context, RuleType.Scenario_Definition);1073                StartRule(context, RuleType.Scenario_Definition);1074                StartRule(context, RuleType.Scenario);1075                Build(context, token);1076                return 10;1077            }1078            if (Match_ScenarioOutlineLine(context, token))1079            {1080                EndRule(context, RuleType.Description);1081                EndRule(context, RuleType.Scenario);1082                EndRule(context, RuleType.Scenario_Definition);1083                StartRule(context, RuleType.Scenario_Definition);1084                StartRule(context, RuleType.ScenarioOutline);1085                Build(context, token);1086                return 14;1087            }1088            if (Match_Other(context, token))1089            {1090                Build(context, token);1091                return 11;1092            }1093            1094            const string stateComment = "State: 11 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:1>Description:0>__alt2:0>#Other:0";1095            token.Detach();1096            var expectedTokens = new string[] {"#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"};1097            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 1098                : new UnexpectedTokenException(token, expectedTokens, stateComment);1099            if (StopAtFirstError)1100                throw error;1101            1102            AddError(context, error);1103            return 11;1104        }1105        1106        1107        // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:0>#StepLine:01108        int MatchTokenAt_12(Token token, ParserContext context)1109        {1110            if (Match_EOF(context, token))1111            {1112                EndRule(context, RuleType.Step);1113                EndRule(context, RuleType.Scenario);1114                EndRule(context, RuleType.Scenario_Definition);1115                EndRule(context, RuleType.Feature);1116                Build(context, token);1117                return 22;1118            }1119            if (Match_TableRow(context, token))1120            {1121                StartRule(context, RuleType.DataTable);1122                Build(context, token);1123                return 13;1124            }1125            if (Match_DocStringSeparator(context, token))1126            {1127                StartRule(context, RuleType.DocString);1128                Build(context, token);1129                return 25;1130            }1131            if (Match_StepLine(context, token))1132            {1133                EndRule(context, RuleType.Step);1134                StartRule(context, RuleType.Step);1135                Build(context, token);1136                return 12;1137            }1138            if (Match_TagLine(context, token))1139            {1140                EndRule(context, RuleType.Step);1141                EndRule(context, RuleType.Scenario);1142                EndRule(context, RuleType.Scenario_Definition);1143                StartRule(context, RuleType.Scenario_Definition);1144                StartRule(context, RuleType.Tags);1145                Build(context, token);1146                return 9;1147            }1148            if (Match_ScenarioLine(context, token))1149            {1150                EndRule(context, RuleType.Step);1151                EndRule(context, RuleType.Scenario);1152                EndRule(context, RuleType.Scenario_Definition);1153                StartRule(context, RuleType.Scenario_Definition);1154                StartRule(context, RuleType.Scenario);1155                Build(context, token);1156                return 10;1157            }1158            if (Match_ScenarioOutlineLine(context, token))1159            {1160                EndRule(context, RuleType.Step);1161                EndRule(context, RuleType.Scenario);1162                EndRule(context, RuleType.Scenario_Definition);1163                StartRule(context, RuleType.Scenario_Definition);1164                StartRule(context, RuleType.ScenarioOutline);1165                Build(context, token);1166                return 14;1167            }1168            if (Match_Comment(context, token))1169            {1170                Build(context, token);1171                return 12;1172            }1173            if (Match_Empty(context, token))1174            {1175                Build(context, token);1176                return 12;1177            }1178            1179            const string stateComment = "State: 12 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:0>#StepLine:0";1180            token.Detach();1181            var expectedTokens = new string[] {"#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"};1182            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 1183                : new UnexpectedTokenException(token, expectedTokens, stateComment);1184            if (StopAtFirstError)1185                throw error;1186            1187            AddError(context, error);1188            return 12;1189        }1190        1191        1192        // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:01193        int MatchTokenAt_13(Token token, ParserContext context)1194        {1195            if (Match_EOF(context, token))1196            {1197                EndRule(context, RuleType.DataTable);1198                EndRule(context, RuleType.Step);1199                EndRule(context, RuleType.Scenario);1200                EndRule(context, RuleType.Scenario_Definition);1201                EndRule(context, RuleType.Feature);1202                Build(context, token);1203                return 22;1204            }1205            if (Match_TableRow(context, token))1206            {1207                Build(context, token);1208                return 13;1209            }1210            if (Match_StepLine(context, token))1211            {1212                EndRule(context, RuleType.DataTable);1213                EndRule(context, RuleType.Step);1214                StartRule(context, RuleType.Step);1215                Build(context, token);1216                return 12;1217            }1218            if (Match_TagLine(context, token))1219            {1220                EndRule(context, RuleType.DataTable);1221                EndRule(context, RuleType.Step);1222                EndRule(context, RuleType.Scenario);1223                EndRule(context, RuleType.Scenario_Definition);1224                StartRule(context, RuleType.Scenario_Definition);1225                StartRule(context, RuleType.Tags);1226                Build(context, token);1227                return 9;1228            }1229            if (Match_ScenarioLine(context, token))1230            {1231                EndRule(context, RuleType.DataTable);1232                EndRule(context, RuleType.Step);1233                EndRule(context, RuleType.Scenario);1234                EndRule(context, RuleType.Scenario_Definition);1235                StartRule(context, RuleType.Scenario_Definition);1236                StartRule(context, RuleType.Scenario);1237                Build(context, token);1238                return 10;1239            }1240            if (Match_ScenarioOutlineLine(context, token))1241            {1242                EndRule(context, RuleType.DataTable);1243                EndRule(context, RuleType.Step);1244                EndRule(context, RuleType.Scenario);1245                EndRule(context, RuleType.Scenario_Definition);1246                StartRule(context, RuleType.Scenario_Definition);1247                StartRule(context, RuleType.ScenarioOutline);1248                Build(context, token);1249                return 14;1250            }1251            if (Match_Comment(context, token))1252            {1253                Build(context, token);1254                return 13;1255            }1256            if (Match_Empty(context, token))1257            {1258                Build(context, token);1259                return 13;1260            }1261            1262            const string stateComment = "State: 13 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0";1263            token.Detach();1264            var expectedTokens = new string[] {"#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"};1265            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 1266                : new UnexpectedTokenException(token, expectedTokens, stateComment);1267            if (StopAtFirstError)1268                throw error;1269            1270            AddError(context, error);1271            return 13;1272        }1273        1274        1275        // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:0>#ScenarioOutlineLine:01276        int MatchTokenAt_14(Token token, ParserContext context)1277        {1278            if (Match_EOF(context, token))1279            {1280                EndRule(context, RuleType.ScenarioOutline);1281                EndRule(context, RuleType.Scenario_Definition);1282                EndRule(context, RuleType.Feature);1283                Build(context, token);1284                return 22;1285            }1286            if (Match_Empty(context, token))1287            {1288                Build(context, token);1289                return 14;1290            }1291            if (Match_Comment(context, token))1292            {1293                StartRule(context, RuleType.Description);1294                Build(context, token);1295                return 15;1296            }1297            if (Match_StepLine(context, token))1298            {1299                StartRule(context, RuleType.Step);1300                Build(context, token);1301                return 16;1302            }1303            if (Match_TagLine(context, token))1304            {1305                if (LookAhead_0(context, token))1306                {1307                StartRule(context, RuleType.Examples_Definition);1308                StartRule(context, RuleType.Tags);1309                Build(context, token);1310                return 18;1311                }1312            }1313            if (Match_TagLine(context, token))1314            {1315                EndRule(context, RuleType.ScenarioOutline);1316                EndRule(context, RuleType.Scenario_Definition);1317                StartRule(context, RuleType.Scenario_Definition);1318                StartRule(context, RuleType.Tags);1319                Build(context, token);1320                return 9;1321            }1322            if (Match_ExamplesLine(context, token))1323            {1324                StartRule(context, RuleType.Examples_Definition);1325                StartRule(context, RuleType.Examples);1326                Build(context, token);1327                return 19;1328            }1329            if (Match_ScenarioLine(context, token))1330            {1331                EndRule(context, RuleType.ScenarioOutline);1332                EndRule(context, RuleType.Scenario_Definition);1333                StartRule(context, RuleType.Scenario_Definition);1334                StartRule(context, RuleType.Scenario);1335                Build(context, token);1336                return 10;1337            }1338            if (Match_ScenarioOutlineLine(context, token))1339            {1340                EndRule(context, RuleType.ScenarioOutline);1341                EndRule(context, RuleType.Scenario_Definition);1342                StartRule(context, RuleType.Scenario_Definition);1343                StartRule(context, RuleType.ScenarioOutline);1344                Build(context, token);1345                return 14;1346            }1347            if (Match_Other(context, token))1348            {1349                StartRule(context, RuleType.Description);1350                Build(context, token);1351                return 15;1352            }1353            1354            const string stateComment = "State: 14 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:0>#ScenarioOutlineLine:0";1355            token.Detach();1356            var expectedTokens = new string[] {"#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"};1357            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 1358                : new UnexpectedTokenException(token, expectedTokens, stateComment);1359            if (StopAtFirstError)1360                throw error;1361            1362            AddError(context, error);1363            return 14;1364        }1365        1366        1367        // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:1>Description:0>__alt2:0>#Other:01368        int MatchTokenAt_15(Token token, ParserContext context)1369        {1370            if (Match_EOF(context, token))1371            {1372                EndRule(context, RuleType.Description);1373                EndRule(context, RuleType.ScenarioOutline);1374                EndRule(context, RuleType.Scenario_Definition);1375                EndRule(context, RuleType.Feature);1376                Build(context, token);1377                return 22;1378            }1379            if (Match_Comment(context, token))1380            {1381                Build(context, token);1382                return 15;1383            }1384            if (Match_StepLine(context, token))1385            {1386                EndRule(context, RuleType.Description);1387                StartRule(context, RuleType.Step);1388                Build(context, token);1389                return 16;1390            }1391            if (Match_TagLine(context, token))1392            {1393                if (LookAhead_0(context, token))1394                {1395                EndRule(context, RuleType.Description);1396                StartRule(context, RuleType.Examples_Definition);1397                StartRule(context, RuleType.Tags);1398                Build(context, token);1399                return 18;1400                }1401            }1402            if (Match_TagLine(context, token))1403            {1404                EndRule(context, RuleType.Description);1405                EndRule(context, RuleType.ScenarioOutline);1406                EndRule(context, RuleType.Scenario_Definition);1407                StartRule(context, RuleType.Scenario_Definition);1408                StartRule(context, RuleType.Tags);1409                Build(context, token);1410                return 9;1411            }1412            if (Match_ExamplesLine(context, token))1413            {1414                EndRule(context, RuleType.Description);1415                StartRule(context, RuleType.Examples_Definition);1416                StartRule(context, RuleType.Examples);1417                Build(context, token);1418                return 19;1419            }1420            if (Match_ScenarioLine(context, token))1421            {1422                EndRule(context, RuleType.Description);1423                EndRule(context, RuleType.ScenarioOutline);1424                EndRule(context, RuleType.Scenario_Definition);1425                StartRule(context, RuleType.Scenario_Definition);1426                StartRule(context, RuleType.Scenario);1427                Build(context, token);1428                return 10;1429            }1430            if (Match_ScenarioOutlineLine(context, token))1431            {1432                EndRule(context, RuleType.Description);1433                EndRule(context, RuleType.ScenarioOutline);1434                EndRule(context, RuleType.Scenario_Definition);1435                StartRule(context, RuleType.Scenario_Definition);1436                StartRule(context, RuleType.ScenarioOutline);1437                Build(context, token);1438                return 14;1439            }1440            if (Match_Other(context, token))1441            {1442                Build(context, token);1443                return 15;1444            }1445            1446            const string stateComment = "State: 15 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:1>Description:0>__alt2:0>#Other:0";1447            token.Detach();1448            var expectedTokens = new string[] {"#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"};1449            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 1450                : new UnexpectedTokenException(token, expectedTokens, stateComment);1451            if (StopAtFirstError)1452                throw error;1453            1454            AddError(context, error);1455            return 15;1456        }1457        1458        1459        // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:0>#StepLine:01460        int MatchTokenAt_16(Token token, ParserContext context)1461        {1462            if (Match_EOF(context, token))1463            {1464                EndRule(context, RuleType.Step);1465                EndRule(context, RuleType.ScenarioOutline);1466                EndRule(context, RuleType.Scenario_Definition);1467                EndRule(context, RuleType.Feature);1468                Build(context, token);1469                return 22;1470            }1471            if (Match_TableRow(context, token))1472            {1473                StartRule(context, RuleType.DataTable);1474                Build(context, token);1475                return 17;1476            }1477            if (Match_DocStringSeparator(context, token))1478            {1479                StartRule(context, RuleType.DocString);1480                Build(context, token);1481                return 23;1482            }1483            if (Match_StepLine(context, token))1484            {1485                EndRule(context, RuleType.Step);1486                StartRule(context, RuleType.Step);1487                Build(context, token);1488                return 16;1489            }1490            if (Match_TagLine(context, token))1491            {1492                if (LookAhead_0(context, token))1493                {1494                EndRule(context, RuleType.Step);1495                StartRule(context, RuleType.Examples_Definition);1496                StartRule(context, RuleType.Tags);1497                Build(context, token);1498                return 18;1499                }1500            }1501            if (Match_TagLine(context, token))1502            {1503                EndRule(context, RuleType.Step);1504                EndRule(context, RuleType.ScenarioOutline);1505                EndRule(context, RuleType.Scenario_Definition);1506                StartRule(context, RuleType.Scenario_Definition);1507                StartRule(context, RuleType.Tags);1508                Build(context, token);1509                return 9;1510            }1511            if (Match_ExamplesLine(context, token))1512            {1513                EndRule(context, RuleType.Step);1514                StartRule(context, RuleType.Examples_Definition);1515                StartRule(context, RuleType.Examples);1516                Build(context, token);1517                return 19;1518            }1519            if (Match_ScenarioLine(context, token))1520            {1521                EndRule(context, RuleType.Step);1522                EndRule(context, RuleType.ScenarioOutline);1523                EndRule(context, RuleType.Scenario_Definition);1524                StartRule(context, RuleType.Scenario_Definition);1525                StartRule(context, RuleType.Scenario);1526                Build(context, token);1527                return 10;1528            }1529            if (Match_ScenarioOutlineLine(context, token))1530            {1531                EndRule(context, RuleType.Step);1532                EndRule(context, RuleType.ScenarioOutline);1533                EndRule(context, RuleType.Scenario_Definition);1534                StartRule(context, RuleType.Scenario_Definition);1535                StartRule(context, RuleType.ScenarioOutline);1536                Build(context, token);1537                return 14;1538            }1539            if (Match_Comment(context, token))1540            {1541                Build(context, token);1542                return 16;1543            }1544            if (Match_Empty(context, token))1545            {1546                Build(context, token);1547                return 16;1548            }1549            1550            const string stateComment = "State: 16 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:0>#StepLine:0";1551            token.Detach();1552            var expectedTokens = new string[] {"#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"};1553            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 1554                : new UnexpectedTokenException(token, expectedTokens, stateComment);1555            if (StopAtFirstError)1556                throw error;1557            1558            AddError(context, error);1559            return 16;1560        }1561        1562        1563        // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:01564        int MatchTokenAt_17(Token token, ParserContext context)1565        {1566            if (Match_EOF(context, token))1567            {1568                EndRule(context, RuleType.DataTable);1569                EndRule(context, RuleType.Step);1570                EndRule(context, RuleType.ScenarioOutline);1571                EndRule(context, RuleType.Scenario_Definition);1572                EndRule(context, RuleType.Feature);1573                Build(context, token);1574                return 22;1575            }1576            if (Match_TableRow(context, token))1577            {1578                Build(context, token);1579                return 17;1580            }1581            if (Match_StepLine(context, token))1582            {1583                EndRule(context, RuleType.DataTable);1584                EndRule(context, RuleType.Step);1585                StartRule(context, RuleType.Step);1586                Build(context, token);1587                return 16;1588            }1589            if (Match_TagLine(context, token))1590            {1591                if (LookAhead_0(context, token))1592                {1593                EndRule(context, RuleType.DataTable);1594                EndRule(context, RuleType.Step);1595                StartRule(context, RuleType.Examples_Definition);1596                StartRule(context, RuleType.Tags);1597                Build(context, token);1598                return 18;1599                }1600            }1601            if (Match_TagLine(context, token))1602            {1603                EndRule(context, RuleType.DataTable);1604                EndRule(context, RuleType.Step);1605                EndRule(context, RuleType.ScenarioOutline);1606                EndRule(context, RuleType.Scenario_Definition);1607                StartRule(context, RuleType.Scenario_Definition);1608                StartRule(context, RuleType.Tags);1609                Build(context, token);1610                return 9;1611            }1612            if (Match_ExamplesLine(context, token))1613            {1614                EndRule(context, RuleType.DataTable);1615                EndRule(context, RuleType.Step);1616                StartRule(context, RuleType.Examples_Definition);1617                StartRule(context, RuleType.Examples);1618                Build(context, token);1619                return 19;1620            }1621            if (Match_ScenarioLine(context, token))1622            {1623                EndRule(context, RuleType.DataTable);1624                EndRule(context, RuleType.Step);1625                EndRule(context, RuleType.ScenarioOutline);1626                EndRule(context, RuleType.Scenario_Definition);1627                StartRule(context, RuleType.Scenario_Definition);1628                StartRule(context, RuleType.Scenario);1629                Build(context, token);1630                return 10;1631            }1632            if (Match_ScenarioOutlineLine(context, token))1633            {1634                EndRule(context, RuleType.DataTable);1635                EndRule(context, RuleType.Step);1636                EndRule(context, RuleType.ScenarioOutline);1637                EndRule(context, RuleType.Scenario_Definition);1638                StartRule(context, RuleType.Scenario_Definition);1639                StartRule(context, RuleType.ScenarioOutline);1640                Build(context, token);1641                return 14;1642            }1643            if (Match_Comment(context, token))1644            {1645                Build(context, token);1646                return 17;1647            }1648            if (Match_Empty(context, token))1649            {1650                Build(context, token);1651                return 17;1652            }1653            1654            const string stateComment = "State: 17 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0";1655            token.Detach();1656            var expectedTokens = new string[] {"#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"};1657            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 1658                : new UnexpectedTokenException(token, expectedTokens, stateComment);1659            if (StopAtFirstError)1660                throw error;1661            1662            AddError(context, error);1663            return 17;1664        }1665        1666        1667        // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:0>Tags:0>#TagLine:01668        int MatchTokenAt_18(Token token, ParserContext context)1669        {1670            if (Match_TagLine(context, token))1671            {1672                Build(context, token);1673                return 18;1674            }1675            if (Match_ExamplesLine(context, token))1676            {1677                EndRule(context, RuleType.Tags);1678                StartRule(context, RuleType.Examples);1679                Build(context, token);1680                return 19;1681            }1682            if (Match_Comment(context, token))1683            {1684                Build(context, token);1685                return 18;1686            }1687            if (Match_Empty(context, token))1688            {1689                Build(context, token);1690                return 18;1691            }1692            1693            const string stateComment = "State: 18 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:0>Tags:0>#TagLine:0";1694            token.Detach();1695            var expectedTokens = new string[] {"#TagLine", "#ExamplesLine", "#Comment", "#Empty"};1696            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 1697                : new UnexpectedTokenException(token, expectedTokens, stateComment);1698            if (StopAtFirstError)1699                throw error;1700            1701            AddError(context, error);1702            return 18;1703        }1704        1705        1706        // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:0>#ExamplesLine:01707        int MatchTokenAt_19(Token token, ParserContext context)1708        {1709            if (Match_EOF(context, token))1710            {1711                EndRule(context, RuleType.Examples);1712                EndRule(context, RuleType.Examples_Definition);1713                EndRule(context, RuleType.ScenarioOutline);1714                EndRule(context, RuleType.Scenario_Definition);1715                EndRule(context, RuleType.Feature);1716                Build(context, token);1717                return 22;1718            }1719            if (Match_Empty(context, token))1720            {1721                Build(context, token);1722                return 19;1723            }1724            if (Match_Comment(context, token))1725            {1726                StartRule(context, RuleType.Description);1727                Build(context, token);1728                return 20;1729            }1730            if (Match_TableRow(context, token))1731            {1732                StartRule(context, RuleType.Examples_Table);1733                Build(context, token);1734                return 21;1735            }1736            if (Match_TagLine(context, token))1737            {1738                if (LookAhead_0(context, token))1739                {1740                EndRule(context, RuleType.Examples);1741                EndRule(context, RuleType.Examples_Definition);1742                StartRule(context, RuleType.Examples_Definition);1743                StartRule(context, RuleType.Tags);1744                Build(context, token);1745                return 18;1746                }1747            }1748            if (Match_TagLine(context, token))1749            {1750                EndRule(context, RuleType.Examples);1751                EndRule(context, RuleType.Examples_Definition);1752                EndRule(context, RuleType.ScenarioOutline);1753                EndRule(context, RuleType.Scenario_Definition);1754                StartRule(context, RuleType.Scenario_Definition);1755                StartRule(context, RuleType.Tags);1756                Build(context, token);1757                return 9;1758            }1759            if (Match_ExamplesLine(context, token))1760            {1761                EndRule(context, RuleType.Examples);1762                EndRule(context, RuleType.Examples_Definition);1763                StartRule(context, RuleType.Examples_Definition);1764                StartRule(context, RuleType.Examples);1765                Build(context, token);1766                return 19;1767            }1768            if (Match_ScenarioLine(context, token))1769            {1770                EndRule(context, RuleType.Examples);1771                EndRule(context, RuleType.Examples_Definition);1772                EndRule(context, RuleType.ScenarioOutline);1773                EndRule(context, RuleType.Scenario_Definition);1774                StartRule(context, RuleType.Scenario_Definition);1775                StartRule(context, RuleType.Scenario);1776                Build(context, token);1777                return 10;1778            }1779            if (Match_ScenarioOutlineLine(context, token))1780            {1781                EndRule(context, RuleType.Examples);1782                EndRule(context, RuleType.Examples_Definition);1783                EndRule(context, RuleType.ScenarioOutline);1784                EndRule(context, RuleType.Scenario_Definition);1785                StartRule(context, RuleType.Scenario_Definition);1786                StartRule(context, RuleType.ScenarioOutline);1787                Build(context, token);1788                return 14;1789            }1790            if (Match_Other(context, token))1791            {1792                StartRule(context, RuleType.Description);1793                Build(context, token);1794                return 20;1795            }1796            1797            const string stateComment = "State: 19 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:0>#ExamplesLine:0";1798            token.Detach();1799            var expectedTokens = new string[] {"#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"};1800            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 1801                : new UnexpectedTokenException(token, expectedTokens, stateComment);1802            if (StopAtFirstError)1803                throw error;1804            1805            AddError(context, error);1806            return 19;1807        }1808        1809        1810        // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Examples_Description:0>Description_Helper:1>Description:0>__alt2:0>#Other:01811        int MatchTokenAt_20(Token token, ParserContext context)1812        {1813            if (Match_EOF(context, token))1814            {1815                EndRule(context, RuleType.Description);1816                EndRule(context, RuleType.Examples);1817                EndRule(context, RuleType.Examples_Definition);1818                EndRule(context, RuleType.ScenarioOutline);1819                EndRule(context, RuleType.Scenario_Definition);1820                EndRule(context, RuleType.Feature);1821                Build(context, token);1822                return 22;1823            }1824            if (Match_Comment(context, token))1825            {1826                Build(context, token);1827                return 20;1828            }1829            if (Match_TableRow(context, token))1830            {1831                EndRule(context, RuleType.Description);1832                StartRule(context, RuleType.Examples_Table);1833                Build(context, token);1834                return 21;1835            }1836            if (Match_TagLine(context, token))1837            {1838                if (LookAhead_0(context, token))1839                {1840                EndRule(context, RuleType.Description);1841                EndRule(context, RuleType.Examples);1842                EndRule(context, RuleType.Examples_Definition);1843                StartRule(context, RuleType.Examples_Definition);1844                StartRule(context, RuleType.Tags);1845                Build(context, token);1846                return 18;1847                }1848            }1849            if (Match_TagLine(context, token))1850            {1851                EndRule(context, RuleType.Description);1852                EndRule(context, RuleType.Examples);1853                EndRule(context, RuleType.Examples_Definition);1854                EndRule(context, RuleType.ScenarioOutline);1855                EndRule(context, RuleType.Scenario_Definition);1856                StartRule(context, RuleType.Scenario_Definition);1857                StartRule(context, RuleType.Tags);1858                Build(context, token);1859                return 9;1860            }1861            if (Match_ExamplesLine(context, token))1862            {1863                EndRule(context, RuleType.Description);1864                EndRule(context, RuleType.Examples);1865                EndRule(context, RuleType.Examples_Definition);1866                StartRule(context, RuleType.Examples_Definition);1867                StartRule(context, RuleType.Examples);1868                Build(context, token);1869                return 19;1870            }1871            if (Match_ScenarioLine(context, token))1872            {1873                EndRule(context, RuleType.Description);1874                EndRule(context, RuleType.Examples);1875                EndRule(context, RuleType.Examples_Definition);1876                EndRule(context, RuleType.ScenarioOutline);1877                EndRule(context, RuleType.Scenario_Definition);1878                StartRule(context, RuleType.Scenario_Definition);1879                StartRule(context, RuleType.Scenario);1880                Build(context, token);1881                return 10;1882            }1883            if (Match_ScenarioOutlineLine(context, token))1884            {1885                EndRule(context, RuleType.Description);1886                EndRule(context, RuleType.Examples);1887                EndRule(context, RuleType.Examples_Definition);1888                EndRule(context, RuleType.ScenarioOutline);1889                EndRule(context, RuleType.Scenario_Definition);1890                StartRule(context, RuleType.Scenario_Definition);1891                StartRule(context, RuleType.ScenarioOutline);1892                Build(context, token);1893                return 14;1894            }1895            if (Match_Other(context, token))1896            {1897                Build(context, token);1898                return 20;1899            }1900            1901            const string stateComment = "State: 20 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Examples_Description:0>Description_Helper:1>Description:0>__alt2:0>#Other:0";1902            token.Detach();1903            var expectedTokens = new string[] {"#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"};1904            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 1905                : new UnexpectedTokenException(token, expectedTokens, stateComment);1906            if (StopAtFirstError)1907                throw error;1908            1909            AddError(context, error);1910            return 20;1911        }1912        1913        1914        // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:2>Examples_Table:0>#TableRow:01915        int MatchTokenAt_21(Token token, ParserContext context)1916        {1917            if (Match_EOF(context, token))1918            {1919                EndRule(context, RuleType.Examples_Table);1920                EndRule(context, RuleType.Examples);1921                EndRule(context, RuleType.Examples_Definition);1922                EndRule(context, RuleType.ScenarioOutline);1923                EndRule(context, RuleType.Scenario_Definition);1924                EndRule(context, RuleType.Feature);1925                Build(context, token);1926                return 22;1927            }1928            if (Match_TableRow(context, token))1929            {1930                Build(context, token);1931                return 21;1932            }1933            if (Match_TagLine(context, token))1934            {1935                if (LookAhead_0(context, token))1936                {1937                EndRule(context, RuleType.Examples_Table);1938                EndRule(context, RuleType.Examples);1939                EndRule(context, RuleType.Examples_Definition);1940                StartRule(context, RuleType.Examples_Definition);1941                StartRule(context, RuleType.Tags);1942                Build(context, token);1943                return 18;1944                }1945            }1946            if (Match_TagLine(context, token))1947            {1948                EndRule(context, RuleType.Examples_Table);1949                EndRule(context, RuleType.Examples);1950                EndRule(context, RuleType.Examples_Definition);1951                EndRule(context, RuleType.ScenarioOutline);1952                EndRule(context, RuleType.Scenario_Definition);1953                StartRule(context, RuleType.Scenario_Definition);1954                StartRule(context, RuleType.Tags);1955                Build(context, token);1956                return 9;1957            }1958            if (Match_ExamplesLine(context, token))1959            {1960                EndRule(context, RuleType.Examples_Table);1961                EndRule(context, RuleType.Examples);1962                EndRule(context, RuleType.Examples_Definition);1963                StartRule(context, RuleType.Examples_Definition);1964                StartRule(context, RuleType.Examples);1965                Build(context, token);1966                return 19;1967            }1968            if (Match_ScenarioLine(context, token))1969            {1970                EndRule(context, RuleType.Examples_Table);1971                EndRule(context, RuleType.Examples);1972                EndRule(context, RuleType.Examples_Definition);1973                EndRule(context, RuleType.ScenarioOutline);1974                EndRule(context, RuleType.Scenario_Definition);1975                StartRule(context, RuleType.Scenario_Definition);1976                StartRule(context, RuleType.Scenario);1977                Build(context, token);1978                return 10;1979            }1980            if (Match_ScenarioOutlineLine(context, token))1981            {1982                EndRule(context, RuleType.Examples_Table);1983                EndRule(context, RuleType.Examples);1984                EndRule(context, RuleType.Examples_Definition);1985                EndRule(context, RuleType.ScenarioOutline);1986                EndRule(context, RuleType.Scenario_Definition);1987                StartRule(context, RuleType.Scenario_Definition);1988                StartRule(context, RuleType.ScenarioOutline);1989                Build(context, token);1990                return 14;1991            }1992            if (Match_Comment(context, token))1993            {1994                Build(context, token);1995                return 21;1996            }1997            if (Match_Empty(context, token))1998            {1999                Build(context, token);2000                return 21;2001            }2002            2003            const string stateComment = "State: 21 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:2>Examples_Table:0>#TableRow:0";2004            token.Detach();2005            var expectedTokens = new string[] {"#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"};2006            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 2007                : new UnexpectedTokenException(token, expectedTokens, stateComment);2008            if (StopAtFirstError)2009                throw error;2010            2011            AddError(context, error);2012            return 21;2013        }2014        2015        2016        // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:02017        int MatchTokenAt_23(Token token, ParserContext context)2018        {2019            if (Match_DocStringSeparator(context, token))2020            {2021                Build(context, token);2022                return 24;2023            }2024            if (Match_Other(context, token))2025            {2026                Build(context, token);2027                return 23;2028            }2029            2030            const string stateComment = "State: 23 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0";2031            token.Detach();2032            var expectedTokens = new string[] {"#DocStringSeparator", "#Other"};2033            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 2034                : new UnexpectedTokenException(token, expectedTokens, stateComment);2035            if (StopAtFirstError)2036                throw error;2037            2038            AddError(context, error);2039            return 23;2040        }2041        2042        2043        // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:02044        int MatchTokenAt_24(Token token, ParserContext context)2045        {2046            if (Match_EOF(context, token))2047            {2048                EndRule(context, RuleType.DocString);2049                EndRule(context, RuleType.Step);2050                EndRule(context, RuleType.ScenarioOutline);2051                EndRule(context, RuleType.Scenario_Definition);2052                EndRule(context, RuleType.Feature);2053                Build(context, token);2054                return 22;2055            }2056            if (Match_StepLine(context, token))2057            {2058                EndRule(context, RuleType.DocString);2059                EndRule(context, RuleType.Step);2060                StartRule(context, RuleType.Step);2061                Build(context, token);2062                return 16;2063            }2064            if (Match_TagLine(context, token))2065            {2066                if (LookAhead_0(context, token))2067                {2068                EndRule(context, RuleType.DocString);2069                EndRule(context, RuleType.Step);2070                StartRule(context, RuleType.Examples_Definition);2071                StartRule(context, RuleType.Tags);2072                Build(context, token);2073                return 18;2074                }2075            }2076            if (Match_TagLine(context, token))2077            {2078                EndRule(context, RuleType.DocString);2079                EndRule(context, RuleType.Step);2080                EndRule(context, RuleType.ScenarioOutline);2081                EndRule(context, RuleType.Scenario_Definition);2082                StartRule(context, RuleType.Scenario_Definition);2083                StartRule(context, RuleType.Tags);2084                Build(context, token);2085                return 9;2086            }2087            if (Match_ExamplesLine(context, token))2088            {2089                EndRule(context, RuleType.DocString);2090                EndRule(context, RuleType.Step);2091                StartRule(context, RuleType.Examples_Definition);2092                StartRule(context, RuleType.Examples);2093                Build(context, token);2094                return 19;2095            }2096            if (Match_ScenarioLine(context, token))2097            {2098                EndRule(context, RuleType.DocString);2099                EndRule(context, RuleType.Step);2100                EndRule(context, RuleType.ScenarioOutline);2101                EndRule(context, RuleType.Scenario_Definition);2102                StartRule(context, RuleType.Scenario_Definition);2103                StartRule(context, RuleType.Scenario);2104                Build(context, token);2105                return 10;2106            }2107            if (Match_ScenarioOutlineLine(context, token))2108            {2109                EndRule(context, RuleType.DocString);2110                EndRule(context, RuleType.Step);2111                EndRule(context, RuleType.ScenarioOutline);2112                EndRule(context, RuleType.Scenario_Definition);2113                StartRule(context, RuleType.Scenario_Definition);2114                StartRule(context, RuleType.ScenarioOutline);2115                Build(context, token);2116                return 14;2117            }2118            if (Match_Comment(context, token))2119            {2120                Build(context, token);2121                return 24;2122            }2123            if (Match_Empty(context, token))2124            {2125                Build(context, token);2126                return 24;2127            }2128            2129            const string stateComment = "State: 24 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0";2130            token.Detach();2131            var expectedTokens = new string[] {"#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"};2132            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 2133                : new UnexpectedTokenException(token, expectedTokens, stateComment);2134            if (StopAtFirstError)2135                throw error;2136            2137            AddError(context, error);2138            return 24;2139        }2140        2141        2142        // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:02143        int MatchTokenAt_25(Token token, ParserContext context)2144        {2145            if (Match_DocStringSeparator(context, token))2146            {2147                Build(context, token);2148                return 26;2149            }2150            if (Match_Other(context, token))2151            {2152                Build(context, token);2153                return 25;2154            }2155            2156            const string stateComment = "State: 25 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0";2157            token.Detach();2158            var expectedTokens = new string[] {"#DocStringSeparator", "#Other"};2159            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 2160                : new UnexpectedTokenException(token, expectedTokens, stateComment);2161            if (StopAtFirstError)2162                throw error;2163            2164            AddError(context, error);2165            return 25;2166        }2167        2168        2169        // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:02170        int MatchTokenAt_26(Token token, ParserContext context)2171        {2172            if (Match_EOF(context, token))2173            {2174                EndRule(context, RuleType.DocString);2175                EndRule(context, RuleType.Step);2176                EndRule(context, RuleType.Scenario);2177                EndRule(context, RuleType.Scenario_Definition);2178                EndRule(context, RuleType.Feature);2179                Build(context, token);2180                return 22;2181            }2182            if (Match_StepLine(context, token))2183            {2184                EndRule(context, RuleType.DocString);2185                EndRule(context, RuleType.Step);2186                StartRule(context, RuleType.Step);2187                Build(context, token);2188                return 12;2189            }2190            if (Match_TagLine(context, token))2191            {2192                EndRule(context, RuleType.DocString);2193                EndRule(context, RuleType.Step);2194                EndRule(context, RuleType.Scenario);2195                EndRule(context, RuleType.Scenario_Definition);2196                StartRule(context, RuleType.Scenario_Definition);2197                StartRule(context, RuleType.Tags);2198                Build(context, token);2199                return 9;2200            }2201            if (Match_ScenarioLine(context, token))2202            {2203                EndRule(context, RuleType.DocString);2204                EndRule(context, RuleType.Step);2205                EndRule(context, RuleType.Scenario);2206                EndRule(context, RuleType.Scenario_Definition);2207                StartRule(context, RuleType.Scenario_Definition);2208                StartRule(context, RuleType.Scenario);2209                Build(context, token);2210                return 10;2211            }2212            if (Match_ScenarioOutlineLine(context, token))2213            {2214                EndRule(context, RuleType.DocString);2215                EndRule(context, RuleType.Step);2216                EndRule(context, RuleType.Scenario);2217                EndRule(context, RuleType.Scenario_Definition);2218                StartRule(context, RuleType.Scenario_Definition);2219                StartRule(context, RuleType.ScenarioOutline);2220                Build(context, token);2221                return 14;2222            }2223            if (Match_Comment(context, token))2224            {2225                Build(context, token);2226                return 26;2227            }2228            if (Match_Empty(context, token))2229            {2230                Build(context, token);2231                return 26;2232            }2233            2234            const string stateComment = "State: 26 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0";2235            token.Detach();2236            var expectedTokens = new string[] {"#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"};2237            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 2238                : new UnexpectedTokenException(token, expectedTokens, stateComment);2239            if (StopAtFirstError)2240                throw error;2241            2242            AddError(context, error);2243            return 26;2244        }2245        2246        2247        // GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:02248        int MatchTokenAt_27(Token token, ParserContext context)2249        {2250            if (Match_DocStringSeparator(context, token))2251            {2252                Build(context, token);2253                return 28;2254            }2255            if (Match_Other(context, token))2256            {2257                Build(context, token);2258                return 27;2259            }2260            2261            const string stateComment = "State: 27 - GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0";2262            token.Detach();2263            var expectedTokens = new string[] {"#DocStringSeparator", "#Other"};2264            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 2265                : new UnexpectedTokenException(token, expectedTokens, stateComment);2266            if (StopAtFirstError)2267                throw error;2268            2269            AddError(context, error);2270            return 27;2271        }2272        2273        2274        // GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:02275        int MatchTokenAt_28(Token token, ParserContext context)2276        {2277            if (Match_EOF(context, token))2278            {2279                EndRule(context, RuleType.DocString);2280                EndRule(context, RuleType.Step);2281                EndRule(context, RuleType.Background);2282                EndRule(context, RuleType.Feature);2283                Build(context, token);2284                return 22;2285            }2286            if (Match_StepLine(context, token))2287            {2288                EndRule(context, RuleType.DocString);2289                EndRule(context, RuleType.Step);2290                StartRule(context, RuleType.Step);2291                Build(context, token);2292                return 7;2293            }2294            if (Match_TagLine(context, token))2295            {2296                EndRule(context, RuleType.DocString);2297                EndRule(context, RuleType.Step);2298                EndRule(context, RuleType.Background);2299                StartRule(context, RuleType.Scenario_Definition);2300                StartRule(context, RuleType.Tags);2301                Build(context, token);2302                return 9;2303            }2304            if (Match_ScenarioLine(context, token))2305            {2306                EndRule(context, RuleType.DocString);2307                EndRule(context, RuleType.Step);2308                EndRule(context, RuleType.Background);2309                StartRule(context, RuleType.Scenario_Definition);2310                StartRule(context, RuleType.Scenario);2311                Build(context, token);2312                return 10;2313            }2314            if (Match_ScenarioOutlineLine(context, token))2315            {2316                EndRule(context, RuleType.DocString);2317                EndRule(context, RuleType.Step);2318                EndRule(context, RuleType.Background);2319                StartRule(context, RuleType.Scenario_Definition);2320                StartRule(context, RuleType.ScenarioOutline);2321                Build(context, token);2322                return 14;2323            }2324            if (Match_Comment(context, token))2325            {2326                Build(context, token);2327                return 28;2328            }2329            if (Match_Empty(context, token))2330            {2331                Build(context, token);2332                return 28;2333            }2334            2335            const string stateComment = "State: 28 - GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0";2336            token.Detach();2337            var expectedTokens = new string[] {"#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"};2338            var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) 2339                : new UnexpectedTokenException(token, expectedTokens, stateComment);2340            if (StopAtFirstError)2341                throw error;2342            2343            AddError(context, error);2344            return 28;2345        }2346        2347        2348        bool LookAhead_0(ParserContext context, Token currentToken)2349        {2350            currentToken.Detach();2351            Token token;2352            var queue = new Queue<Token>();...

Full Screen

Full Screen

DeveroomGherkinParser.cs

Source:DeveroomGherkinParser.cs Github

copy

Full Screen

...275            try276            {277                parser.NullMatchToken(state, new Token(null, new Location()));278            }279            catch (UnexpectedEOFException ex)280            {281                return ex.ExpectedTokenTypes.Select(type => (TokenType)Enum.Parse(typeof(TokenType), type.TrimStart('#'))).ToArray();282            }283            return new TokenType[0];284        }285        #endregion286    }287}...

Full Screen

Full Screen

ParserException.cs

Source:ParserException.cs Github

copy

Full Screen

...92        {93        }94    }95    [Serializable]96    public class UnexpectedEOFException : TokenParserException97    {98        public string StateComment { get; private set; }99        public string[] ExpectedTokenTypes { get; private set; }100        public UnexpectedEOFException(Token receivedToken, string[] expectedTokenTypes, string stateComment)101            : base(GetMessage(expectedTokenTypes), receivedToken)102        {103            if (receivedToken == null) throw new ArgumentNullException("receivedToken");104            if (expectedTokenTypes == null) throw new ArgumentNullException("expectedTokenTypes");105            ExpectedTokenTypes = expectedTokenTypes;106            StateComment = stateComment;107        }108        private static string GetMessage(string[] expectedTokenTypes)109        {110            return string.Format("unexpected end of file, expected: {0}",111                string.Join(", ", expectedTokenTypes));112        }113        protected UnexpectedEOFException(SerializationInfo info, StreamingContext context) : base(info, context)114        {115        }116    }117    [Serializable]118    public class CompositeParserException : ParserException119    {120        public IEnumerable<ParserException> Errors { get; private set; }121        public CompositeParserException(ParserException[] errors)122            : base(GetMessage(errors))123        {124            if (errors == null) throw new ArgumentNullException("errors");125            Errors = errors;126        }127        private static string GetMessage(ParserException[] errors)...

Full Screen

Full Screen

ParserErrorSerializationTests.cs

Source:ParserErrorSerializationTests.cs Github

copy

Full Screen

...79            Assert.IsNull(deserializedException.StateComment);80        }8182        [Test]83        public void UnexpectedEOFExceptionShouldBeSerializableButOnlyMessageAndLocation()84        {85            var token = new Token(null, new Location(1, 2));86            var exception = new UnexpectedEOFException(token, new []{ "#T1", "#T2 "}, "state-comment");8788            var deserializedException = SerializeDeserialize(exception);8990            AssertMessageAndLocation(exception, deserializedException);9192            // the custom details are not serialized (yet?)93            Assert.IsNull(deserializedException.ExpectedTokenTypes);94            Assert.IsNull(deserializedException.StateComment);95        }9697        [Test]98        public void CompositeParserExceptionShouldBeSerializable()99        {100            var exception = new CompositeParserException(new ParserException[]
...

Full Screen

Full Screen

GherkinEditorParser.cs

Source:GherkinEditorParser.cs Github

copy

Full Screen

...131                    TokenQueue = new Queue<Token>(),132                    TokenScanner = new NullTokenScanner()133                });134            }135            catch (UnexpectedEOFException ex)136            {137                return ex.ExpectedTokenTypes.Select(type => (TokenType)Enum.Parse(typeof(TokenType), type.TrimStart('#'))).ToArray();138            }139            return new TokenType[0];140        }141    }142}...

Full Screen

Full Screen

UnexpectedEOFException

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using Gherkin;7{8    {9        static void Main(string[] args)10        {11            {12                var parser = new Parser();13                var feature = parser.Parse("Feature: Gherkin");14            }15            catch (UnexpectedEOFException ex)16            {17                Console.WriteLine(ex.Message);18            }19        }20    }21}

Full Screen

Full Screen

UnexpectedEOFException

Using AI Code Generation

copy

Full Screen

1using System;2using System.IO;3using Gherkin;4{5    {6        public UnexpectedEOFException(string message) : base(message)7        {8        }9    }10}11using System;12using System.IO;13using Gherkin;14{15    {16        public UnexpectedEOFException(string message) : base(message)17        {18        }19    }20}21using System;22using System.IO;23using Gherkin;24{25    {26        public UnexpectedEOFException(string message) : base(message)27        {28        }29    }30}31using System;32using System.IO;33using Gherkin;34{35    {36        public UnexpectedEOFException(string message) : base(message)37        {38        }39    }40}41using System;42using System.IO;43using Gherkin;44{45    {46        public UnexpectedEOFException(string message) : base(message)47        {48        }49    }50}51using System;52using System.IO;53using Gherkin;54{55    {56        public UnexpectedEOFException(string message) : base(message)57        {58        }59    }60}61using System;62using System.IO;63using Gherkin;64{65    {66        public UnexpectedEOFException(string message) : base(message)67        {68        }69    }70}71using System;72using System.IO;73using Gherkin;

Full Screen

Full Screen

UnexpectedEOFException

Using AI Code Generation

copy

Full Screen

1using Gherkin.Ast;2using System;3using System.Collections.Generic;4using System.Linq;5using System.Text;6using System.Threading.Tasks;7{8    {9        public UnexpectedEOFException(Location location, string message)10            : base(location, message)11        {12        }13    }14}15using Gherkin.Ast;16using System;17using System.Collections.Generic;18using System.Linq;19using System.Text;20using System.Threading.Tasks;21{22    {23        public UnexpectedEOFException(Location location, string message)24            : base(location, message)25        {26        }27    }28}29using Gherkin.Ast;30using System;31using System.Collections.Generic;32using System.Linq;33using System.Text;34using System.Threading.Tasks;35{36    {37        public UnexpectedEOFException(Location location, string message)38            : base(location, message)39        {40        }41    }42}43using Gherkin.Ast;44using System;45using System.Collections.Generic;46using System.Linq;47using System.Text;48using System.Threading.Tasks;49{50    {51        public UnexpectedEOFException(Location location, string message)52            : base(location, message)53        {54        }55    }56}57using Gherkin.Ast;58using System;59using System.Collections.Generic;60using System.Linq;61using System.Text;62using System.Threading.Tasks;63{64    {65        public UnexpectedEOFException(Location location, string message)66            : base(location, message)67        {68        }69    }70}71using Gherkin.Ast;72using System;73using System.Collections.Generic;74using System.Linq;75using System.Text;76using System.Threading.Tasks;77{

Full Screen

Full Screen

UnexpectedEOFException

Using AI Code Generation

copy

Full Screen

1using Gherkin.Ast;2using Gherkin.Parser;3using Gherkin.TokenMatcher;4using System;5using System.IO;6{7    {8        static void Main(string[] args)9        {10            Console.WriteLine("Hello World!");11            StringReader reader = new StringReader("Feature: Test");12            Parser<GherkinDocument> parser = new Parser<GherkinDocument>(new TokenMatcher());13            {14                GherkinDocument gherkinDocument = parser.Parse(reader);15            }16            catch (UnexpectedEOFException e)17            {18                Console.WriteLine("Exception occurred: " + e.Message);19            }20        }21    }22}23at Gherkin.Parser.Parser`1.Parse(TextReader reader)24at Gherkin.Parser.Parser`1.Parse(String feature)25at Gherkin.Program.Main(String[] args) in C:\Users\Shubham\source\repos\Gherkin\Gherkin\Program.cs:line 1826Gherkin.Parser.Parser<Gherkin.Ast.GherkinDocument>.Parse(TextReader reader)27Gherkin.Parser.Parser<Gherkin.Ast.GherkinDocument>.Parse(String feature)28Gherkin.Program.Main(String[] args) in Program.cs29Gherkin.Parser.Parser<Gherkin.Ast.GherkinDocument>.Parse(TextReader reader)30Gherkin.Parser.Parser<Gherkin.Ast.GherkinDocument>.Parse(String feature)31Gherkin.Program.Main(String[] args) in Program.cs

Full Screen

Full Screen

UnexpectedEOFException

Using AI Code Generation

copy

Full Screen

1using Gherkin;2using System;3{4    {5        static void Main(string[] args)6        {7            {8                throw new UnexpectedEOFException("UnexpectedEOFException");9            }10            catch (UnexpectedEOFException e)11            {12                Console.WriteLine(e.Message);13            }14            Console.ReadLine();15        }16    }17}

Full Screen

Full Screen

UnexpectedEOFException

Using AI Code Generation

copy

Full Screen

1using Gherkin;2{3    {4        static void Main(string[] args)5        {6            {7                var parser = new Parser();8                var feature = parser.Parse("Feature: test");9            }10            catch (UnexpectedEOFException ex)11            {12                Console.WriteLine(ex.Message);13            }14        }15    }16}17using Gherkin;18{19    {20        static void Main(string[] args)21        {22            {23                var parser = new Parser();24                var feature = parser.Parse("Feature: test");25            }26            catch (Gherkin.UnexpectedEOFException ex)27            {28                Console.WriteLine(ex.Message);29            }30        }31    }32}

Full Screen

Full Screen

UnexpectedEOFException

Using AI Code Generation

copy

Full Screen

1using System;2using System.IO;3using Gherkin;4{5    static void Main()6    {7        {8            using (var reader = new StreamReader("test.txt"))9            {10                var parser = new Parser();11                var gherkinDocument = parser.Parse(reader);12            }13        }14        catch (UnexpectedEOFException ex)15        {16            Console.WriteLine("Unexpected EOF");17        }18    }19}20catch (UnexpectedEOFException ex)21{22    Console.WriteLine("Unexpected EOF");23}24catch (UnexpectedEOFException ex)25{26    Console.WriteLine("Unexpected EOF");27}28using System;29using System.IO;30using Gherkin;31{32    static void Main()33    {34        {35            using (var reader = new StreamReader("test.txt"))36            {37                var parser = new Parser();38                var gherkinDocument = parser.Parse(reader);39            }40        }41        catch (UnexpectedEOFException ex)42        {43            Console.WriteLine("Unexpected EOF");44        }45    }46}

Full Screen

Full Screen

UnexpectedEOFException

Using AI Code Generation

copy

Full Screen

1{2    {3        static void Main(string[] args)4        {5            {6                string text = "Feature: test";7                var parser = new Parser();8                var feature = parser.Parse(text);9            }10            catch (UnexpectedEOFException e)11            {12                Console.WriteLine("Unexpected end of file");13            }14            Console.ReadLine();15        }16    }17}18{19    {20        static void Main(string[] args)21        {22            {23                string text = "Feature: test";24                var parser = new Parser();25                var feature = parser.Parse(text);26            }27            catch (GherkinException e)28            {29                Console.WriteLine("GherkinException");30            }31            Console.ReadLine();32        }33    }34}35{36    {37        static void Main(string[] args)38        {39            {40                string text = "Feature: test";41                var parser = new Parser();42                var feature = parser.Parse(text);43            }44            catch (Exception e)45            {46                Console.WriteLine("Exception");47            }48            Console.ReadLine();49        }50    }51}

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Gherkin-dotnet automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used methods in UnexpectedEOFException

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful