Пример #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;
        }
Пример #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;
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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;
        }