Beispiel #1
0
 protected Lexer(Lexer parent, LineEnumerator lineEnumerator, Language language)
 {
     this.parent = parent;
     LineEnumerator = lineEnumerator;
     Language = language;
     //TODO: Should probably unsubscribe to event at some point
     Language.LanguageChanged += ChangeLanguage;
     SetupRegex();
 }
 public BackgroundLexer(Lexer parent, LineEnumerator lineEnumerator, IListener listener, Language language)
     : base(parent, lineEnumerator, language)
 {
     this.listener = listener;
     children = new Lexer[]
                    {
                        new CommentLexer(this, lineEnumerator, listener, language),
                        new StepLexer(this, lineEnumerator, listener, language),
                    };
 }
Beispiel #3
0
 public ExampleLexer(Lexer parent, LineEnumerator lineEnumerator, IListener listener, Language language)
     : base(parent, lineEnumerator, language)
 {
     this.listener = listener;
     children = new Lexer[]
                    {
                        new RowLexer(this, lineEnumerator, listener, language),
                        new CommentLexer(this, lineEnumerator, listener, language),
                        new UriLexer(this, lineEnumerator, listener, language)
                    };
 }
Beispiel #4
0
 public StartLexer(Lexer parent, LineEnumerator lineEnumerator, IListener listener, Language language)
     : base(parent, lineEnumerator, language)
 {
     children = new Lexer[]
                    {
                        new FeatureLexer(this, lineEnumerator, listener, language),
                        new TagLexer(this, lineEnumerator, listener, language),
                        new CommentLexer(this, lineEnumerator, listener, language),
                        new ScenarioLexer(this, lineEnumerator, listener, language),
                    };
 }
        public ScenarioLexer(Lexer parent, LineEnumerator lineEnumerator, IListener listener, Language language)
            : base(parent, lineEnumerator, language)
        {
            Listener = listener;

            children = new Lexer[]
                           {
                               new StepLexer(this, lineEnumerator, listener, language),
                               new ExampleLexer(this, lineEnumerator, listener, language),
                               new CommentLexer(this, lineEnumerator, listener, language)
                           };
        }
Beispiel #6
0
 public FeatureLexer(Lexer parent, LineEnumerator lineEnumerator, IListener listener, Language language)
     : base(parent, lineEnumerator, language)
 {
     this.listener = listener;
     children = new Lexer[]
                    {
                        new ScenarioLexer(this, lineEnumerator, listener, language),
                        new CommentLexer(this, lineEnumerator, listener, language),
                        new ScenarioOutlineLexer(this, lineEnumerator, listener, language),
                        new BackgroundLexer(this, lineEnumerator, listener, language),
                        new TagLexer(this, lineEnumerator, listener, language),
                    };
 }
Beispiel #7
0
 public CommentLexer(Lexer parent, LineEnumerator lineEnumerator, IListener listener, Language language)
     : base(parent, lineEnumerator, language)
 {
     this.listener = listener;
 }
Beispiel #8
0
 public LexerForTokenWord(Lexer lexer, string tokenWord)
 {
     Lexer = lexer;
     TokenWord = tokenWord;
 }
 public ScenarioOutlineLexer(Lexer parent, LineEnumerator lineEnumerator, IListener listener, Language language)
     : base(parent, lineEnumerator, listener, language)
 {
 }
Beispiel #10
0
 public UriLexer(Lexer parent, LineEnumerator lineEnumerator, IListener listener, Language language)
     : base(parent, lineEnumerator, listener, language)
 {
 }
Beispiel #11
0
 private void ReadMultiLineStep(Lexer parentLexer, LineMatch lineMatch)
 {
     if (CanSpanMultipleLines
         && NextLineIsStep(parentLexer) == false
         && NextLineIsChildStep(lineMatch) == false)
     {
         string moreTitle = GetStepText();
         lineMatch.Text = (string.IsNullOrEmpty(moreTitle)) ? lineMatch.Text : lineMatch.Text + lineMatch.ParsedLine.LineEnd + moreTitle;
     }
 }
Beispiel #12
0
 private bool NextLineIsStep(Lexer lexer)
 {
     if (LineEnumerator.HasMore == false)
         return false;
     LineEnumerator.MoveToNext();
     var lineMatch = lexer.LineMatcher.Match(LineEnumerator.Current);
     LineEnumerator.MoveToPrevious();
     return (lineMatch != null);
 }