Esempio n. 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(textBox1.Text))
            {
                path = "code.txt";
            }

            else
            {
                path += "\\code.txt";
            }

            StreamWriter newfile = new StreamWriter(path);

            newfile.Write(textBox2.Text);
            newfile.Close();
            file.readAllFile(path);
            display();

            if (scanner.checkUnmatchedBraces())
            {
                MessageBox.Show("Unmached Braces Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            if (scanner.checkUnmatchedParanthesis())
            {
                MessageBox.Show("Unmached Parenhesis Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            if (scanner.checkUnmatchedQuotes())
            {
                MessageBox.Show("Unmached Quotes Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            DialogResult dr = openFileDialog1.ShowDialog();

            if (dr == System.Windows.Forms.DialogResult.OK)
            {
                textBox1.Text = openFileDialog1.FileName;
                file.readAllFile(textBox1.Text);
                textBox2.Text = System.IO.File.ReadAllText(openFileDialog1.FileName);
            }
        }
Esempio n. 3
0
        public Parse(string path)
        {
            InitializeComponent();
            fd.readAllFile(path);
            p = new Parser(fd);
            p.parse();
            DrawTree(p.t, firstNode);

            viewer.Graph = graph;

            viewer.Dock = System.Windows.Forms.DockStyle.Fill;
            this.Controls.Add(viewer);
        }
Esempio n. 4
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(textBox1.Text))
            {
                path = "code.txt";
            }

            else
            {
                path += "\\code.txt";
            }

            StreamWriter newfile = new StreamWriter(path);

            newfile.Write(textBox2.Text);
            newfile.Close();
            file.readAllFile(path);
            display();
        }