Inheritance: KeyTerm, IBnfiTerm
Example #1
0
        public new BnfiTermKeyTerm ToTerm(string text, string name)
        {
            #region Copied from Irony.Parsing.Grammar.ToTerm(string text, string name)

            KeyTerm term;
            if (KeyTerms.TryGetValue(text, out term))
            {
                //update name if it was specified now and not before
                if (string.IsNullOrEmpty(term.Name) && !string.IsNullOrEmpty(name))
                {
                    term.Name = name;
                }
                return((BnfiTermKeyTerm)term);
            }
            //create new term
            if (!CaseSensitive)
            {
                text = text.ToLowerInvariant();
            }
#if !PCL
            string.Intern(text);
#endif
            term           = new BnfiTermKeyTerm(text, name);
            KeyTerms[text] = term;
            return((BnfiTermKeyTerm)term);

            #endregion
        }
Example #2
0
 public static BnfiTermNoAst NoAst(this BnfiTermKeyTerm bnfiTermKeyTerm)
 {
     return(BnfiTermNoAst.For(bnfiTermKeyTerm));
 }
Example #3
0
 public static BnfiTermNoAst For(BnfiTermKeyTerm bnfiTermKeyTerm)
 {
     return(new BnfiTermNoAst(bnfiTermKeyTerm, valueCreatorFromNoAst: null));
 }