Пример #1
0
        public Test()
        {
            translator = new Translator();
            operators = new Dictionary<string, char>
            {
                { "AND", '∧' },
                { "OR", '∨' },
                { "IMPLIES", '⇒' },
                { "EQUALS", '⇔' },
                //{ "NOT", '¬' },
            };

            quantifiers = new Dictionary<string, char>
            {
                { "FORALL", '∀' },
                { "EXISTS", '∃' },
            };

            variableNames = new List<string>
            {
                "a", "aa", "aaa",
            };
            constantNames = new List<string>
            {
                "A", "AA", "AAA",
            };
            functionNames = new List<string>
            {
                "A", "Aa", "Aaa",
            };

        }
Пример #2
0
        public ActionResult Translate(string text)
        {
            ViewBag.text = text;
            try
            {
                Translator t = new Translator();
                t.translate(text);

                ViewBag.steps = t.steps;
                ViewBag.tree = t.toJson();

            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                ViewBag.steps = null;
                ViewBag.tree = null;
                ViewBag.error = "Błąd składni";
            }
            return View("Index");
        }