Example #1
0
        protected override T CreateReduction(Rule rule, IList <T> children)
        {
            SemanticNonterminalFactory <T> factory;

            if (actions.TryGetNonterminalFactory(rule, out factory))
            {
                Debug.Assert(factory != null);
                return(factory.CreateAndInitialize(rule, children));
            }
            throw new InvalidOperationException(string.Format("Missing a token type for the rule {0}", rule.Definition));
        }