Exemplo n.º 1
0
        public COOPClassParser()
        {
            startSymbol = SyntacticCategories.start;
            RuleManager = new RuleManager <string>();


            RuleManager.AddSet("reserved", ReservedWords.getReservedWords());
            RuleManager.AddToSet("reserved", "int", "double", "float", "char", "long");
            RuleManager.AddSet("reserved_types", "int", "double", "float", "char", "long");

            var classDefCollector = StandardCollectors.CategoryCollectorMulti("symbol", "class_name", "class");

            Rule classNameRule = new RuleOutOfSet(RuleManager["reserved"], classDefCollector);

            RuleManager.AddRule(classNameRule);
        }