示例#1
0
文件: Automata.cs 项目: Egaros/lib
 protected Automata(AutomataManager manager)
 {
     if (manager == null)
     {
         throw new ArgumentNullException(nameof(manager));
     }
 }
示例#2
0
            public ParserAutomata(AutomataManager manager) : base(manager)
            {
                //_parser = parser;

                var grammar = Grammar.Get <TGrammar, TToken>();

                foreach (var parserRule in grammar.ParserRules)
                {
                    RegisterParserRule(parserRule);
                }
            }
示例#3
0
            public LexerAutomata(AutomataManager manager) : base(manager)
            {
                var grammar = Grammar.Get <TGrammar, TToken>();

                foreach (var tokenFragment in grammar.TokenFragments)
                {
                    RegisterLexerFragment(tokenFragment);
                }

                foreach (var tokenRule in grammar.TokenRules.OrderByDescending(r => r.TokenCode))
                {
                    RegisterLexerRule(tokenRule);
                }

                BuildStates();
            }
示例#4
0
 protected ParserAutomataBase(AutomataManager manager) : base(manager)
 {
 }