import java.util.*;

public class Rules
{
    public static final String BAGS = "bags";
    public static final String BAGS_CONTAINS = "bags contain";
    public static final String NO_BAGS = "no other bags";
    public static final String SEPARATOR = ",";
    public static final String TERMINATOR = ".";

    public Rules (boolean debug)
    {
        _debug = debug;
    }

    public Inventory parse (String dataFile)
    {
        Vector<String> rules = Util.loadData(dataFile, _debug);
        Inventory inv = new Inventory(_debug);
        Enumeration<String> iter = rules.elements();

        while (iter.hasMoreElements())
        {
            String line = iter.nextElement();
            int index = line.indexOf(BAGS_CONTAINS);  // name of bag



        }
        return inv;
    }

    private boolean _debug;
}
@@ -584,16 +584,47 @@
 ments();
+%0A        boolean error = false;
 %0A%0A      
@@ -654,16 +654,26 @@
 ements()
+ && !error
 )%0A      
@@ -796,19 +796,123 @@
 ag%0A%0A
-%0A%0A        %7D
+            if (index != -1)%0A            %7B%0A%0A            %7D%0A            else%0A                error = true;%0A        %7D%0A
 %0A   

Update Rules.java