Пример #1
0
 public RegexFactorIterator(RegexAtom atom, RegexIterator iterator)
     : base(atom)
 {
     Iterator = iterator;
     _hashCode = ComputeHashCode();
 }
    public new Outcome checkFile(string filename)
    {
        Outcome oc = Outcome.FALSE;

        // Reads file
        string trace = SimpleFileReader.readFile(filename);
        RegexIterator<string> sf = new RegexIterator<string>(trace, "(<" + m_messageName + ">.+?</" + m_messageName + ">)", 1);

        // Splits trace into messages
        int max_messages = 10000;

        for (int i = 0; i < max_messages && sf.hasNext(); i++)
        {
            string currentMessage = sf.next();

            if (currentMessage == null)
            {
                break;
            }

            update(currentMessage);
            oc = getOutcome();

            if (m_verbosity > 1)
            {
                System.Console.Error.WriteLine("Message #" + i.ToString());
                System.Console.Error.WriteLine(currentMessage);
            }

            if (oc == Outcome.TRUE || oc == Outcome.FALSE)
            {
                break;
            }
        }

        reset();

        return oc;
    }
Пример #3
0
 public RegexFactorIterator(RegexAtom atom, RegexIterator iterator)
 {
     Atom     = atom;
     Iterator = iterator;
 }