Beispiel #1
0
 public bool IsCharSetEqual(string input, RegexNode node)
 {
     var parser = new Parser(input);
     var exp = parser.ParseExpression();
     var sets = new FlatSet<CharRange>();
     exp.NormalizeCharSet(out sets);
     return exp.Equals(node.Exp);
 }
        private void RegexMenuItem_Click(object sender, RoutedEventArgs e)
        {
            RegexInput inputWindow = new RegexInput();

            inputWindow.Owner = this;
            inputWindow.ShowDialog();
            regexString = inputWindow.RegexString;
            if (regexString != string.Empty)
            {
                RegexContent.Text = regexString;
                var parser = new RegexParser.Parser(regexString);
                var exp    = parser.ParseExpression();
                EpsilonNfa = exp.GenerateExpsilonNfa();
                Nfa        = Automaton.RemoveEpsilon(EpsilonNfa);
                MultiValueDictionary <State, State> statesMap;
                Dfa = Automaton.NfaToDfa(Nfa, out statesMap);
            }
        }
 private void RegexMenuItem_Click(object sender, RoutedEventArgs e)
 {
     RegexInput inputWindow = new RegexInput();
     inputWindow.Owner = this;
     inputWindow.ShowDialog();
     regexString = inputWindow.RegexString;
     if(regexString != string.Empty)
     {
         RegexContent.Text = regexString;
         var parser = new RegexParser.Parser(regexString);
         var exp = parser.ParseExpression();
         EpsilonNfa = exp.GenerateExpsilonNfa();
         Nfa = Automaton.RemoveEpsilon(EpsilonNfa);
         MultiValueDictionary<State, State> statesMap;
         Dfa = Automaton.NfaToDfa(Nfa, out statesMap);
     }
 }
Beispiel #4
0
 public bool IsEqual(string input,RegexNode node)
 {
     var parser = new Parser(input);
     var exp = parser.ParseExpression();
     return exp.Equals(node.Exp);
 }