示例#1
0
            /// <summary>
            /// Instantiate a new KeywordToken
            /// </summary>
            /// <param name="Keyword">String for keyword</param>
            /// <param name="TokenConstructor">Delegate that returns a new Token, It must implement ExcecuteStatement() </param>
            public KeywordTokenConstructor(String Keyword, TokenConstructorDelegate TokenConstructor)
            {
                if (TokenConstructor == null)
                {
                    throw new NullReferenceException("TokenConstructor can't be NULL");
                }

                this.Keyword          = Keyword.ToLower();
                this.TokenConstructor = TokenConstructor;
            }
示例#2
0
文件: Parser.cs 项目: Punk-Sky/PunkOS
            /// <summary>
            /// Instantiate a new KeywordToken
            /// </summary>
            /// <param name="Keyword">String for keyword</param>
            /// <param name="TokenConstructor">Delegate that returns a new Token, It must implement ExcecuteStatement() </param>
            public KeywordTokenConstructor(String Keyword, TokenConstructorDelegate TokenConstructor)
            {
                if (TokenConstructor == null)
                    throw new NullReferenceException("TokenConstructor can't be NULL");

                this.Keyword = Keyword.ToLower();
                this.TokenConstructor = TokenConstructor;
            }