operand.cs

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

CS
38
字号
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;

namespace syn
{
    public class Operand
    {
        //private double _operand;
        private string _operand;

        public Operand(string word)
        {
            _operand = word;
            //TypeConverter converter = TypeDescriptor.GetConverter(this._operand);
            //this._operand = (double)converter.ConvertFromString(word);
            
        }

 
        //判断是否是操作数
        public static bool IsOperand(char ch)
        {
            if (char.IsLetterOrDigit(ch) || ch == '.'  || ch =='_')
                return true;
            else
                return false;
        }

        public override string ToString()
        {
            return this._operand.ToString();
        }

    }
}

⌨️ 快捷键说明

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