示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            f = false;
            richTextBox6.Text   = null;
            TokenList2          = new LinkList();
            LineNo              = 1;
            BreakWordList       = new LinkList();
            BreakWordList_Clear = new LinkList();
            // richTextBox2.Text = null;
            // richTextBox3.Text = null;
            allText      = richTextBox1.Text;
            StringLenght = allText.Length;
            //BreakWordFunction(allText);
            break_words(allText);

            // richTextBox2.Text = BreakWordList_Clear.DisplayList();

            AddItemsInToken();
            // richTextBox3.Text = TokenList.DisplayTokens();
            //SyntaxAnalyzer SA = new SyntaxAnalyzer(TokenList);


            CurrentNode123 = TokenList.GetHead();

            OutNextLine();

            richTextBox5.Text = TokenList2.DisplayTokens();

            SyntaxAnalyzer SA = new SyntaxAnalyzer(TokenList2);

            Do pa = new Do();

            pa = SA.ABS();
            if (pa.cppp == "Valid Syntax")
            {
                richTextBox4.Text = pa.cppp;
            }
            else
            {
                richTextBox4.Text = pa.cppp + "\n" + "Syntax Error on Line" + pa.cpline;
            }

            int i = 1;

            while (i < 100)
            {
                richTextBox6.Text += i + "\n";
                i++;
            }


            //StreamWriter streamWriter = new StreamWriter(@"C:\Users\Mahad Khan\source\repos\BreakWord\BreakWord\TokensFile.txt");
            //streamWriter.WriteLine(richTextBox3.Text);
            //streamWriter.Close();

            BreakWordList = null;
            TokenList     = null;
            TokenList2    = null;
        }