Esempio n. 1
0
        public GrammarExpression(
            ProductionExpression start,
            IEnumerable<ProductionExpression> productions,
            IEnumerable<ILexerRule> ignore)
        {
            GrammarModel = new GrammarModel
            {
                Start = start.ProductionModel
            };

            if (productions != null)
                foreach (var production in productions)
                    GrammarModel.Productions.Add(production.ProductionModel);
            if (ignore != null)
                foreach (var ignoreRule in ignore)
                    GrammarModel.IgnoreRules.Add(new LexerRuleModel(ignoreRule));
        }