Пример #1
0
        private static void CreateRulesFromProperty(IEnumerable <string> propLines, out string globalDeclarations, out List <Rule> rules)
        {
            List <Tuple <string, string, string> > ruleTriples;
            string templateVariables;

            PropertyParser.ParseProperty(propLines, out globalDeclarations, out ruleTriples, out templateVariables);

            rules = new List <Rule>();
            foreach (var triple in ruleTriples)
            {
                if (triple.Item1 == PropertyKeyWords.CmdRule)
                {
                    rules.Add(new CmdRule(triple.Item2, triple.Item3, globalDeclarations + templateVariables));
                    Stats.count("No " + PropertyKeyWords.CmdRule);
                }
                if (triple.Item1 == PropertyKeyWords.ProcedureRule)
                {
                    rules.Add(new InsertAtBeginningRule(triple.Item2, triple.Item3, globalDeclarations));
                    Stats.count("No " + PropertyKeyWords.ProcedureRule);
                }
            }
        }