using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public struct nameSet // 実行用スタックの要素
{ public string name; // 変数名,評価済みのとき"*VALUE*"
public double value; // 評価済み値
public nameSet(string n, double v) { name = n; value = v;}
}
public struct opeSet // 逆ポーランド変換用スタックの要素
{ public string name; // 演算子
public int value; // 優先順位
public opeSet(string n, int v) { name = n; value = v;}
}
public struct token // 単一トークンの形式
{ public string atr; // トークンの種類"NUM","OPE","VAR"
public string str; // トークンの文字列
public token(string a, string s) { atr = a.ToUpper(); str=s;}
}
public nameSet[] STab=new nameSet[500]; // 記号表
public int numStab; // 記号表のサイズ
public token[] Polish = new token[500]; // 逆ポーランド記法の出力先
public int numPolish; // 逆ポーランド記法のサイズ
public nameSet[] Stack = new nameSet[500]; // 実行用スタック
public int stackP; // スタックポインタ
public opeSet[] StackOpe = new opeSet[500];// 逆ポーランド変換用スタック
public string Alltext; // 入力文字列
public string Delmiter = "()+-*/="; // 区切り記号(演算子)
public string Number = "0123456789"; // 数字
public token[] LAData = new token[500]; // 語彙解析結果