Пример #1
0
        private void btnCheckWord_Click(object sender, EventArgs e)
        {
            string word  = tbWord.Text;
            bool   check = WordChecker.checkWord(word, automaton);

            tbWordCheck.Text = check ? "✔" : "✘";
        }
Пример #2
0
 private void checkWords(Automaton inputAutomaton)
 {
     lbWords.Items.Clear();
     inputAutomaton.Words?.ForEach(x =>
     {
         bool check;
         if (inputAutomaton.Stack == null)
         {
             check = WordChecker.checkWord(x, inputAutomaton);
         }
         else
         {
             check = StackChecker.checkWordPDA(x, inputAutomaton);
         }
         string text = x + (check ? "✔" : "✘");
         lbWords.Items.Add(text);
     });
 }
Пример #3
0
        public void checkWordTest_passWordAndAutomatonAndCurrentState_ReturnsBool(int automatonIndex, string inputWord)
        {
            Automaton inputAutomaton = automatons[automatonIndex];

            Assert.IsTrue(WordChecker.checkWord(inputWord, inputAutomaton, inputAutomaton.States[0].Name));
        }