コード例 #1
0
        public void AddTerminalTo(string terminal, string toterminal)
        {
            GrammarElement t     = _terminals[toterminal];
            Type           ttype = t.GetType();

            if (ttype == typeof(CompoundGrammarElement) || ttype == typeof(MultiParseGrammarElement))
            {
                CompoundGrammarElement cge = (CompoundGrammarElement)t;
                cge.AddTerminal(_terminals[terminal]);
                return;
            }
            throw new InvalidOperationException(terminal + " cannot be added to the 'toterminal' parameter " + toterminal + " of " + t.GetType() + " type, and does not support terminal addition.");
        }
コード例 #2
0
 public void AddTerminal(GrammarElement ge)
 {
     _te.Add(ge);
 }
コード例 #3
0
 public void AddTerminal(string terminalname, GrammarElement terminal)
 {
     terminal.Name = terminalname;
     _terminals.Add(terminalname, terminal);
 }
コード例 #4
0
 public RepetitiveGrammarElement(GrammarElement ge)
 {
     _torepeat = ge;
 }