private void readAttributes(ScanfReader scanReader,
            AttributeData attr, HashMap<String, Color> colorList)
            throws IOException {
        String name = null;
        while (!(name = scanReader.scanString()).equals("end")) {
            AttributeData a;
            double hr;
            if (name.equals("attributes")) { // if keyword=attibutes, then read
                                             // abstract name and ratio
                a = new AttributeAbstractData();
                name = scanReader.scanString();
                a.setName(name);
                hr = readHeightRatio(scanReader);
                readAttributes(scanReader, a, colorList);

            } else { // if no keyword is primitive
                a = new AttributePrimitiveData();
                a.setName(name);
                hr = readHeightRatio(scanReader);
                a.getPrimitive().setWeight(hr);
            	AttributeDomain domain = AttributeDomain.read(scanReader);
                a.getPrimitive().setDomain(domain);
                String option = null;

                //This is where the program reads through the valuecharts file (.vc) and collects the properties for each of the attributes
                while (!(option = scanReader.scanString()).equals("end")) {
                    if (option.startsWith("color=")) {
                        String colorName = option.substring(6);
                        Color color = (Color) colorList.get(colorName);
                        if (color == null) {
                            throw new IOException("Unknown color '" + colorName + "'");
                        }
                        a.getPrimitive().setColor(color);
                    } else if (option.startsWith("units=")) {
                        String unitsName = option.substring(6);
                        a.getPrimitive().setUnitsName(unitsName);
                    } else {
                        throw new IOException("Unknown option '" + option + "'");
                    }
                }
            }

            chartData.addAttributeData(attr, a);
        }
    }