Example #1
0
 internal static CompiledGrammar GetGrammar(SemanticActions <T> actions)
 {
     if (actions == null)
     {
         throw new ArgumentNullException("actions");
     }
     return(actions.Grammar);
 }
Example #2
0
 public SemanticProcessor(ITokenizer <T> tokenizer, SemanticActions <T> actions) : base(tokenizer)
 {
     if (actions == null)
     {
         throw new ArgumentNullException("actions");
     }
     if (tokenizer.Grammar != actions.Grammar)
     {
         throw new ArgumentException("Mismatch of tokenizer and action grammars");
     }
     this.actions = actions;
 }
Example #3
0
 internal SemanticTrimFactory(SemanticActions <TBase> owner, Rule rule, int handleIndex)
 {
     if (owner == null)
     {
         throw new ArgumentNullException("owner");
     }
     if (rule == null)
     {
         throw new ArgumentNullException("rule");
     }
     if ((handleIndex < 0) || (handleIndex >= rule.SymbolCount))
     {
         throw new ArgumentOutOfRangeException("handleIndex");
     }
     this.owner       = owner;
     this.handleIndex = handleIndex;
     this.rule        = rule;
 }
Example #4
0
 public SemanticTokenizer(TextReader textReader, SemanticActions <T> actions) : base(textReader, actions.Grammar)
 {
     this.actions = actions;
 }
Example #5
0
 public SemanticProcessor(TextReader reader, SemanticActions <T> actions) : this(actions.CreateTokenizer(reader), actions)
 {
 }