Java classes for flattening rules

Source files only