Exemple #1
0
        private void button_getrules_Click(object sender, EventArgs e)
        {
            string s = richTextBox_rules.Text;

            ProLoadGrammar lgp = new ProLoadGrammar(s, OG);

            OG = lgp.LoadGram();


            //输出
            initListViewshowRules();

            foreach (Rule rules in OG.pat)
            {
                ListViewItem aItem = new ListViewItem(rules.left);
                ListViewItem.ListViewSubItem SubItem = new ListViewItem.ListViewSubItem();//定义第一个子项目

                string re = "";

                foreach (string restmp in rules.right)
                {
                    re += restmp;
                }

                SubItem.Text = re;
                aItem.SubItems.Add(SubItem);
                listView_showRules.Items.Add(aItem);
            }
        }
Exemple #2
0
 public ProLoadGrammar(string s, OriginalGrammar OG)
 {
     this.OG = OG;
     prules  = s;
 }
Exemple #3
0
 public ProJudge(OriginalGrammar OG, List <State> StateSet)
 {
     this.OG       = OG;
     this.StateSet = StateSet;
     judgeStack    = new Stack <stackNode>();
 }
 public ProFillTable(OriginalGrammar OG, List <State> StateSet)
 {
     this.OG       = OG;
     this.StateSet = StateSet;
 }
 public ProCreateDFA(OriginalGrammar OG)
 {
     this.OG  = OG;
     StateSet = new List <State>();
     ERSet    = new List <ExtendRule>();
 }
Exemple #6
0
        private void Form1_Load(object sender, EventArgs e)
        {
            OG = new OriginalGrammar();

            richTextBox_rules.Text = "S->A\nA->aB|bC\nB->cB|d\nC->cC|e";
        }