Пример #1
0
 public void Execute(Lexem lexem)
 {
     Program.Add(lexem);
 }
Пример #2
0
 public RuleMatch(Lexem lexem, GrammarRule rule)
 {
     Lexem = lexem;
     Rule  = rule;
 }
Пример #3
0
 public GrammarException(string message, Lexem lexem)
     : base(message)
 {
     Lexem = lexem;
 }
Пример #4
0
        public RuleMatch Match(Lexem lexem)
        {
            var rule = Grammar.Find(r => r.IsMatch(lexem)) ?? throw new GrammarException("No rule for lexem " + lexem, lexem);

            return(new RuleMatch(lexem, rule));
        }