Exemplo n.º 1
0
        private void done_button_Click(object sender, System.EventArgs e)
        {
            result = interpreter_pkg.input_syntax(this.variableTextBox.Text, PAR);

            prompt_result = interpreter_pkg.output_syntax(this.exprTextBox.Text, false, PAR);

            PAR.is_input = true;

            if (result.valid && prompt_result.valid)
            {
                the_form.Make_Undoable();
                PAR.prompt              = this.exprTextBox.Text;
                PAR.Text                = this.variableTextBox.Text;
                PAR.parse_tree          = result.tree;
                PAR.prompt_tree         = prompt_result.tree;
                PAR.input_is_expression = true;
                PAR.changed();
                this.error = false;
                this.Close();
            }

            else
            {
                this.error = true;
                if (!result.valid)
                {
                    this.error_msg = result.message;
                }
                else
                {
                    this.error_msg = prompt_result.message;
                }
                this.Invalidate();
            }
        }
Exemplo n.º 2
0
        private void done_button_Click(object sender, System.EventArgs e)
        {
            result = interpreter_pkg.output_syntax(this.textBox1.Text,
                                                   this.new_line.Checked, PAR);

            PAR.is_input = false;
            if (result.valid)
            {
                the_form.Make_Undoable();
                PAR.Text       = this.textBox1.Text;
                PAR.parse_tree = result.tree;
                PAR.new_line   = this.new_line.Checked;
                PAR.changed();
                this.error = false;
                this.Close();
            }

            else
            {
                this.error     = true;
                this.error_msg = result.message;
                this.Invalidate();
            }
        }