token.cs

来自「编译原理语法分析和词法分析综合实验: 源程序、可执行程序、测试程序文件、程序运行」· CS 代码 · 共 36 行

CS
36
字号
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;

namespace Lane.Compiler.WordAnalyser.Core
{
    public class Token
    {
        private string group;
        private string value;
        private int index;

        public string Group { get { return group; } }
        public string Value { get { return value; } }
        public int Index { get { return index; } }
        public int Length
        {
            get { return value == null ? -1 : value.Length; }
        }

        Token() { }
        internal Token(string group, string value, int index)
        {
            this.group = group;
            this.value = value;
            this.index = index;
        }
        
        public override string ToString()
        {
            return string.Format("{0}\t\t: {1}", group, value);
        }     
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?