public class Matcher
{
    public Matcher (Rule[] rules, boolean debug)
    {
        _rules = rules;
        _debug = debug;
    }

    public Message[] matchRule (int ruleNumber, Message[] messages)
    {
        Rule ruleToMatch = _rules[ruleNumber];

        return null;
    }

    private String getMatchingString (Rule theRule, String current)
    {
        String str = current;

        if (theRule.getMatch() == Rule.NO_MATCH)
        {

        }
        else
            str += theRule.getMatch();

        return str;
    }

    private Rule[] _rules;
    private boolean _debug;
}
@@ -342,16 +342,36 @@
  current
+, boolean checkFirst
 )%0A    %7B%0A
@@ -460,16 +460,698 @@
       %7B%0A
+            if (checkFirst)%0A            %7B%0A                int%5B%5D firstRules = theRule.firstDependantRules();%0A%0A                for (int i = 0; i %3C firstRules.length; i++)%0A                %7B%0A                    str = getMatchingString(_rules%5BfirstRules%5Bi%5D%5D, str, true);%0A                %7D%0A            %7D%0A            else%0A            %7B%0A                int%5B%5D secondRules = theRule.secondDependantRules();%0A%0A                if (secondRules != null)%0A                %7B%0A                    for (int i = 0; i %3C secondRules.length; i++)%0A                    %7B%0A                        str = getMatchingString(_rules%5BsecondRules%5Bi%5D%5D, str, false);%0A                    %7D%0A                %7D%0A            %7D
 %0A       

Update Matcher.java