From 3e3515bca27fbb29e4c1e4c6f1a25a681fb5806f Mon Sep 17 00:00:00 2001 From: Gaspar Nagy Date: Tue, 24 Nov 2009 09:18:07 +0100 Subject: [PATCH] =?UTF-8?q?=EF=BB=BFfirst=20version=20of=20line=20pragmas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Configuration/GeneratorConfiguration.cs | 5 + Parser/Grammar/SpecFlowLangWalker.cs | 593 +++++++++--------- Parser/Grammar/SpecFlowLangWalker.g | 11 +- Parser/Grammar/SpecFlowLangWalkerBase.cs | 26 + Parser/SpecFlowGenerator.cs | 2 +- Parser/SpecFlowUnitTestConverter.cs | 73 ++- Parser/SyntaxElements/Background.cs | 3 + Parser/SyntaxElements/FilePosition.cs | 24 + Parser/TechTalk.SpecFlow.Parser.csproj | 2 + .../ConfigurationSectionHandler.cs | 2 + Runtime/TestRunner.cs | 5 +- Tests/ParserTests/SuccessfulGenerationTest.cs | 2 +- 12 files changed, 443 insertions(+), 305 deletions(-) create mode 100644 Parser/Grammar/SpecFlowLangWalkerBase.cs create mode 100644 Parser/SyntaxElements/FilePosition.cs diff --git a/Parser/Configuration/GeneratorConfiguration.cs b/Parser/Configuration/GeneratorConfiguration.cs index 0659799fc..a7ea6effe 100644 --- a/Parser/Configuration/GeneratorConfiguration.cs +++ b/Parser/Configuration/GeneratorConfiguration.cs @@ -14,6 +14,9 @@ public class GeneratorConfiguration //unit test framework settings public Type GeneratorUnitTestProviderType { get; set; } + + // generator settings + public bool AllowDebugGeneratedFiles { get; set; } public GeneratorConfiguration() { @@ -23,6 +26,8 @@ public GeneratorConfiguration() CultureInfo.GetCultureInfo(ConfigDefaults.ToolLanguage); SetUnitTestDefaultsByName(ConfigDefaults.UnitTestProviderName); + + AllowDebugGeneratedFiles = ConfigDefaults.AllowDebugGeneratedFiles; } internal void UpdateFromConfigFile(ConfigurationSectionHandler configSection) diff --git a/Parser/Grammar/SpecFlowLangWalker.cs b/Parser/Grammar/SpecFlowLangWalker.cs index 5f2884dfd..3605b7938 100644 --- a/Parser/Grammar/SpecFlowLangWalker.cs +++ b/Parser/Grammar/SpecFlowLangWalker.cs @@ -1,4 +1,4 @@ -// $ANTLR 3.1.2 SpecFlowLangWalker.g 2009-11-10 15:19:44 +// $ANTLR 3.1.2 SpecFlowLangWalker.g 2009-11-23 16:39:51 // The variable 'variable' is assigned but its value is never used. #pragma warning disable 168, 219 @@ -19,7 +19,7 @@ namespace TechTalk.SpecFlow.Parser.Grammar using Stack = Antlr.Runtime.Collections.StackList; -public partial class SpecFlowLangWalker : TreeParser +public partial class SpecFlowLangWalker : SpecFlowLangWalkerBase { public static readonly string[] tokenNames = new string[] { @@ -153,7 +153,7 @@ override public string GrammarFileName { // $ANTLR start "feature" - // SpecFlowLangWalker.g:17:1: feature returns [Feature feature] : ^( FEATURE (tags_= tags )? title_= text (descLine_= descriptionLine )* (background_= background )? ^( SCENARIOS (scenario_= scenarioKind )* ) ) ; + // SpecFlowLangWalker.g:18:1: feature returns [Feature feature] : ^( FEATURE (tags_= tags )? title_= text (descLine_= descriptionLine )* (background_= background )? ^( SCENARIOS (scenario_= scenarioKind )* ) ) ; public Feature feature() // throws RecognitionException [1] { Feature feature = default(Feature); @@ -175,13 +175,13 @@ public Feature feature() // throws RecognitionException [1] try { - // SpecFlowLangWalker.g:25:5: ( ^( FEATURE (tags_= tags )? title_= text (descLine_= descriptionLine )* (background_= background )? ^( SCENARIOS (scenario_= scenarioKind )* ) ) ) - // SpecFlowLangWalker.g:25:9: ^( FEATURE (tags_= tags )? title_= text (descLine_= descriptionLine )* (background_= background )? ^( SCENARIOS (scenario_= scenarioKind )* ) ) + // SpecFlowLangWalker.g:26:5: ( ^( FEATURE (tags_= tags )? title_= text (descLine_= descriptionLine )* (background_= background )? ^( SCENARIOS (scenario_= scenarioKind )* ) ) ) + // SpecFlowLangWalker.g:26:9: ^( FEATURE (tags_= tags )? title_= text (descLine_= descriptionLine )* (background_= background )? ^( SCENARIOS (scenario_= scenarioKind )* ) ) { - Match(input,FEATURE,FOLLOW_FEATURE_in_feature73); + Match(input,FEATURE,FOLLOW_FEATURE_in_feature81); Match(input, Token.DOWN, null); - // SpecFlowLangWalker.g:26:13: (tags_= tags )? + // SpecFlowLangWalker.g:27:13: (tags_= tags )? int alt1 = 2; int LA1_0 = input.LA(1); @@ -192,9 +192,9 @@ public Feature feature() // throws RecognitionException [1] switch (alt1) { case 1 : - // SpecFlowLangWalker.g:26:14: tags_= tags + // SpecFlowLangWalker.g:27:14: tags_= tags { - PushFollow(FOLLOW_tags_in_feature90); + PushFollow(FOLLOW_tags_in_feature98); tags_ = tags(); state.followingStackPointer--; @@ -204,11 +204,11 @@ public Feature feature() // throws RecognitionException [1] } - PushFollow(FOLLOW_text_in_feature108); + PushFollow(FOLLOW_text_in_feature116); title_ = text(); state.followingStackPointer--; - // SpecFlowLangWalker.g:28:13: (descLine_= descriptionLine )* + // SpecFlowLangWalker.g:29:13: (descLine_= descriptionLine )* do { int alt2 = 2; @@ -223,9 +223,9 @@ public Feature feature() // throws RecognitionException [1] switch (alt2) { case 1 : - // SpecFlowLangWalker.g:28:14: descLine_= descriptionLine + // SpecFlowLangWalker.g:29:14: descLine_= descriptionLine { - PushFollow(FOLLOW_descriptionLine_in_feature125); + PushFollow(FOLLOW_descriptionLine_in_feature133); descLine_ = descriptionLine(); state.followingStackPointer--; @@ -242,7 +242,7 @@ public Feature feature() // throws RecognitionException [1] loop2: ; // Stops C# compiler whining that label 'loop2' has no statements - // SpecFlowLangWalker.g:29:13: (background_= background )? + // SpecFlowLangWalker.g:30:13: (background_= background )? int alt3 = 2; int LA3_0 = input.LA(1); @@ -253,9 +253,9 @@ public Feature feature() // throws RecognitionException [1] switch (alt3) { case 1 : - // SpecFlowLangWalker.g:29:14: background_= background + // SpecFlowLangWalker.g:30:14: background_= background { - PushFollow(FOLLOW_background_in_feature146); + PushFollow(FOLLOW_background_in_feature154); background_ = background(); state.followingStackPointer--; @@ -265,12 +265,12 @@ public Feature feature() // throws RecognitionException [1] } - Match(input,SCENARIOS,FOLLOW_SCENARIOS_in_feature163); + Match(input,SCENARIOS,FOLLOW_SCENARIOS_in_feature171); if ( input.LA(1) == Token.DOWN ) { Match(input, Token.DOWN, null); - // SpecFlowLangWalker.g:31:17: (scenario_= scenarioKind )* + // SpecFlowLangWalker.g:32:17: (scenario_= scenarioKind )* do { int alt4 = 2; @@ -285,9 +285,9 @@ public Feature feature() // throws RecognitionException [1] switch (alt4) { case 1 : - // SpecFlowLangWalker.g:31:18: scenario_= scenarioKind + // SpecFlowLangWalker.g:32:18: scenario_= scenarioKind { - PushFollow(FOLLOW_scenarioKind_in_feature185); + PushFollow(FOLLOW_scenarioKind_in_feature193); scenario_ = scenarioKind(); state.followingStackPointer--; @@ -330,7 +330,7 @@ public Feature feature() // throws RecognitionException [1] // $ANTLR start "tags" - // SpecFlowLangWalker.g:36:1: tags returns [Tags tags] : ^( TAGS (tag_= tag )+ ) ; + // SpecFlowLangWalker.g:37:1: tags returns [Tags tags] : ^( TAGS (tag_= tag )+ ) ; public Tags tags() // throws RecognitionException [1] { Tags tags = default(Tags); @@ -343,13 +343,13 @@ public Tags tags() // throws RecognitionException [1] try { - // SpecFlowLangWalker.g:40:5: ( ^( TAGS (tag_= tag )+ ) ) - // SpecFlowLangWalker.g:40:9: ^( TAGS (tag_= tag )+ ) + // SpecFlowLangWalker.g:41:5: ( ^( TAGS (tag_= tag )+ ) ) + // SpecFlowLangWalker.g:41:9: ^( TAGS (tag_= tag )+ ) { - Match(input,TAGS,FOLLOW_TAGS_in_tags243); + Match(input,TAGS,FOLLOW_TAGS_in_tags251); Match(input, Token.DOWN, null); - // SpecFlowLangWalker.g:41:13: (tag_= tag )+ + // SpecFlowLangWalker.g:42:13: (tag_= tag )+ int cnt5 = 0; do { @@ -365,9 +365,9 @@ public Tags tags() // throws RecognitionException [1] switch (alt5) { case 1 : - // SpecFlowLangWalker.g:41:14: tag_= tag + // SpecFlowLangWalker.g:42:14: tag_= tag { - PushFollow(FOLLOW_tag_in_tags260); + PushFollow(FOLLOW_tag_in_tags268); tag_ = tag(); state.followingStackPointer--; @@ -408,7 +408,7 @@ public Tags tags() // throws RecognitionException [1] // $ANTLR start "tag" - // SpecFlowLangWalker.g:45:1: tag returns [Tag tag] : ^( TAG word_= word ) ; + // SpecFlowLangWalker.g:46:1: tag returns [Tag tag] : ^( TAG word_= word ) ; public Tag tag() // throws RecognitionException [1] { Tag tag = default(Tag); @@ -418,13 +418,13 @@ public Tag tag() // throws RecognitionException [1] try { - // SpecFlowLangWalker.g:49:5: ( ^( TAG word_= word ) ) - // SpecFlowLangWalker.g:49:9: ^( TAG word_= word ) + // SpecFlowLangWalker.g:50:5: ( ^( TAG word_= word ) ) + // SpecFlowLangWalker.g:50:9: ^( TAG word_= word ) { - Match(input,TAG,FOLLOW_TAG_in_tag302); + Match(input,TAG,FOLLOW_TAG_in_tag310); Match(input, Token.DOWN, null); - PushFollow(FOLLOW_word_in_tag318); + PushFollow(FOLLOW_word_in_tag326); word_ = word(); state.followingStackPointer--; @@ -451,7 +451,7 @@ public Tag tag() // throws RecognitionException [1] // $ANTLR start "word" - // SpecFlowLangWalker.g:54:1: word returns [Word word] : ^( WORD (char_= WORDCHAR )+ ) ; + // SpecFlowLangWalker.g:55:1: word returns [Word word] : ^( WORD (char_= WORDCHAR )+ ) ; public Word word() // throws RecognitionException [1] { Word word = default(Word); @@ -463,13 +463,13 @@ public Word word() // throws RecognitionException [1] try { - // SpecFlowLangWalker.g:61:5: ( ^( WORD (char_= WORDCHAR )+ ) ) - // SpecFlowLangWalker.g:61:9: ^( WORD (char_= WORDCHAR )+ ) + // SpecFlowLangWalker.g:62:5: ( ^( WORD (char_= WORDCHAR )+ ) ) + // SpecFlowLangWalker.g:62:9: ^( WORD (char_= WORDCHAR )+ ) { - Match(input,WORD,FOLLOW_WORD_in_word361); + Match(input,WORD,FOLLOW_WORD_in_word369); Match(input, Token.DOWN, null); - // SpecFlowLangWalker.g:62:13: (char_= WORDCHAR )+ + // SpecFlowLangWalker.g:63:13: (char_= WORDCHAR )+ int cnt6 = 0; do { @@ -485,9 +485,9 @@ public Word word() // throws RecognitionException [1] switch (alt6) { case 1 : - // SpecFlowLangWalker.g:62:14: char_= WORDCHAR + // SpecFlowLangWalker.g:63:14: char_= WORDCHAR { - char_=(CommonTree)Match(input,WORDCHAR,FOLLOW_WORDCHAR_in_word378); + char_=(CommonTree)Match(input,WORDCHAR,FOLLOW_WORDCHAR_in_word386); wordBuffer.Append(char_.Text); } @@ -528,7 +528,7 @@ public Word word() // throws RecognitionException [1] // $ANTLR start "descriptionLine" - // SpecFlowLangWalker.g:66:1: descriptionLine returns [DescriptionLine descriptionLine] : ^( DESCRIPTIONLINE text_= text ) ; + // SpecFlowLangWalker.g:67:1: descriptionLine returns [DescriptionLine descriptionLine] : ^( DESCRIPTIONLINE text_= text ) ; public DescriptionLine descriptionLine() // throws RecognitionException [1] { DescriptionLine descriptionLine = default(DescriptionLine); @@ -538,13 +538,13 @@ public DescriptionLine descriptionLine() // throws RecognitionException [1] try { - // SpecFlowLangWalker.g:70:5: ( ^( DESCRIPTIONLINE text_= text ) ) - // SpecFlowLangWalker.g:70:9: ^( DESCRIPTIONLINE text_= text ) + // SpecFlowLangWalker.g:71:5: ( ^( DESCRIPTIONLINE text_= text ) ) + // SpecFlowLangWalker.g:71:9: ^( DESCRIPTIONLINE text_= text ) { - Match(input,DESCRIPTIONLINE,FOLLOW_DESCRIPTIONLINE_in_descriptionLine420); + Match(input,DESCRIPTIONLINE,FOLLOW_DESCRIPTIONLINE_in_descriptionLine428); Match(input, Token.DOWN, null); - PushFollow(FOLLOW_text_in_descriptionLine436); + PushFollow(FOLLOW_text_in_descriptionLine444); text_ = text(); state.followingStackPointer--; @@ -571,7 +571,7 @@ public DescriptionLine descriptionLine() // throws RecognitionException [1] // $ANTLR start "background" - // SpecFlowLangWalker.g:75:1: background returns [Background background] : ^( BACKGROUND (title_= text )? steps_= steps ) ; + // SpecFlowLangWalker.g:76:1: background returns [Background background] : ^( BACKGROUND (title_= text )? steps_= steps ) ; public Background background() // throws RecognitionException [1] { Background background = default(Background); @@ -581,15 +581,21 @@ public Background background() // throws RecognitionException [1] ScenarioSteps steps_ = default(ScenarioSteps); + + FilePosition fp_ = null; + try { - // SpecFlowLangWalker.g:79:5: ( ^( BACKGROUND (title_= text )? steps_= steps ) ) - // SpecFlowLangWalker.g:79:9: ^( BACKGROUND (title_= text )? steps_= steps ) + // SpecFlowLangWalker.g:84:5: ( ^( BACKGROUND (title_= text )? steps_= steps ) ) + // SpecFlowLangWalker.g:85:13: ^( BACKGROUND (title_= text )? steps_= steps ) { - Match(input,BACKGROUND,FOLLOW_BACKGROUND_in_background474); + + fp_ = GetFilePosition(); + + Match(input,BACKGROUND,FOLLOW_BACKGROUND_in_background504); Match(input, Token.DOWN, null); - // SpecFlowLangWalker.g:80:13: (title_= text )? + // SpecFlowLangWalker.g:89:13: (title_= text )? int alt7 = 2; int LA7_0 = input.LA(1); @@ -600,9 +606,9 @@ public Background background() // throws RecognitionException [1] switch (alt7) { case 1 : - // SpecFlowLangWalker.g:80:14: title_= text + // SpecFlowLangWalker.g:89:14: title_= text { - PushFollow(FOLLOW_text_in_background491); + PushFollow(FOLLOW_text_in_background521); title_ = text(); state.followingStackPointer--; @@ -612,7 +618,7 @@ public Background background() // throws RecognitionException [1] } - PushFollow(FOLLOW_steps_in_background509); + PushFollow(FOLLOW_steps_in_background539); steps_ = steps(); state.followingStackPointer--; @@ -623,6 +629,7 @@ public Background background() // throws RecognitionException [1] background = new Background(title_, steps_); + background.FilePosition = fp_; } catch (RecognitionException re) @@ -639,7 +646,7 @@ public Background background() // throws RecognitionException [1] // $ANTLR start "scenarioKind" - // SpecFlowLangWalker.g:85:1: scenarioKind returns [Scenario scenarioKind] : (scenario_= scenario | outline_= scenarioOutline ); + // SpecFlowLangWalker.g:94:1: scenarioKind returns [Scenario scenarioKind] : (scenario_= scenario | outline_= scenarioOutline ); public Scenario scenarioKind() // throws RecognitionException [1] { Scenario scenarioKind = default(Scenario); @@ -651,7 +658,7 @@ public Scenario scenarioKind() // throws RecognitionException [1] try { - // SpecFlowLangWalker.g:86:5: (scenario_= scenario | outline_= scenarioOutline ) + // SpecFlowLangWalker.g:95:5: (scenario_= scenario | outline_= scenarioOutline ) int alt8 = 2; int LA8_0 = input.LA(1); @@ -673,9 +680,9 @@ public Scenario scenarioKind() // throws RecognitionException [1] switch (alt8) { case 1 : - // SpecFlowLangWalker.g:86:9: scenario_= scenario + // SpecFlowLangWalker.g:95:9: scenario_= scenario { - PushFollow(FOLLOW_scenario_in_scenarioKind543); + PushFollow(FOLLOW_scenario_in_scenarioKind573); scenario_ = scenario(); state.followingStackPointer--; @@ -684,9 +691,9 @@ public Scenario scenarioKind() // throws RecognitionException [1] } break; case 2 : - // SpecFlowLangWalker.g:87:9: outline_= scenarioOutline + // SpecFlowLangWalker.g:96:9: outline_= scenarioOutline { - PushFollow(FOLLOW_scenarioOutline_in_scenarioKind557); + PushFollow(FOLLOW_scenarioOutline_in_scenarioKind587); outline_ = scenarioOutline(); state.followingStackPointer--; @@ -711,7 +718,7 @@ public Scenario scenarioKind() // throws RecognitionException [1] // $ANTLR start "scenarioOutline" - // SpecFlowLangWalker.g:90:1: scenarioOutline returns [ScenarioOutline outline] : ^( SCENARIOOUTLINE (tags_= tags )? title_= text steps_= steps examples_= examples ) ; + // SpecFlowLangWalker.g:99:1: scenarioOutline returns [ScenarioOutline outline] : ^( SCENARIOOUTLINE (tags_= tags )? title_= text steps_= steps examples_= examples ) ; public ScenarioOutline scenarioOutline() // throws RecognitionException [1] { ScenarioOutline outline = default(ScenarioOutline); @@ -730,13 +737,13 @@ public ScenarioOutline scenarioOutline() // throws RecognitionException [1] try { - // SpecFlowLangWalker.g:98:5: ( ^( SCENARIOOUTLINE (tags_= tags )? title_= text steps_= steps examples_= examples ) ) - // SpecFlowLangWalker.g:98:9: ^( SCENARIOOUTLINE (tags_= tags )? title_= text steps_= steps examples_= examples ) + // SpecFlowLangWalker.g:107:5: ( ^( SCENARIOOUTLINE (tags_= tags )? title_= text steps_= steps examples_= examples ) ) + // SpecFlowLangWalker.g:107:9: ^( SCENARIOOUTLINE (tags_= tags )? title_= text steps_= steps examples_= examples ) { - Match(input,SCENARIOOUTLINE,FOLLOW_SCENARIOOUTLINE_in_scenarioOutline592); + Match(input,SCENARIOOUTLINE,FOLLOW_SCENARIOOUTLINE_in_scenarioOutline622); Match(input, Token.DOWN, null); - // SpecFlowLangWalker.g:99:18: (tags_= tags )? + // SpecFlowLangWalker.g:108:18: (tags_= tags )? int alt9 = 2; int LA9_0 = input.LA(1); @@ -747,9 +754,9 @@ public ScenarioOutline scenarioOutline() // throws RecognitionException [1] switch (alt9) { case 1 : - // SpecFlowLangWalker.g:99:18: tags_= tags + // SpecFlowLangWalker.g:108:18: tags_= tags { - PushFollow(FOLLOW_tags_in_scenarioOutline608); + PushFollow(FOLLOW_tags_in_scenarioOutline638); tags_ = tags(); state.followingStackPointer--; @@ -762,15 +769,15 @@ public ScenarioOutline scenarioOutline() // throws RecognitionException [1] lineNo_ = ((ITree)input.LT(1)).Line; - PushFollow(FOLLOW_text_in_scenarioOutline639); + PushFollow(FOLLOW_text_in_scenarioOutline669); title_ = text(); state.followingStackPointer--; - PushFollow(FOLLOW_steps_in_scenarioOutline655); + PushFollow(FOLLOW_steps_in_scenarioOutline685); steps_ = steps(); state.followingStackPointer--; - PushFollow(FOLLOW_examples_in_scenarioOutline671); + PushFollow(FOLLOW_examples_in_scenarioOutline701); examples_ = examples(); state.followingStackPointer--; @@ -798,7 +805,7 @@ public ScenarioOutline scenarioOutline() // throws RecognitionException [1] // $ANTLR start "scenario" - // SpecFlowLangWalker.g:109:1: scenario returns [Scenario scenario] : ^( SCENARIO (tags_= tags )? title_= text steps_= steps ) ; + // SpecFlowLangWalker.g:118:1: scenario returns [Scenario scenario] : ^( SCENARIO (tags_= tags )? title_= text steps_= steps ) ; public Scenario scenario() // throws RecognitionException [1] { Scenario scenario = default(Scenario); @@ -815,13 +822,13 @@ public Scenario scenario() // throws RecognitionException [1] try { - // SpecFlowLangWalker.g:117:5: ( ^( SCENARIO (tags_= tags )? title_= text steps_= steps ) ) - // SpecFlowLangWalker.g:117:9: ^( SCENARIO (tags_= tags )? title_= text steps_= steps ) + // SpecFlowLangWalker.g:126:5: ( ^( SCENARIO (tags_= tags )? title_= text steps_= steps ) ) + // SpecFlowLangWalker.g:126:9: ^( SCENARIO (tags_= tags )? title_= text steps_= steps ) { - Match(input,SCENARIO,FOLLOW_SCENARIO_in_scenario714); + Match(input,SCENARIO,FOLLOW_SCENARIO_in_scenario744); Match(input, Token.DOWN, null); - // SpecFlowLangWalker.g:118:18: (tags_= tags )? + // SpecFlowLangWalker.g:127:18: (tags_= tags )? int alt10 = 2; int LA10_0 = input.LA(1); @@ -832,9 +839,9 @@ public Scenario scenario() // throws RecognitionException [1] switch (alt10) { case 1 : - // SpecFlowLangWalker.g:118:18: tags_= tags + // SpecFlowLangWalker.g:127:18: tags_= tags { - PushFollow(FOLLOW_tags_in_scenario731); + PushFollow(FOLLOW_tags_in_scenario761); tags_ = tags(); state.followingStackPointer--; @@ -847,11 +854,11 @@ public Scenario scenario() // throws RecognitionException [1] lineNo_ = ((ITree)input.LT(1)).Line; - PushFollow(FOLLOW_text_in_scenario762); + PushFollow(FOLLOW_text_in_scenario792); title_ = text(); state.followingStackPointer--; - PushFollow(FOLLOW_steps_in_scenario778); + PushFollow(FOLLOW_steps_in_scenario808); steps_ = steps(); state.followingStackPointer--; @@ -879,7 +886,7 @@ public Scenario scenario() // throws RecognitionException [1] // $ANTLR start "examples" - // SpecFlowLangWalker.g:127:1: examples returns [Examples examples] : ^( EXAMPLES (exampleSet_= exampleSet )+ ) ; + // SpecFlowLangWalker.g:136:1: examples returns [Examples examples] : ^( EXAMPLES (exampleSet_= exampleSet )+ ) ; public Examples examples() // throws RecognitionException [1] { Examples examples = default(Examples); @@ -892,13 +899,13 @@ public Examples examples() // throws RecognitionException [1] try { - // SpecFlowLangWalker.g:134:5: ( ^( EXAMPLES (exampleSet_= exampleSet )+ ) ) - // SpecFlowLangWalker.g:134:9: ^( EXAMPLES (exampleSet_= exampleSet )+ ) + // SpecFlowLangWalker.g:143:5: ( ^( EXAMPLES (exampleSet_= exampleSet )+ ) ) + // SpecFlowLangWalker.g:143:9: ^( EXAMPLES (exampleSet_= exampleSet )+ ) { - Match(input,EXAMPLES,FOLLOW_EXAMPLES_in_examples821); + Match(input,EXAMPLES,FOLLOW_EXAMPLES_in_examples851); Match(input, Token.DOWN, null); - // SpecFlowLangWalker.g:135:13: (exampleSet_= exampleSet )+ + // SpecFlowLangWalker.g:144:13: (exampleSet_= exampleSet )+ int cnt11 = 0; do { @@ -914,9 +921,9 @@ public Examples examples() // throws RecognitionException [1] switch (alt11) { case 1 : - // SpecFlowLangWalker.g:135:14: exampleSet_= exampleSet + // SpecFlowLangWalker.g:144:14: exampleSet_= exampleSet { - PushFollow(FOLLOW_exampleSet_in_examples838); + PushFollow(FOLLOW_exampleSet_in_examples868); exampleSet_ = exampleSet(); state.followingStackPointer--; @@ -960,7 +967,7 @@ public Examples examples() // throws RecognitionException [1] // $ANTLR start "exampleSet" - // SpecFlowLangWalker.g:139:1: exampleSet returns [ExampleSet exampleSet] : ^( EXAMPLESET (title_= text )? table_= table ) ; + // SpecFlowLangWalker.g:148:1: exampleSet returns [ExampleSet exampleSet] : ^( EXAMPLESET (title_= text )? table_= table ) ; public ExampleSet exampleSet() // throws RecognitionException [1] { ExampleSet exampleSet = default(ExampleSet); @@ -972,13 +979,13 @@ public ExampleSet exampleSet() // throws RecognitionException [1] try { - // SpecFlowLangWalker.g:143:5: ( ^( EXAMPLESET (title_= text )? table_= table ) ) - // SpecFlowLangWalker.g:143:9: ^( EXAMPLESET (title_= text )? table_= table ) + // SpecFlowLangWalker.g:152:5: ( ^( EXAMPLESET (title_= text )? table_= table ) ) + // SpecFlowLangWalker.g:152:9: ^( EXAMPLESET (title_= text )? table_= table ) { - Match(input,EXAMPLESET,FOLLOW_EXAMPLESET_in_exampleSet880); + Match(input,EXAMPLESET,FOLLOW_EXAMPLESET_in_exampleSet910); Match(input, Token.DOWN, null); - // SpecFlowLangWalker.g:144:19: (title_= text )? + // SpecFlowLangWalker.g:153:19: (title_= text )? int alt12 = 2; int LA12_0 = input.LA(1); @@ -989,9 +996,9 @@ public ExampleSet exampleSet() // throws RecognitionException [1] switch (alt12) { case 1 : - // SpecFlowLangWalker.g:144:19: title_= text + // SpecFlowLangWalker.g:153:19: title_= text { - PushFollow(FOLLOW_text_in_exampleSet896); + PushFollow(FOLLOW_text_in_exampleSet926); title_ = text(); state.followingStackPointer--; @@ -1001,7 +1008,7 @@ public ExampleSet exampleSet() // throws RecognitionException [1] } - PushFollow(FOLLOW_table_in_exampleSet913); + PushFollow(FOLLOW_table_in_exampleSet943); table_ = table(); state.followingStackPointer--; @@ -1028,7 +1035,7 @@ public ExampleSet exampleSet() // throws RecognitionException [1] // $ANTLR start "steps" - // SpecFlowLangWalker.g:149:1: steps returns [ScenarioSteps steps] : ^( STEPS (step_= step )+ ) ; + // SpecFlowLangWalker.g:158:1: steps returns [ScenarioSteps steps] : ^( STEPS (step_= step )+ ) ; public ScenarioSteps steps() // throws RecognitionException [1] { ScenarioSteps steps = default(ScenarioSteps); @@ -1041,13 +1048,13 @@ public ScenarioSteps steps() // throws RecognitionException [1] try { - // SpecFlowLangWalker.g:153:5: ( ^( STEPS (step_= step )+ ) ) - // SpecFlowLangWalker.g:153:9: ^( STEPS (step_= step )+ ) + // SpecFlowLangWalker.g:162:5: ( ^( STEPS (step_= step )+ ) ) + // SpecFlowLangWalker.g:162:9: ^( STEPS (step_= step )+ ) { - Match(input,STEPS,FOLLOW_STEPS_in_steps951); + Match(input,STEPS,FOLLOW_STEPS_in_steps981); Match(input, Token.DOWN, null); - // SpecFlowLangWalker.g:154:13: (step_= step )+ + // SpecFlowLangWalker.g:163:13: (step_= step )+ int cnt13 = 0; do { @@ -1063,9 +1070,9 @@ public ScenarioSteps steps() // throws RecognitionException [1] switch (alt13) { case 1 : - // SpecFlowLangWalker.g:154:14: step_= step + // SpecFlowLangWalker.g:163:14: step_= step { - PushFollow(FOLLOW_step_in_steps968); + PushFollow(FOLLOW_step_in_steps998); step_ = step(); state.followingStackPointer--; @@ -1106,7 +1113,7 @@ public ScenarioSteps steps() // throws RecognitionException [1] // $ANTLR start "step" - // SpecFlowLangWalker.g:158:1: step returns [ScenarioStep step] : ( ^( GIVEN text_= text (mlt_= multilineText )? (table_= table )? ) | ^( WHEN text_= text (mlt_= multilineText )? (table_= table )? ) | ^( THEN text_= text (mlt_= multilineText )? (table_= table )? ) | ^( AND text_= text (mlt_= multilineText )? (table_= table )? ) | ^( BUT text_= text (mlt_= multilineText )? (table_= table )? ) ); + // SpecFlowLangWalker.g:167:1: step returns [ScenarioStep step] : ( ^( GIVEN text_= text (mlt_= multilineText )? (table_= table )? ) | ^( WHEN text_= text (mlt_= multilineText )? (table_= table )? ) | ^( THEN text_= text (mlt_= multilineText )? (table_= table )? ) | ^( AND text_= text (mlt_= multilineText )? (table_= table )? ) | ^( BUT text_= text (mlt_= multilineText )? (table_= table )? ) ); public ScenarioStep step() // throws RecognitionException [1] { ScenarioStep step = default(ScenarioStep); @@ -1123,7 +1130,7 @@ public ScenarioStep step() // throws RecognitionException [1] try { - // SpecFlowLangWalker.g:165:5: ( ^( GIVEN text_= text (mlt_= multilineText )? (table_= table )? ) | ^( WHEN text_= text (mlt_= multilineText )? (table_= table )? ) | ^( THEN text_= text (mlt_= multilineText )? (table_= table )? ) | ^( AND text_= text (mlt_= multilineText )? (table_= table )? ) | ^( BUT text_= text (mlt_= multilineText )? (table_= table )? ) ) + // SpecFlowLangWalker.g:174:5: ( ^( GIVEN text_= text (mlt_= multilineText )? (table_= table )? ) | ^( WHEN text_= text (mlt_= multilineText )? (table_= table )? ) | ^( THEN text_= text (mlt_= multilineText )? (table_= table )? ) | ^( AND text_= text (mlt_= multilineText )? (table_= table )? ) | ^( BUT text_= text (mlt_= multilineText )? (table_= table )? ) ) int alt24 = 5; switch ( input.LA(1) ) { @@ -1162,16 +1169,16 @@ public ScenarioStep step() // throws RecognitionException [1] switch (alt24) { case 1 : - // SpecFlowLangWalker.g:165:9: ^( GIVEN text_= text (mlt_= multilineText )? (table_= table )? ) + // SpecFlowLangWalker.g:174:9: ^( GIVEN text_= text (mlt_= multilineText )? (table_= table )? ) { - Match(input,GIVEN,FOLLOW_GIVEN_in_step1015); + Match(input,GIVEN,FOLLOW_GIVEN_in_step1045); Match(input, Token.DOWN, null); - PushFollow(FOLLOW_text_in_step1031); + PushFollow(FOLLOW_text_in_step1061); text_ = text(); state.followingStackPointer--; - // SpecFlowLangWalker.g:167:17: (mlt_= multilineText )? + // SpecFlowLangWalker.g:176:17: (mlt_= multilineText )? int alt14 = 2; int LA14_0 = input.LA(1); @@ -1182,9 +1189,9 @@ public ScenarioStep step() // throws RecognitionException [1] switch (alt14) { case 1 : - // SpecFlowLangWalker.g:167:17: mlt_= multilineText + // SpecFlowLangWalker.g:176:17: mlt_= multilineText { - PushFollow(FOLLOW_multilineText_in_step1047); + PushFollow(FOLLOW_multilineText_in_step1077); mlt_ = multilineText(); state.followingStackPointer--; @@ -1194,7 +1201,7 @@ public ScenarioStep step() // throws RecognitionException [1] } - // SpecFlowLangWalker.g:168:19: (table_= table )? + // SpecFlowLangWalker.g:177:19: (table_= table )? int alt15 = 2; int LA15_0 = input.LA(1); @@ -1205,9 +1212,9 @@ public ScenarioStep step() // throws RecognitionException [1] switch (alt15) { case 1 : - // SpecFlowLangWalker.g:168:19: table_= table + // SpecFlowLangWalker.g:177:19: table_= table { - PushFollow(FOLLOW_table_in_step1064); + PushFollow(FOLLOW_table_in_step1094); table_ = table(); state.followingStackPointer--; @@ -1226,16 +1233,16 @@ public ScenarioStep step() // throws RecognitionException [1] } break; case 2 : - // SpecFlowLangWalker.g:173:9: ^( WHEN text_= text (mlt_= multilineText )? (table_= table )? ) + // SpecFlowLangWalker.g:182:9: ^( WHEN text_= text (mlt_= multilineText )? (table_= table )? ) { - Match(input,WHEN,FOLLOW_WHEN_in_step1096); + Match(input,WHEN,FOLLOW_WHEN_in_step1126); Match(input, Token.DOWN, null); - PushFollow(FOLLOW_text_in_step1112); + PushFollow(FOLLOW_text_in_step1142); text_ = text(); state.followingStackPointer--; - // SpecFlowLangWalker.g:175:17: (mlt_= multilineText )? + // SpecFlowLangWalker.g:184:17: (mlt_= multilineText )? int alt16 = 2; int LA16_0 = input.LA(1); @@ -1246,9 +1253,9 @@ public ScenarioStep step() // throws RecognitionException [1] switch (alt16) { case 1 : - // SpecFlowLangWalker.g:175:17: mlt_= multilineText + // SpecFlowLangWalker.g:184:17: mlt_= multilineText { - PushFollow(FOLLOW_multilineText_in_step1128); + PushFollow(FOLLOW_multilineText_in_step1158); mlt_ = multilineText(); state.followingStackPointer--; @@ -1258,7 +1265,7 @@ public ScenarioStep step() // throws RecognitionException [1] } - // SpecFlowLangWalker.g:176:19: (table_= table )? + // SpecFlowLangWalker.g:185:19: (table_= table )? int alt17 = 2; int LA17_0 = input.LA(1); @@ -1269,9 +1276,9 @@ public ScenarioStep step() // throws RecognitionException [1] switch (alt17) { case 1 : - // SpecFlowLangWalker.g:176:19: table_= table + // SpecFlowLangWalker.g:185:19: table_= table { - PushFollow(FOLLOW_table_in_step1145); + PushFollow(FOLLOW_table_in_step1175); table_ = table(); state.followingStackPointer--; @@ -1290,16 +1297,16 @@ public ScenarioStep step() // throws RecognitionException [1] } break; case 3 : - // SpecFlowLangWalker.g:181:9: ^( THEN text_= text (mlt_= multilineText )? (table_= table )? ) + // SpecFlowLangWalker.g:190:9: ^( THEN text_= text (mlt_= multilineText )? (table_= table )? ) { - Match(input,THEN,FOLLOW_THEN_in_step1177); + Match(input,THEN,FOLLOW_THEN_in_step1207); Match(input, Token.DOWN, null); - PushFollow(FOLLOW_text_in_step1193); + PushFollow(FOLLOW_text_in_step1223); text_ = text(); state.followingStackPointer--; - // SpecFlowLangWalker.g:183:17: (mlt_= multilineText )? + // SpecFlowLangWalker.g:192:17: (mlt_= multilineText )? int alt18 = 2; int LA18_0 = input.LA(1); @@ -1310,9 +1317,9 @@ public ScenarioStep step() // throws RecognitionException [1] switch (alt18) { case 1 : - // SpecFlowLangWalker.g:183:17: mlt_= multilineText + // SpecFlowLangWalker.g:192:17: mlt_= multilineText { - PushFollow(FOLLOW_multilineText_in_step1209); + PushFollow(FOLLOW_multilineText_in_step1239); mlt_ = multilineText(); state.followingStackPointer--; @@ -1322,7 +1329,7 @@ public ScenarioStep step() // throws RecognitionException [1] } - // SpecFlowLangWalker.g:184:19: (table_= table )? + // SpecFlowLangWalker.g:193:19: (table_= table )? int alt19 = 2; int LA19_0 = input.LA(1); @@ -1333,9 +1340,9 @@ public ScenarioStep step() // throws RecognitionException [1] switch (alt19) { case 1 : - // SpecFlowLangWalker.g:184:19: table_= table + // SpecFlowLangWalker.g:193:19: table_= table { - PushFollow(FOLLOW_table_in_step1226); + PushFollow(FOLLOW_table_in_step1256); table_ = table(); state.followingStackPointer--; @@ -1354,16 +1361,16 @@ public ScenarioStep step() // throws RecognitionException [1] } break; case 4 : - // SpecFlowLangWalker.g:189:9: ^( AND text_= text (mlt_= multilineText )? (table_= table )? ) + // SpecFlowLangWalker.g:198:9: ^( AND text_= text (mlt_= multilineText )? (table_= table )? ) { - Match(input,AND,FOLLOW_AND_in_step1258); + Match(input,AND,FOLLOW_AND_in_step1288); Match(input, Token.DOWN, null); - PushFollow(FOLLOW_text_in_step1274); + PushFollow(FOLLOW_text_in_step1304); text_ = text(); state.followingStackPointer--; - // SpecFlowLangWalker.g:191:17: (mlt_= multilineText )? + // SpecFlowLangWalker.g:200:17: (mlt_= multilineText )? int alt20 = 2; int LA20_0 = input.LA(1); @@ -1374,9 +1381,9 @@ public ScenarioStep step() // throws RecognitionException [1] switch (alt20) { case 1 : - // SpecFlowLangWalker.g:191:17: mlt_= multilineText + // SpecFlowLangWalker.g:200:17: mlt_= multilineText { - PushFollow(FOLLOW_multilineText_in_step1290); + PushFollow(FOLLOW_multilineText_in_step1320); mlt_ = multilineText(); state.followingStackPointer--; @@ -1386,7 +1393,7 @@ public ScenarioStep step() // throws RecognitionException [1] } - // SpecFlowLangWalker.g:192:19: (table_= table )? + // SpecFlowLangWalker.g:201:19: (table_= table )? int alt21 = 2; int LA21_0 = input.LA(1); @@ -1397,9 +1404,9 @@ public ScenarioStep step() // throws RecognitionException [1] switch (alt21) { case 1 : - // SpecFlowLangWalker.g:192:19: table_= table + // SpecFlowLangWalker.g:201:19: table_= table { - PushFollow(FOLLOW_table_in_step1307); + PushFollow(FOLLOW_table_in_step1337); table_ = table(); state.followingStackPointer--; @@ -1418,16 +1425,16 @@ public ScenarioStep step() // throws RecognitionException [1] } break; case 5 : - // SpecFlowLangWalker.g:197:9: ^( BUT text_= text (mlt_= multilineText )? (table_= table )? ) + // SpecFlowLangWalker.g:206:9: ^( BUT text_= text (mlt_= multilineText )? (table_= table )? ) { - Match(input,BUT,FOLLOW_BUT_in_step1339); + Match(input,BUT,FOLLOW_BUT_in_step1369); Match(input, Token.DOWN, null); - PushFollow(FOLLOW_text_in_step1355); + PushFollow(FOLLOW_text_in_step1385); text_ = text(); state.followingStackPointer--; - // SpecFlowLangWalker.g:199:17: (mlt_= multilineText )? + // SpecFlowLangWalker.g:208:17: (mlt_= multilineText )? int alt22 = 2; int LA22_0 = input.LA(1); @@ -1438,9 +1445,9 @@ public ScenarioStep step() // throws RecognitionException [1] switch (alt22) { case 1 : - // SpecFlowLangWalker.g:199:17: mlt_= multilineText + // SpecFlowLangWalker.g:208:17: mlt_= multilineText { - PushFollow(FOLLOW_multilineText_in_step1371); + PushFollow(FOLLOW_multilineText_in_step1401); mlt_ = multilineText(); state.followingStackPointer--; @@ -1450,7 +1457,7 @@ public ScenarioStep step() // throws RecognitionException [1] } - // SpecFlowLangWalker.g:200:19: (table_= table )? + // SpecFlowLangWalker.g:209:19: (table_= table )? int alt23 = 2; int LA23_0 = input.LA(1); @@ -1461,9 +1468,9 @@ public ScenarioStep step() // throws RecognitionException [1] switch (alt23) { case 1 : - // SpecFlowLangWalker.g:200:19: table_= table + // SpecFlowLangWalker.g:209:19: table_= table { - PushFollow(FOLLOW_table_in_step1388); + PushFollow(FOLLOW_table_in_step1418); table_ = table(); state.followingStackPointer--; @@ -1501,7 +1508,7 @@ public ScenarioStep step() // throws RecognitionException [1] // $ANTLR start "text" - // SpecFlowLangWalker.g:208:1: text returns [Text text] : ^( TEXT f= wordchar (ws= WS | wc= wordchar | nl= NEWLINE )* ) ; + // SpecFlowLangWalker.g:217:1: text returns [Text text] : ^( TEXT f= wordchar (ws= WS | wc= wordchar | nl= NEWLINE )* ) ; public Text text() // throws RecognitionException [1] { Text text = default(Text); @@ -1518,18 +1525,18 @@ public Text text() // throws RecognitionException [1] try { - // SpecFlowLangWalker.g:215:5: ( ^( TEXT f= wordchar (ws= WS | wc= wordchar | nl= NEWLINE )* ) ) - // SpecFlowLangWalker.g:215:9: ^( TEXT f= wordchar (ws= WS | wc= wordchar | nl= NEWLINE )* ) + // SpecFlowLangWalker.g:224:5: ( ^( TEXT f= wordchar (ws= WS | wc= wordchar | nl= NEWLINE )* ) ) + // SpecFlowLangWalker.g:224:9: ^( TEXT f= wordchar (ws= WS | wc= wordchar | nl= NEWLINE )* ) { - Match(input,TEXT,FOLLOW_TEXT_in_text1443); + Match(input,TEXT,FOLLOW_TEXT_in_text1473); Match(input, Token.DOWN, null); - PushFollow(FOLLOW_wordchar_in_text1460); + PushFollow(FOLLOW_wordchar_in_text1490); f = wordchar(); state.followingStackPointer--; elements.Add(f); - // SpecFlowLangWalker.g:217:13: (ws= WS | wc= wordchar | nl= NEWLINE )* + // SpecFlowLangWalker.g:226:13: (ws= WS | wc= wordchar | nl= NEWLINE )* do { int alt25 = 4; @@ -1557,17 +1564,17 @@ public Text text() // throws RecognitionException [1] switch (alt25) { case 1 : - // SpecFlowLangWalker.g:217:17: ws= WS + // SpecFlowLangWalker.g:226:17: ws= WS { - ws=(CommonTree)Match(input,WS,FOLLOW_WS_in_text1491); + ws=(CommonTree)Match(input,WS,FOLLOW_WS_in_text1521); elements.Add(ws.Text); } break; case 2 : - // SpecFlowLangWalker.g:218:17: wc= wordchar + // SpecFlowLangWalker.g:227:17: wc= wordchar { - PushFollow(FOLLOW_wordchar_in_text1523); + PushFollow(FOLLOW_wordchar_in_text1553); wc = wordchar(); state.followingStackPointer--; @@ -1576,9 +1583,9 @@ public Text text() // throws RecognitionException [1] } break; case 3 : - // SpecFlowLangWalker.g:219:17: nl= NEWLINE + // SpecFlowLangWalker.g:228:17: nl= NEWLINE { - nl=(CommonTree)Match(input,NEWLINE,FOLLOW_NEWLINE_in_text1549); + nl=(CommonTree)Match(input,NEWLINE,FOLLOW_NEWLINE_in_text1579); elements.Add(nl.Text); } @@ -1615,7 +1622,7 @@ public Text text() // throws RecognitionException [1] // $ANTLR start "wordchar" - // SpecFlowLangWalker.g:224:1: wordchar returns [string text] : (wc= WORDCHAR | at= AT ); + // SpecFlowLangWalker.g:233:1: wordchar returns [string text] : (wc= WORDCHAR | at= AT ); public string wordchar() // throws RecognitionException [1] { string text = default(string); @@ -1625,7 +1632,7 @@ public string wordchar() // throws RecognitionException [1] try { - // SpecFlowLangWalker.g:225:5: (wc= WORDCHAR | at= AT ) + // SpecFlowLangWalker.g:234:5: (wc= WORDCHAR | at= AT ) int alt26 = 2; int LA26_0 = input.LA(1); @@ -1647,17 +1654,17 @@ public string wordchar() // throws RecognitionException [1] switch (alt26) { case 1 : - // SpecFlowLangWalker.g:225:9: wc= WORDCHAR + // SpecFlowLangWalker.g:234:9: wc= WORDCHAR { - wc=(CommonTree)Match(input,WORDCHAR,FOLLOW_WORDCHAR_in_wordchar1605); + wc=(CommonTree)Match(input,WORDCHAR,FOLLOW_WORDCHAR_in_wordchar1635); text = wc.Text; } break; case 2 : - // SpecFlowLangWalker.g:226:9: at= AT + // SpecFlowLangWalker.g:235:9: at= AT { - at=(CommonTree)Match(input,AT,FOLLOW_AT_in_wordchar1619); + at=(CommonTree)Match(input,AT,FOLLOW_AT_in_wordchar1649); @text = at.Text; } @@ -1679,7 +1686,7 @@ public string wordchar() // throws RecognitionException [1] // $ANTLR start "multilineText" - // SpecFlowLangWalker.g:229:1: multilineText returns [MultilineText multilineText] : ^( MULTILINETEXT (line_= line )* indent_= indent ) ; + // SpecFlowLangWalker.g:238:1: multilineText returns [MultilineText multilineText] : ^( MULTILINETEXT (line_= line )* indent_= indent ) ; public MultilineText multilineText() // throws RecognitionException [1] { MultilineText multilineText = default(MultilineText); @@ -1694,13 +1701,13 @@ public MultilineText multilineText() // throws RecognitionException [1] try { - // SpecFlowLangWalker.g:236:5: ( ^( MULTILINETEXT (line_= line )* indent_= indent ) ) - // SpecFlowLangWalker.g:236:9: ^( MULTILINETEXT (line_= line )* indent_= indent ) + // SpecFlowLangWalker.g:245:5: ( ^( MULTILINETEXT (line_= line )* indent_= indent ) ) + // SpecFlowLangWalker.g:245:9: ^( MULTILINETEXT (line_= line )* indent_= indent ) { - Match(input,MULTILINETEXT,FOLLOW_MULTILINETEXT_in_multilineText1660); + Match(input,MULTILINETEXT,FOLLOW_MULTILINETEXT_in_multilineText1690); Match(input, Token.DOWN, null); - // SpecFlowLangWalker.g:237:13: (line_= line )* + // SpecFlowLangWalker.g:246:13: (line_= line )* do { int alt27 = 2; @@ -1715,9 +1722,9 @@ public MultilineText multilineText() // throws RecognitionException [1] switch (alt27) { case 1 : - // SpecFlowLangWalker.g:237:14: line_= line + // SpecFlowLangWalker.g:246:14: line_= line { - PushFollow(FOLLOW_line_in_multilineText1677); + PushFollow(FOLLOW_line_in_multilineText1707); line_ = line(); state.followingStackPointer--; @@ -1734,7 +1741,7 @@ public MultilineText multilineText() // throws RecognitionException [1] loop27: ; // Stops C# compiler whining that label 'loop27' has no statements - PushFollow(FOLLOW_indent_in_multilineText1697); + PushFollow(FOLLOW_indent_in_multilineText1727); indent_ = indent(); state.followingStackPointer--; @@ -1761,7 +1768,7 @@ public MultilineText multilineText() // throws RecognitionException [1] // $ANTLR start "line" - // SpecFlowLangWalker.g:242:1: line returns [string line] : ^( LINE (ws= WS )? (text_= text )? nl= NEWLINE ) ; + // SpecFlowLangWalker.g:251:1: line returns [string line] : ^( LINE (ws= WS )? (text_= text )? nl= NEWLINE ) ; public string line() // throws RecognitionException [1] { string line = default(string); @@ -1776,13 +1783,13 @@ public string line() // throws RecognitionException [1] try { - // SpecFlowLangWalker.g:249:5: ( ^( LINE (ws= WS )? (text_= text )? nl= NEWLINE ) ) - // SpecFlowLangWalker.g:249:9: ^( LINE (ws= WS )? (text_= text )? nl= NEWLINE ) + // SpecFlowLangWalker.g:258:5: ( ^( LINE (ws= WS )? (text_= text )? nl= NEWLINE ) ) + // SpecFlowLangWalker.g:258:9: ^( LINE (ws= WS )? (text_= text )? nl= NEWLINE ) { - Match(input,LINE,FOLLOW_LINE_in_line1743); + Match(input,LINE,FOLLOW_LINE_in_line1773); Match(input, Token.DOWN, null); - // SpecFlowLangWalker.g:250:13: (ws= WS )? + // SpecFlowLangWalker.g:259:13: (ws= WS )? int alt28 = 2; int LA28_0 = input.LA(1); @@ -1793,9 +1800,9 @@ public string line() // throws RecognitionException [1] switch (alt28) { case 1 : - // SpecFlowLangWalker.g:250:14: ws= WS + // SpecFlowLangWalker.g:259:14: ws= WS { - ws=(CommonTree)Match(input,WS,FOLLOW_WS_in_line1760); + ws=(CommonTree)Match(input,WS,FOLLOW_WS_in_line1790); buffer.Append(ws.Text); } @@ -1803,7 +1810,7 @@ public string line() // throws RecognitionException [1] } - // SpecFlowLangWalker.g:251:13: (text_= text )? + // SpecFlowLangWalker.g:260:13: (text_= text )? int alt29 = 2; int LA29_0 = input.LA(1); @@ -1814,9 +1821,9 @@ public string line() // throws RecognitionException [1] switch (alt29) { case 1 : - // SpecFlowLangWalker.g:251:14: text_= text + // SpecFlowLangWalker.g:260:14: text_= text { - PushFollow(FOLLOW_text_in_line1790); + PushFollow(FOLLOW_text_in_line1820); text_ = text(); state.followingStackPointer--; @@ -1827,7 +1834,7 @@ public string line() // throws RecognitionException [1] } - nl=(CommonTree)Match(input,NEWLINE,FOLLOW_NEWLINE_in_line1814); + nl=(CommonTree)Match(input,NEWLINE,FOLLOW_NEWLINE_in_line1844); buffer.Append(nl.Text); Match(input, Token.UP, null); @@ -1852,7 +1859,7 @@ public string line() // throws RecognitionException [1] // $ANTLR start "indent" - // SpecFlowLangWalker.g:256:1: indent returns [string indent] : ^( INDENT (ws= WS )? ) ; + // SpecFlowLangWalker.g:265:1: indent returns [string indent] : ^( INDENT (ws= WS )? ) ; public string indent() // throws RecognitionException [1] { string indent = default(string); @@ -1864,15 +1871,15 @@ public string indent() // throws RecognitionException [1] try { - // SpecFlowLangWalker.g:260:5: ( ^( INDENT (ws= WS )? ) ) - // SpecFlowLangWalker.g:260:9: ^( INDENT (ws= WS )? ) + // SpecFlowLangWalker.g:269:5: ( ^( INDENT (ws= WS )? ) ) + // SpecFlowLangWalker.g:269:9: ^( INDENT (ws= WS )? ) { - Match(input,INDENT,FOLLOW_INDENT_in_indent1859); + Match(input,INDENT,FOLLOW_INDENT_in_indent1889); if ( input.LA(1) == Token.DOWN ) { Match(input, Token.DOWN, null); - // SpecFlowLangWalker.g:261:13: (ws= WS )? + // SpecFlowLangWalker.g:270:13: (ws= WS )? int alt30 = 2; int LA30_0 = input.LA(1); @@ -1883,9 +1890,9 @@ public string indent() // throws RecognitionException [1] switch (alt30) { case 1 : - // SpecFlowLangWalker.g:261:14: ws= WS + // SpecFlowLangWalker.g:270:14: ws= WS { - ws=(CommonTree)Match(input,WS,FOLLOW_WS_in_indent1876); + ws=(CommonTree)Match(input,WS,FOLLOW_WS_in_indent1906); indent = ws.Text; } @@ -1914,7 +1921,7 @@ public string indent() // throws RecognitionException [1] // $ANTLR start "table" - // SpecFlowLangWalker.g:265:1: table returns [Table table] : ^( TABLE ^( HEADER header_= tableRow ) ^( BODY (row_= tableRow )+ ) ) ; + // SpecFlowLangWalker.g:274:1: table returns [Table table] : ^( TABLE ^( HEADER header_= tableRow ) ^( BODY (row_= tableRow )+ ) ) ; public Table table() // throws RecognitionException [1] { Table table = default(Table); @@ -1929,25 +1936,25 @@ public Table table() // throws RecognitionException [1] try { - // SpecFlowLangWalker.g:272:5: ( ^( TABLE ^( HEADER header_= tableRow ) ^( BODY (row_= tableRow )+ ) ) ) - // SpecFlowLangWalker.g:272:9: ^( TABLE ^( HEADER header_= tableRow ) ^( BODY (row_= tableRow )+ ) ) + // SpecFlowLangWalker.g:281:5: ( ^( TABLE ^( HEADER header_= tableRow ) ^( BODY (row_= tableRow )+ ) ) ) + // SpecFlowLangWalker.g:281:9: ^( TABLE ^( HEADER header_= tableRow ) ^( BODY (row_= tableRow )+ ) ) { - Match(input,TABLE,FOLLOW_TABLE_in_table1924); + Match(input,TABLE,FOLLOW_TABLE_in_table1954); Match(input, Token.DOWN, null); - Match(input,HEADER,FOLLOW_HEADER_in_table1939); + Match(input,HEADER,FOLLOW_HEADER_in_table1969); Match(input, Token.DOWN, null); - PushFollow(FOLLOW_tableRow_in_table1943); + PushFollow(FOLLOW_tableRow_in_table1973); header_ = tableRow(); state.followingStackPointer--; Match(input, Token.UP, null); - Match(input,BODY,FOLLOW_BODY_in_table1959); + Match(input,BODY,FOLLOW_BODY_in_table1989); Match(input, Token.DOWN, null); - // SpecFlowLangWalker.g:274:20: (row_= tableRow )+ + // SpecFlowLangWalker.g:283:20: (row_= tableRow )+ int cnt31 = 0; do { @@ -1963,9 +1970,9 @@ public Table table() // throws RecognitionException [1] switch (alt31) { case 1 : - // SpecFlowLangWalker.g:274:21: row_= tableRow + // SpecFlowLangWalker.g:283:21: row_= tableRow { - PushFollow(FOLLOW_tableRow_in_table1964); + PushFollow(FOLLOW_tableRow_in_table1994); row_ = tableRow(); state.followingStackPointer--; @@ -2011,7 +2018,7 @@ public Table table() // throws RecognitionException [1] // $ANTLR start "tableRow" - // SpecFlowLangWalker.g:278:1: tableRow returns [Row row] : ^( ROW (cell_= tableCell )+ ) ; + // SpecFlowLangWalker.g:287:1: tableRow returns [Row row] : ^( ROW (cell_= tableCell )+ ) ; public Row tableRow() // throws RecognitionException [1] { Row row = default(Row); @@ -2024,13 +2031,13 @@ public Row tableRow() // throws RecognitionException [1] try { - // SpecFlowLangWalker.g:285:5: ( ^( ROW (cell_= tableCell )+ ) ) - // SpecFlowLangWalker.g:285:9: ^( ROW (cell_= tableCell )+ ) + // SpecFlowLangWalker.g:294:5: ( ^( ROW (cell_= tableCell )+ ) ) + // SpecFlowLangWalker.g:294:9: ^( ROW (cell_= tableCell )+ ) { - Match(input,ROW,FOLLOW_ROW_in_tableRow2012); + Match(input,ROW,FOLLOW_ROW_in_tableRow2042); Match(input, Token.DOWN, null); - // SpecFlowLangWalker.g:286:13: (cell_= tableCell )+ + // SpecFlowLangWalker.g:295:13: (cell_= tableCell )+ int cnt32 = 0; do { @@ -2046,9 +2053,9 @@ public Row tableRow() // throws RecognitionException [1] switch (alt32) { case 1 : - // SpecFlowLangWalker.g:286:14: cell_= tableCell + // SpecFlowLangWalker.g:295:14: cell_= tableCell { - PushFollow(FOLLOW_tableCell_in_tableRow2029); + PushFollow(FOLLOW_tableCell_in_tableRow2059); cell_ = tableCell(); state.followingStackPointer--; @@ -2092,7 +2099,7 @@ public Row tableRow() // throws RecognitionException [1] // $ANTLR start "tableCell" - // SpecFlowLangWalker.g:290:1: tableCell returns [Cell cell] : ^( CELL text_= text ) ; + // SpecFlowLangWalker.g:299:1: tableCell returns [Cell cell] : ^( CELL text_= text ) ; public Cell tableCell() // throws RecognitionException [1] { Cell cell = default(Cell); @@ -2102,13 +2109,13 @@ public Cell tableCell() // throws RecognitionException [1] try { - // SpecFlowLangWalker.g:294:5: ( ^( CELL text_= text ) ) - // SpecFlowLangWalker.g:294:9: ^( CELL text_= text ) + // SpecFlowLangWalker.g:303:5: ( ^( CELL text_= text ) ) + // SpecFlowLangWalker.g:303:9: ^( CELL text_= text ) { - Match(input,CELL,FOLLOW_CELL_in_tableCell2071); + Match(input,CELL,FOLLOW_CELL_in_tableCell2101); Match(input, Token.DOWN, null); - PushFollow(FOLLOW_text_in_tableCell2087); + PushFollow(FOLLOW_text_in_tableCell2117); text_ = text(); state.followingStackPointer--; @@ -2142,87 +2149,87 @@ private void InitializeCyclicDFAs() - public static readonly BitSet FOLLOW_FEATURE_in_feature73 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_tags_in_feature90 = new BitSet(new ulong[]{0x0000002000000000UL}); - public static readonly BitSet FOLLOW_text_in_feature108 = new BitSet(new ulong[]{0x000000001C000000UL}); - public static readonly BitSet FOLLOW_descriptionLine_in_feature125 = new BitSet(new ulong[]{0x000000001C000000UL}); - public static readonly BitSet FOLLOW_background_in_feature146 = new BitSet(new ulong[]{0x0000000010000000UL}); - public static readonly BitSet FOLLOW_SCENARIOS_in_feature163 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_scenarioKind_in_feature185 = new BitSet(new ulong[]{0x0000000060000008UL}); - public static readonly BitSet FOLLOW_TAGS_in_tags243 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_tag_in_tags260 = new BitSet(new ulong[]{0x0000020000000008UL}); - public static readonly BitSet FOLLOW_TAG_in_tag302 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_word_in_tag318 = new BitSet(new ulong[]{0x0000000000000008UL}); - public static readonly BitSet FOLLOW_WORD_in_word361 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_WORDCHAR_in_word378 = new BitSet(new ulong[]{0x0000000001000008UL}); - public static readonly BitSet FOLLOW_DESCRIPTIONLINE_in_descriptionLine420 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_text_in_descriptionLine436 = new BitSet(new ulong[]{0x0000000000000008UL}); - public static readonly BitSet FOLLOW_BACKGROUND_in_background474 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_text_in_background491 = new BitSet(new ulong[]{0x0000000200000000UL}); - public static readonly BitSet FOLLOW_steps_in_background509 = new BitSet(new ulong[]{0x0000000000000008UL}); - public static readonly BitSet FOLLOW_scenario_in_scenarioKind543 = new BitSet(new ulong[]{0x0000000000000002UL}); - public static readonly BitSet FOLLOW_scenarioOutline_in_scenarioKind557 = new BitSet(new ulong[]{0x0000000000000002UL}); - public static readonly BitSet FOLLOW_SCENARIOOUTLINE_in_scenarioOutline592 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_tags_in_scenarioOutline608 = new BitSet(new ulong[]{0x0000002000000000UL}); - public static readonly BitSet FOLLOW_text_in_scenarioOutline639 = new BitSet(new ulong[]{0x0000000200000000UL}); - public static readonly BitSet FOLLOW_steps_in_scenarioOutline655 = new BitSet(new ulong[]{0x0000000080000000UL}); - public static readonly BitSet FOLLOW_examples_in_scenarioOutline671 = new BitSet(new ulong[]{0x0000000000000008UL}); - public static readonly BitSet FOLLOW_SCENARIO_in_scenario714 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_tags_in_scenario731 = new BitSet(new ulong[]{0x0000002000000000UL}); - public static readonly BitSet FOLLOW_text_in_scenario762 = new BitSet(new ulong[]{0x0000000200000000UL}); - public static readonly BitSet FOLLOW_steps_in_scenario778 = new BitSet(new ulong[]{0x0000000000000008UL}); - public static readonly BitSet FOLLOW_EXAMPLES_in_examples821 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_exampleSet_in_examples838 = new BitSet(new ulong[]{0x0000000100000008UL}); - public static readonly BitSet FOLLOW_EXAMPLESET_in_exampleSet880 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_text_in_exampleSet896 = new BitSet(new ulong[]{0x0000400000000000UL}); - public static readonly BitSet FOLLOW_table_in_exampleSet913 = new BitSet(new ulong[]{0x0000000000000008UL}); - public static readonly BitSet FOLLOW_STEPS_in_steps951 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_step_in_steps968 = new BitSet(new ulong[]{0x000000DC00000008UL}); - public static readonly BitSet FOLLOW_GIVEN_in_step1015 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_text_in_step1031 = new BitSet(new ulong[]{0x0000480000000008UL}); - public static readonly BitSet FOLLOW_multilineText_in_step1047 = new BitSet(new ulong[]{0x0000400000000008UL}); - public static readonly BitSet FOLLOW_table_in_step1064 = new BitSet(new ulong[]{0x0000000000000008UL}); - public static readonly BitSet FOLLOW_WHEN_in_step1096 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_text_in_step1112 = new BitSet(new ulong[]{0x0000480000000008UL}); - public static readonly BitSet FOLLOW_multilineText_in_step1128 = new BitSet(new ulong[]{0x0000400000000008UL}); - public static readonly BitSet FOLLOW_table_in_step1145 = new BitSet(new ulong[]{0x0000000000000008UL}); - public static readonly BitSet FOLLOW_THEN_in_step1177 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_text_in_step1193 = new BitSet(new ulong[]{0x0000480000000008UL}); - public static readonly BitSet FOLLOW_multilineText_in_step1209 = new BitSet(new ulong[]{0x0000400000000008UL}); - public static readonly BitSet FOLLOW_table_in_step1226 = new BitSet(new ulong[]{0x0000000000000008UL}); - public static readonly BitSet FOLLOW_AND_in_step1258 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_text_in_step1274 = new BitSet(new ulong[]{0x0000480000000008UL}); - public static readonly BitSet FOLLOW_multilineText_in_step1290 = new BitSet(new ulong[]{0x0000400000000008UL}); - public static readonly BitSet FOLLOW_table_in_step1307 = new BitSet(new ulong[]{0x0000000000000008UL}); - public static readonly BitSet FOLLOW_BUT_in_step1339 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_text_in_step1355 = new BitSet(new ulong[]{0x0000480000000008UL}); - public static readonly BitSet FOLLOW_multilineText_in_step1371 = new BitSet(new ulong[]{0x0000400000000008UL}); - public static readonly BitSet FOLLOW_table_in_step1388 = new BitSet(new ulong[]{0x0000000000000008UL}); - public static readonly BitSet FOLLOW_TEXT_in_text1443 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_wordchar_in_text1460 = new BitSet(new ulong[]{0x0000000001D00008UL}); - public static readonly BitSet FOLLOW_WS_in_text1491 = new BitSet(new ulong[]{0x0000000001D00008UL}); - public static readonly BitSet FOLLOW_wordchar_in_text1523 = new BitSet(new ulong[]{0x0000000001D00008UL}); - public static readonly BitSet FOLLOW_NEWLINE_in_text1549 = new BitSet(new ulong[]{0x0000000001D00008UL}); - public static readonly BitSet FOLLOW_WORDCHAR_in_wordchar1605 = new BitSet(new ulong[]{0x0000000000000002UL}); - public static readonly BitSet FOLLOW_AT_in_wordchar1619 = new BitSet(new ulong[]{0x0000000000000002UL}); - public static readonly BitSet FOLLOW_MULTILINETEXT_in_multilineText1660 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_line_in_multilineText1677 = new BitSet(new ulong[]{0x0000300000000000UL}); - public static readonly BitSet FOLLOW_indent_in_multilineText1697 = new BitSet(new ulong[]{0x0000000000000008UL}); - public static readonly BitSet FOLLOW_LINE_in_line1743 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_WS_in_line1760 = new BitSet(new ulong[]{0x0000002000800000UL}); - public static readonly BitSet FOLLOW_text_in_line1790 = new BitSet(new ulong[]{0x0000000000800000UL}); - public static readonly BitSet FOLLOW_NEWLINE_in_line1814 = new BitSet(new ulong[]{0x0000000000000008UL}); - public static readonly BitSet FOLLOW_INDENT_in_indent1859 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_WS_in_indent1876 = new BitSet(new ulong[]{0x0000000000000008UL}); - public static readonly BitSet FOLLOW_TABLE_in_table1924 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_HEADER_in_table1939 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_tableRow_in_table1943 = new BitSet(new ulong[]{0x0000000000000008UL}); - public static readonly BitSet FOLLOW_BODY_in_table1959 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_tableRow_in_table1964 = new BitSet(new ulong[]{0x0002000000000008UL}); - public static readonly BitSet FOLLOW_ROW_in_tableRow2012 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_tableCell_in_tableRow2029 = new BitSet(new ulong[]{0x0004000000000008UL}); - public static readonly BitSet FOLLOW_CELL_in_tableCell2071 = new BitSet(new ulong[]{0x0000000000000004UL}); - public static readonly BitSet FOLLOW_text_in_tableCell2087 = new BitSet(new ulong[]{0x0000000000000008UL}); + public static readonly BitSet FOLLOW_FEATURE_in_feature81 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_tags_in_feature98 = new BitSet(new ulong[]{0x0000002000000000UL}); + public static readonly BitSet FOLLOW_text_in_feature116 = new BitSet(new ulong[]{0x000000001C000000UL}); + public static readonly BitSet FOLLOW_descriptionLine_in_feature133 = new BitSet(new ulong[]{0x000000001C000000UL}); + public static readonly BitSet FOLLOW_background_in_feature154 = new BitSet(new ulong[]{0x0000000010000000UL}); + public static readonly BitSet FOLLOW_SCENARIOS_in_feature171 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_scenarioKind_in_feature193 = new BitSet(new ulong[]{0x0000000060000008UL}); + public static readonly BitSet FOLLOW_TAGS_in_tags251 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_tag_in_tags268 = new BitSet(new ulong[]{0x0000020000000008UL}); + public static readonly BitSet FOLLOW_TAG_in_tag310 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_word_in_tag326 = new BitSet(new ulong[]{0x0000000000000008UL}); + public static readonly BitSet FOLLOW_WORD_in_word369 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_WORDCHAR_in_word386 = new BitSet(new ulong[]{0x0000000001000008UL}); + public static readonly BitSet FOLLOW_DESCRIPTIONLINE_in_descriptionLine428 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_text_in_descriptionLine444 = new BitSet(new ulong[]{0x0000000000000008UL}); + public static readonly BitSet FOLLOW_BACKGROUND_in_background504 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_text_in_background521 = new BitSet(new ulong[]{0x0000000200000000UL}); + public static readonly BitSet FOLLOW_steps_in_background539 = new BitSet(new ulong[]{0x0000000000000008UL}); + public static readonly BitSet FOLLOW_scenario_in_scenarioKind573 = new BitSet(new ulong[]{0x0000000000000002UL}); + public static readonly BitSet FOLLOW_scenarioOutline_in_scenarioKind587 = new BitSet(new ulong[]{0x0000000000000002UL}); + public static readonly BitSet FOLLOW_SCENARIOOUTLINE_in_scenarioOutline622 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_tags_in_scenarioOutline638 = new BitSet(new ulong[]{0x0000002000000000UL}); + public static readonly BitSet FOLLOW_text_in_scenarioOutline669 = new BitSet(new ulong[]{0x0000000200000000UL}); + public static readonly BitSet FOLLOW_steps_in_scenarioOutline685 = new BitSet(new ulong[]{0x0000000080000000UL}); + public static readonly BitSet FOLLOW_examples_in_scenarioOutline701 = new BitSet(new ulong[]{0x0000000000000008UL}); + public static readonly BitSet FOLLOW_SCENARIO_in_scenario744 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_tags_in_scenario761 = new BitSet(new ulong[]{0x0000002000000000UL}); + public static readonly BitSet FOLLOW_text_in_scenario792 = new BitSet(new ulong[]{0x0000000200000000UL}); + public static readonly BitSet FOLLOW_steps_in_scenario808 = new BitSet(new ulong[]{0x0000000000000008UL}); + public static readonly BitSet FOLLOW_EXAMPLES_in_examples851 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_exampleSet_in_examples868 = new BitSet(new ulong[]{0x0000000100000008UL}); + public static readonly BitSet FOLLOW_EXAMPLESET_in_exampleSet910 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_text_in_exampleSet926 = new BitSet(new ulong[]{0x0000400000000000UL}); + public static readonly BitSet FOLLOW_table_in_exampleSet943 = new BitSet(new ulong[]{0x0000000000000008UL}); + public static readonly BitSet FOLLOW_STEPS_in_steps981 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_step_in_steps998 = new BitSet(new ulong[]{0x000000DC00000008UL}); + public static readonly BitSet FOLLOW_GIVEN_in_step1045 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_text_in_step1061 = new BitSet(new ulong[]{0x0000480000000008UL}); + public static readonly BitSet FOLLOW_multilineText_in_step1077 = new BitSet(new ulong[]{0x0000400000000008UL}); + public static readonly BitSet FOLLOW_table_in_step1094 = new BitSet(new ulong[]{0x0000000000000008UL}); + public static readonly BitSet FOLLOW_WHEN_in_step1126 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_text_in_step1142 = new BitSet(new ulong[]{0x0000480000000008UL}); + public static readonly BitSet FOLLOW_multilineText_in_step1158 = new BitSet(new ulong[]{0x0000400000000008UL}); + public static readonly BitSet FOLLOW_table_in_step1175 = new BitSet(new ulong[]{0x0000000000000008UL}); + public static readonly BitSet FOLLOW_THEN_in_step1207 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_text_in_step1223 = new BitSet(new ulong[]{0x0000480000000008UL}); + public static readonly BitSet FOLLOW_multilineText_in_step1239 = new BitSet(new ulong[]{0x0000400000000008UL}); + public static readonly BitSet FOLLOW_table_in_step1256 = new BitSet(new ulong[]{0x0000000000000008UL}); + public static readonly BitSet FOLLOW_AND_in_step1288 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_text_in_step1304 = new BitSet(new ulong[]{0x0000480000000008UL}); + public static readonly BitSet FOLLOW_multilineText_in_step1320 = new BitSet(new ulong[]{0x0000400000000008UL}); + public static readonly BitSet FOLLOW_table_in_step1337 = new BitSet(new ulong[]{0x0000000000000008UL}); + public static readonly BitSet FOLLOW_BUT_in_step1369 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_text_in_step1385 = new BitSet(new ulong[]{0x0000480000000008UL}); + public static readonly BitSet FOLLOW_multilineText_in_step1401 = new BitSet(new ulong[]{0x0000400000000008UL}); + public static readonly BitSet FOLLOW_table_in_step1418 = new BitSet(new ulong[]{0x0000000000000008UL}); + public static readonly BitSet FOLLOW_TEXT_in_text1473 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_wordchar_in_text1490 = new BitSet(new ulong[]{0x0000000001D00008UL}); + public static readonly BitSet FOLLOW_WS_in_text1521 = new BitSet(new ulong[]{0x0000000001D00008UL}); + public static readonly BitSet FOLLOW_wordchar_in_text1553 = new BitSet(new ulong[]{0x0000000001D00008UL}); + public static readonly BitSet FOLLOW_NEWLINE_in_text1579 = new BitSet(new ulong[]{0x0000000001D00008UL}); + public static readonly BitSet FOLLOW_WORDCHAR_in_wordchar1635 = new BitSet(new ulong[]{0x0000000000000002UL}); + public static readonly BitSet FOLLOW_AT_in_wordchar1649 = new BitSet(new ulong[]{0x0000000000000002UL}); + public static readonly BitSet FOLLOW_MULTILINETEXT_in_multilineText1690 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_line_in_multilineText1707 = new BitSet(new ulong[]{0x0000300000000000UL}); + public static readonly BitSet FOLLOW_indent_in_multilineText1727 = new BitSet(new ulong[]{0x0000000000000008UL}); + public static readonly BitSet FOLLOW_LINE_in_line1773 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_WS_in_line1790 = new BitSet(new ulong[]{0x0000002000800000UL}); + public static readonly BitSet FOLLOW_text_in_line1820 = new BitSet(new ulong[]{0x0000000000800000UL}); + public static readonly BitSet FOLLOW_NEWLINE_in_line1844 = new BitSet(new ulong[]{0x0000000000000008UL}); + public static readonly BitSet FOLLOW_INDENT_in_indent1889 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_WS_in_indent1906 = new BitSet(new ulong[]{0x0000000000000008UL}); + public static readonly BitSet FOLLOW_TABLE_in_table1954 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_HEADER_in_table1969 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_tableRow_in_table1973 = new BitSet(new ulong[]{0x0000000000000008UL}); + public static readonly BitSet FOLLOW_BODY_in_table1989 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_tableRow_in_table1994 = new BitSet(new ulong[]{0x0002000000000008UL}); + public static readonly BitSet FOLLOW_ROW_in_tableRow2042 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_tableCell_in_tableRow2059 = new BitSet(new ulong[]{0x0004000000000008UL}); + public static readonly BitSet FOLLOW_CELL_in_tableCell2101 = new BitSet(new ulong[]{0x0000000000000004UL}); + public static readonly BitSet FOLLOW_text_in_tableCell2117 = new BitSet(new ulong[]{0x0000000000000008UL}); } } \ No newline at end of file diff --git a/Parser/Grammar/SpecFlowLangWalker.g b/Parser/Grammar/SpecFlowLangWalker.g index e58ea4923..7030f61ce 100644 --- a/Parser/Grammar/SpecFlowLangWalker.g +++ b/Parser/Grammar/SpecFlowLangWalker.g @@ -4,6 +4,7 @@ options { language = CSharp2; tokenVocab = SpecFlowLangParser; ASTLabelType = CommonTree; + superClass = SpecFlowLangWalkerBase; } @namespace { TechTalk.SpecFlow.Parser.Grammar } @@ -73,10 +74,18 @@ descriptionLine returns[DescriptionLine descriptionLine] ; background returns[Background background] +@init { + FilePosition fp_ = null; +} @after { $background = new Background(title_, steps_); + $background.FilePosition = fp_; } - : ^(BACKGROUND + : + { + fp_ = GetFilePosition(); + } + ^(BACKGROUND (title_=text)? steps_=steps ) diff --git a/Parser/Grammar/SpecFlowLangWalkerBase.cs b/Parser/Grammar/SpecFlowLangWalkerBase.cs new file mode 100644 index 000000000..e25f2cc0e --- /dev/null +++ b/Parser/Grammar/SpecFlowLangWalkerBase.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Antlr.Runtime; +using Antlr.Runtime.Tree; +using TechTalk.SpecFlow.Parser.SyntaxElements; + +namespace TechTalk.SpecFlow.Parser.Grammar +{ + public abstract class SpecFlowLangWalkerBase : TreeParser + { + protected SpecFlowLangWalkerBase(ITreeNodeStream input) : base(input) + { + } + + protected SpecFlowLangWalkerBase(ITreeNodeStream input, RecognizerSharedState state) : base(input, state) + { + } + + protected FilePosition GetFilePosition() + { + return new FilePosition(((ITree)input.LT(1)).Line, ((ITree)input.LT(1)).CharPositionInLine); + } + } +} diff --git a/Parser/SpecFlowGenerator.cs b/Parser/SpecFlowGenerator.cs index 5d06dc7df..3cf8ef52d 100644 --- a/Parser/SpecFlowGenerator.cs +++ b/Parser/SpecFlowGenerator.cs @@ -29,7 +29,7 @@ public CodeCompileUnit GenerateTestFileCode(string featureFileName, string conte IUnitTestGeneratorProvider generatorProvider = CreateInstance(project.GeneratorConfiguration.GeneratorUnitTestProviderType); - SpecFlowUnitTestConverter testConverter = new SpecFlowUnitTestConverter(generatorProvider); + SpecFlowUnitTestConverter testConverter = new SpecFlowUnitTestConverter(generatorProvider, project.GeneratorConfiguration.AllowDebugGeneratedFiles); CodeCompileUnit codeCompileUnit = testConverter.GenerateUnitTestFixture(feature, null, targetNamespace); return codeCompileUnit; diff --git a/Parser/SpecFlowUnitTestConverter.cs b/Parser/SpecFlowUnitTestConverter.cs index b3eb2cf9d..8932dd9f3 100644 --- a/Parser/SpecFlowUnitTestConverter.cs +++ b/Parser/SpecFlowUnitTestConverter.cs @@ -2,6 +2,7 @@ using System.CodeDom; using System.Collections.Generic; using System.Globalization; +using System.IO; using System.Linq; using System.Reflection; using System.Text; @@ -31,10 +32,12 @@ public class SpecFlowUnitTestConverter private const string SPECFLOW_NAMESPACE = "TechTalk.SpecFlow"; private readonly IUnitTestGeneratorProvider testGeneratorProvider; + private readonly bool allowDebugGeneratedFiles; - public SpecFlowUnitTestConverter(IUnitTestGeneratorProvider testGeneratorProvider) + public SpecFlowUnitTestConverter(IUnitTestGeneratorProvider testGeneratorProvider, bool allowDebugGeneratedFiles) { this.testGeneratorProvider = testGeneratorProvider; + this.allowDebugGeneratedFiles = allowDebugGeneratedFiles; } public CodeCompileUnit GenerateUnitTestFixture(Feature feature, string testClassName, string targetNamespace) @@ -43,6 +46,7 @@ public CodeCompileUnit GenerateUnitTestFixture(Feature feature, string testClass testClassName = testClassName ?? string.Format(FIXTURE_FORMAT, feature.Title.ToIdentifier()); CodeCompileUnit codeCompileUnit = new CodeCompileUnit(); + CodeNamespace codeNamespace = new CodeNamespace(targetNamespace); codeCompileUnit.Namespaces.Add(codeNamespace); @@ -53,6 +57,8 @@ public CodeCompileUnit GenerateUnitTestFixture(Feature feature, string testClass testType.TypeAttributes |= TypeAttributes.Public; codeNamespace.Types.Add(testType); + AddLinePragmaInitial(testType, feature); + testGeneratorProvider.SetTestFixture(testType, feature.Title, feature.Description); if (feature.Tags != null) { @@ -92,7 +98,6 @@ private void DeclareTestRunnerMember(CodeTypeDeclaration testType) private CodeExpression GetTestRunnerExpression() { return new CodeVariableReferenceExpression(TESTRUNNER_FIELD); - //return new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), TESTRUNNER_FIELD); } private IEnumerable GetNonIgnoreTags(IEnumerable tags) @@ -238,9 +243,13 @@ private void GenerateBackground(CodeTypeDeclaration testType, CodeMemberMethod t backgroundMethod.Attributes = MemberAttributes.Public; backgroundMethod.Name = BACKGROUND_NAME; + AddLineDirective(backgroundMethod.Statements, background); + foreach (var given in background.Steps) GenerateStep(backgroundMethod, given, null); + AddLineDirectiveHidden(backgroundMethod.Statements); + testSetup.Statements.Add( new CodeMethodInvokeExpression( new CodeThisReferenceExpression(), @@ -283,7 +292,7 @@ private void GenerateScenarioOutlineTest(CodeTypeDeclaration testType, CodeMembe //TODO: check params } - GenerateScenarioOutlineBody(scenarioOutline, paramToIdentifier, testType, testMethodName, testSetup); + GenerateScenarioOutlineBody(feature, scenarioOutline, paramToIdentifier, testType, testMethodName, testSetup); int exampleSetIndex = 0; foreach (var exampleSet in scenarioOutline.Examples.ExampleSets) @@ -311,7 +320,7 @@ private bool CanUseFirstColumnAsName(Table table) return table.Body.Select(r => r.Cells[0].Value.ToIdentifier()).Distinct().Count() == table.Body.Length; } - private void GenerateScenarioOutlineBody(ScenarioOutline scenarioOutline, ParameterSubstitution paramToIdentifier, CodeTypeDeclaration testType, string testMethodName, CodeMemberMethod testSetup) + private void GenerateScenarioOutlineBody(Feature feature, ScenarioOutline scenarioOutline, ParameterSubstitution paramToIdentifier, CodeTypeDeclaration testType, string testMethodName, CodeMemberMethod testSetup) { CodeMemberMethod testMethod = new CodeMemberMethod(); testType.Members.Add(testMethod); @@ -324,7 +333,7 @@ private void GenerateScenarioOutlineBody(ScenarioOutline scenarioOutline, Parame testMethod.Parameters.Add(new CodeParameterDeclarationExpression(typeof (string), pair.Value)); } - GenerateTestBody(scenarioOutline, testMethod, testSetup, paramToIdentifier); + GenerateTestBody(feature, scenarioOutline, testMethod, testSetup, paramToIdentifier); } private void GenerateScenarioOutlineTestVariant(CodeTypeDeclaration testType, ScenarioOutline scenarioOutline, string testMethodName, List> paramToIdentifier, string exampleSetTitle, Row row, string variantName) @@ -350,10 +359,10 @@ private void GenerateScenarioOutlineTestVariant(CodeTypeDeclaration testType, Sc private void GenerateTest(CodeTypeDeclaration testType, CodeMemberMethod testSetup, Scenario scenario, Feature feature) { CodeMemberMethod testMethod = GetTestMethodDeclaration(testType, scenario); - GenerateTestBody(scenario, testMethod, testSetup, null); + GenerateTestBody(feature, scenario, testMethod, testSetup, null); } - private void GenerateTestBody(Scenario scenario, CodeMemberMethod testMethod, CodeMemberMethod testSetup, ParameterSubstitution paramToIdentifier) + private void GenerateTestBody(Feature feature, Scenario scenario, CodeMemberMethod testMethod, CodeMemberMethod testSetup, ParameterSubstitution paramToIdentifier) { //call test setup //ScenarioInfo scenarioInfo = new ScenarioInfo("xxxx", tags...); @@ -363,6 +372,7 @@ private void GenerateTestBody(Scenario scenario, CodeMemberMethod testMethod, Co new CodePrimitiveExpression(scenario.Title), GetStringArrayExpression(scenario.Tags)))); + AddLineDirective(testMethod.Statements, scenario); testMethod.Statements.Add( new CodeMethodInvokeExpression( new CodeThisReferenceExpression(), @@ -374,6 +384,7 @@ private void GenerateTestBody(Scenario scenario, CodeMemberMethod testMethod, Co GenerateStep(testMethod, scenarioStep, paramToIdentifier); } + AddLineDirectiveHidden(testMethod.Statements); // call collect errors var testRunnerField = GetTestRunnerExpression(); @@ -453,12 +464,14 @@ private void GenerateStep(CodeMemberMethod testMethod, ScenarioStep scenarioStep GetSubstitutedString(scenarioStep.Text, paramToIdentifier)); if (scenarioStep.MultiLineTextArgument != null || scenarioStep.TableArg != null) { + AddLineDirectiveHidden(testMethod.Statements); arguments.Add( GetMultilineTextArgExpression(scenarioStep.MultiLineTextArgument, paramToIdentifier)); arguments.Add( GetTableArgExpression(scenarioStep.TableArg, testMethod.Statements, paramToIdentifier)); } + AddLineDirective(testMethod.Statements, scenarioStep); testMethod.Statements.Add( new CodeMethodInvokeExpression( testRunnerField, @@ -498,5 +511,51 @@ private CodeExpression GetMultilineTextArgExpression(string multiLineTextArgumen { return GetSubstitutedString(multiLineTextArgument, paramToIdentifier); } + + #region Line pragma handling + + private void AddLinePragmaInitial(CodeTypeDeclaration testType, Feature feature) + { + testType.Members.Add(new CodeSnippetTypeMember(string.Format("#line 1 \"{0}\"", feature.SourceFile))); + testType.Members.Add(new CodeSnippetTypeMember("#line hidden")); + } + + private void AddLineDirectiveHidden(CodeStatementCollection statements) + { + if (allowDebugGeneratedFiles) + return; + + statements.Add(new CodeSnippetStatement("#line hidden")); + } + + private void AddLineDirective(CodeStatementCollection statements, Background background) + { + //AddLineDirective(statements, null, background.SourceFileLine); + } + + private void AddLineDirective(CodeStatementCollection statements, Scenario scenario) + { + AddLineDirective(statements, null, scenario.SourceFileLine); + } + + private void AddLineDirective(CodeStatementCollection statements, ScenarioStep step) + { + AddLineDirective(statements, null, step.SourceFileLine); + } + + private void AddLineDirective(CodeStatementCollection statements, string sourceFile, int? sourceFileLine) + { + if (sourceFileLine == null || allowDebugGeneratedFiles) + return; + + if (sourceFile == null) + statements.Add(new CodeSnippetStatement( + string.Format("#line {0}", sourceFileLine))); + else + statements.Add(new CodeSnippetStatement( + string.Format("#line {0} \"{1}\"", sourceFileLine, Path.GetFileName(sourceFile)))); + } + + #endregion } } diff --git a/Parser/SyntaxElements/Background.cs b/Parser/SyntaxElements/Background.cs index a7e3d50ea..3dced98a9 100644 --- a/Parser/SyntaxElements/Background.cs +++ b/Parser/SyntaxElements/Background.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using System.Xml.Serialization; namespace TechTalk.SpecFlow.Parser.SyntaxElements { @@ -8,6 +9,8 @@ public class Background public string Title { get; set; } public ScenarioSteps Steps { get; set; } + public FilePosition FilePosition { get; set; } + public Background() { } diff --git a/Parser/SyntaxElements/FilePosition.cs b/Parser/SyntaxElements/FilePosition.cs new file mode 100644 index 000000000..36ef23cd1 --- /dev/null +++ b/Parser/SyntaxElements/FilePosition.cs @@ -0,0 +1,24 @@ +using System; +using System.Linq; +using System.Xml.Serialization; + +namespace TechTalk.SpecFlow.Parser.SyntaxElements +{ + public class FilePosition + { + [XmlAttribute("line")] + public int Line; + [XmlAttribute("column")] + public int Column; + + public FilePosition() + { + } + + public FilePosition(int line, int column) + { + Line = line; + Column = column; + } + } +} \ No newline at end of file diff --git a/Parser/TechTalk.SpecFlow.Parser.csproj b/Parser/TechTalk.SpecFlow.Parser.csproj index 7e78fa7b4..868e164b9 100644 --- a/Parser/TechTalk.SpecFlow.Parser.csproj +++ b/Parser/TechTalk.SpecFlow.Parser.csproj @@ -86,6 +86,8 @@ Code + + diff --git a/Runtime/Configuration/ConfigurationSectionHandler.cs b/Runtime/Configuration/ConfigurationSectionHandler.cs index 5f23b522b..d8064eb15 100644 --- a/Runtime/Configuration/ConfigurationSectionHandler.cs +++ b/Runtime/Configuration/ConfigurationSectionHandler.cs @@ -27,6 +27,8 @@ public static class ConfigDefaults internal const bool TraceSuccessfulSteps = true; internal const bool TraceTimings = false; internal const string MinTracedDuration = "0:0:0.1"; + + internal const bool AllowDebugGeneratedFiles = false; } partial class ConfigurationSectionHandler : ConfigurationSection diff --git a/Runtime/TestRunner.cs b/Runtime/TestRunner.cs index 07b3ffebf..782ea274b 100644 --- a/Runtime/TestRunner.cs +++ b/Runtime/TestRunner.cs @@ -97,8 +97,11 @@ public void OnScenarioStart(ScenarioInfo scenarioInfo) FireScenarioEvents(BindingEvent.ScenarioStart); } + //TODO: rename this method to OnAfterLastStep (breaking change in generation!) public void CollectScenarioErrors() { + HandleBlockSwitch(ScenarioBlock.None); + if (RuntimeConfiguration.Current.TraceTimings) { ObjectContainer.ScenarioContext.Stopwatch.Stop(); @@ -141,8 +144,6 @@ public void CollectScenarioErrors() public void OnScenarioEnd() { - HandleBlockSwitch(ScenarioBlock.None); - FireScenarioEvents(BindingEvent.ScenarioEnd); ObjectContainer.ScenarioContext = null; } diff --git a/Tests/ParserTests/SuccessfulGenerationTest.cs b/Tests/ParserTests/SuccessfulGenerationTest.cs index 69834bc4a..80ae49e83 100644 --- a/Tests/ParserTests/SuccessfulGenerationTest.cs +++ b/Tests/ParserTests/SuccessfulGenerationTest.cs @@ -155,7 +155,7 @@ private void CompareWithExpectedResult(Feature feature, string expectedResultFil private void GenerateCodeFromFeature(Feature feature, TextWriter writer) { - SpecFlowUnitTestConverter converter = new SpecFlowUnitTestConverter(new NUnitTestConverter()); + SpecFlowUnitTestConverter converter = new SpecFlowUnitTestConverter(new NUnitTestConverter(), true); var compileUnit = converter.GenerateUnitTestFixture(feature, "TestClassName", "Target.Namespace"); CSharpCodeProvider codeProvider = new CSharpCodeProvider();