Exemple #1
0
        private Operator getOperator(Postfix token)
        {
            int operatorLen = operators.Count;
            for (int i = 0; i < operatorLen; i++)
            {
                if (token.item == operators[i].Name)
                    return operators[i];
            }

            return null;
        }
Exemple #2
0
        private Operator getOperator(Postfix postfixItem)
        {
            String token = postfixItem.item;
            int operatorLen = operators.Count;
            for (int i = 0; i < operatorLen; i++)
            {
                if (token == operators[i].Name)
                    return operators[i];
            }

            return null;
        }
Exemple #3
0
        private Operator getOperator(Postfix token)
        {
            int operatorLen = operators.Count;

            for (int i = 0; i < operatorLen; i++)
            {
                if (token.item == operators[i].Name)
                {
                    return(operators[i]);
                }
            }

            return(null);
        }
Exemple #4
0
        private Operator getOperator(Postfix postfixItem)
        {
            String token       = postfixItem.item;
            int    operatorLen = operators.Count;

            for (int i = 0; i < operatorLen; i++)
            {
                if (token == operators[i].Name)
                {
                    return(operators[i]);
                }
            }

            return(null);
        }
Exemple #5
0
        private bool processPostfix()
        {
            try
            {
                preProcess(1);
                List <List <String> > output = new Postfix().process(postfix);

                tacText  = output[0];
                quadText = output[1];

                saveFileDialog1.FileName = "quadruple.txt";
                saveFileDialog1.ShowDialog();

                saveFileDialog2.FileName = "three addess code.txt";
                saveFileDialog2.ShowDialog();
            }
            catch (Exception)
            {
                MessageBox.Show("Error occured. Invalid input might be the cause of this.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                throw;
            }
            return(true);
        }
Exemple #6
0
        private bool processPostfix()
        {
            try
            {
                preProcess(1);
                List<List<String>> output = new Postfix().process(postfix);

                tacText = output[0];
                quadText = output[1];

                saveFileDialog1.FileName = "quadruple.txt";
                saveFileDialog1.ShowDialog();

                saveFileDialog2.FileName = "three addess code.txt";
                saveFileDialog2.ShowDialog();
            }
            catch (Exception)
            {
                MessageBox.Show("Error occured. Invalid input might be the cause of this.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                throw;
            }
            return true;
        }