예제 #1
0
파일: CodeRun.cs 프로젝트: afumfer/KNote
        private void CodeExecutePrint(Print print)
        {
            object s = GenExpr(print.Expr);

            if (s != null)
            {
                inOutDevice.Print(s.ToString(), false);
            }
            else
            {
                inOutDevice.Print("null", false);
            }
        }
예제 #2
0
        public void Run(string sourceCode)
        {
            try
            {
                if (_visibleInOutDevice)
                {
                    _inOutDevice.Show();
                    _inOutDevice.LockForm(true);
                }

                Scanner scanner = new Scanner(sourceCode);
                Parser  parser  = new Parser(scanner.TokensList);
                CodeRun codeRun = new CodeRun(_inOutDevice, _functionLibrary, _symbolTable);
                codeRun.Run(parser.Result);

                if (_visibleInOutDevice)
                {
                    _inOutDevice.LockForm(false);
                }
            }
            catch (Exception err)
            {
                if (!_visibleInOutDevice)
                {
                    _inOutDevice.Show();
                }
                _inOutDevice.LockForm(false);
                _inOutDevice.Print(err.Message);
                //throw err; // ??
            }
        }