コード例 #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
        }
コード例 #2
0
ファイル: SqlGrammarBase.cs プロジェクト: meikeric/deveeldb
        protected KeyTerm Key(string term)
        {
            KeyTerm keyTerm;

            if (!KeyTerms.TryGetValue(term, out keyTerm))
            {
                KeyTerms[term] = keyTerm = ToTerm(term);
            }

            return(keyTerm);
        }