_Core/Lang/Parser/PluginSupport/LexPlugin.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ComLib.Lang
{
    /// <summary>
    /// A combinator to extend the parser
    /// </summary>
    public class LexPlugin : ILexPlugin
    {
        /// <summary>
        /// The starting tokens that are associated w/ the combinator.
        /// </summary>
        protected string[] _tokens;


        /// <summary>
        /// The main lexer.
        /// </summary>
        protected Lexer _lexer;


        /// <summary>
        /// Whether or not this combinator can be made into a statemnt.
        /// </summary>
        protected bool _canHandleToken = false;


        /// <summary>
        /// Initialize the combinator.
        /// </summary>
        /// <param name="lexer">The main lexer</param>
        public virtual void Init(Lexer lexer)
        {
            _lexer = lexer;
        }


        /// <summary>
        /// Precendence
        /// </summary>
        public int Precedence { get; set; }


        /// <summary>
        /// get / set the lexer.
        /// </summary>
        public virtual Lexer Lexer
        {
            get { return _lexer; }
            set { _lexer = value; }
        }


        /// <summary>
        /// The tokens that are associated w/ this combinator.
        /// </summary>
        public virtual string[] Tokens
后面还有 44 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。