FindGrammar() public method

public FindGrammar ( string key ) : GrammarModel
key string
return GrammarModel
        public void ValidateStepsWithinSection(Section section, FixtureModel fixture)
        {
            if (fixture.IsMissing)
            {
                AddError($"Fixture '{fixture.key}' is not implemented");
            }

            var i = 0;

            foreach (var step in section.Children.OfType <Step>())
            {
                i++;

                _locations.Push($"Step #{i}: {step.Key}");

                var grammar = fixture.FindGrammar(step.Key);
                if (grammar == null)
                {
                    AddError($"Unknown Grammar '{step.Key}'");
                }
                else
                {
                    if (grammar.IsMissing)
                    {
                        AddError($"Grammar '{step.Key}' is not implemented");
                    }

                    grammar.PostProcessAndValidate(this, step);
                }

                _locations.Pop();
            }
        }
コード例 #2
0
        public void ValidateStepsWithinSection(Section section, FixtureModel fixture)
        {
            if (fixture.IsMissing)
            {
                AddError($"Fixture '{fixture.key}' is not implemented");
            }

            var i = 0;
            foreach (var step in section.Children.OfType<Step>())
            {
                i++;

                _locations.Push($"Step #{i}: {step.Key}");

                var grammar = fixture.FindGrammar(step.Key);
                if (grammar == null)
                {
                    AddError($"Unknown Grammar '{step.Key}'");
                }
                else
                {
                    if (grammar.IsMissing)
                    {
                        AddError($"Grammar '{step.Key}' is not implemented");
                    }

                    grammar.PostProcessAndValidate(this, step);
                }

                _locations.Pop();
            }
        }