private void parsePrimitiveDef(){
		PrimitiveDef def = new PrimitiveDef();
		def.setType(Utils.createPrimitiveType(parts[2]));
		int pinCount = Integer.parseInt(parts[3]);
		int elementCount = Integer.parseInt(parts[4]);
		ArrayList<PrimitiveDefPin> pins = new ArrayList<PrimitiveDefPin>(pinCount);
		ArrayList<Element> elements = new ArrayList<Element>(elementCount);
		for(int i = 0; i < pinCount; i++){
			readLine();
			PrimitiveDefPin p = new PrimitiveDefPin();
			p.setExternalName(parts[2]);
			p.setInternalName(parts[3]);
			p.setOutput(parts[4].equals("output)"));
			pins.add(p);
		}
		for(int i = 0; i < elementCount; i++){
			readLine();
			Element e = new Element();
			e.setName(parts[2]);
			int elementPinCount = Integer.parseInt(parts[3].replace(")", ""));
			e.setBel(parts.length > 5 && parts[4].equals("#") && parts[5].equals("BEL"));
			
			for(int j = 0; j < elementPinCount; j++){
				readLine();
				PrimitiveDefPin elementPin = new PrimitiveDefPin();
				elementPin.setInternalName(parts[2]);
				elementPin.setOutput(parts[3].equals("output)"));
				e.addPin(elementPin);
			}
			while(!readLine().startsWith("\t\t)")){
				if(line.startsWith("\t\t\t(cfg ")){
					for(int k = 2; k < parts.length; k++){
						e.addCfgOption(parts[k].replace(")", ""));
					}
				}
				else if(line.startsWith("\t\t\t(conn ")){
					Connection c = new Connection();
					c.setElement0(parts[2]);
					c.setPin0(parts[3]);
					c.setForwardConnection(parts[4].equals("==>"));
					c.setElement1(parts[5]);
					c.setPin1(parts[6].substring(0, parts[6].length()-1));
					e.addConnection(c);
				}
			}
			elements.add(e);
		}
		def.setPins(pins);
		def.setElements(elements);
		defs.add(def);
	}