예제 #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);
 }
예제 #2
0
        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);
            }
        }
예제 #3
0
 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);
     }
 }
예제 #4
0
 public bool IsEqual(string input,RegexNode node)
 {
     var parser = new Parser(input);
     var exp = parser.ParseExpression();
     return exp.Equals(node.Exp);
 }