private List<SpriteInfoBlock> parseMetadata(String data) throws IOException
	{
		// Prepare a "syntax tree" to return
		List<SpriteInfoBlock> nodes = new ArrayList<SpriteInfoBlock>();
		
		// Split the metadata into individual lines and parse them individually
		String[] lines = data.split("\n");
		
		for(String line : lines) {
			// If the line is all spaces, or begins with #, ignore it
			if(line.matches("\\s*") || line.matches("#.*"))
			{
				continue;
			}
			
			// Create a regular expression to parse lines of the type:
			// key = value
			Pattern pattern = Pattern.compile("(\\s*)([^\\s]+)\\s*=\\s*(.*[^\\s])\\s*");
			Matcher matcher = pattern.matcher(line);
			
			// Try to match our line against the key = value pattern
			boolean matchFound = matcher.matches();
			if(!matchFound) throw new IOException("Malformed .DMI metadata");
			
			// Extract key, value and indentation
			String indentation = matcher.group(1);
			String key = matcher.group(2);
			String value = matcher.group(3);
			
			// Build a new entry in our parsetree for it
			SpriteInfoBlock new_block = new SpriteInfoBlock();
			new_block.indent = (indentation.length() != 0);
			new_block.key    = key;
			new_block.value  = value;
			
			nodes.add(new_block);
		}

		return nodes;
	}