int elementCount = Integer.parseInt(parts.get(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.get(2));
p.setInternalName(parts.get(3));
p.setOutput(parts.get(4).equals("output)"));
pins.add(p);
}
for(int i = 0; i < elementCount; i++){
readLine();
Element e = new Element();
e.setName(parts.get(2));
int elementPinCount = Integer.parseInt(parts.get(3).replace(")", ""));
e.setBel(parts.size() > 5 && parts.get(4).equals("#") && parts.get(5).equals("BEL"));
for(int j = 0; j < elementPinCount; j++){
readLine();
PrimitiveDefPin elementPin = new PrimitiveDefPin();
elementPin.setInternalName(parts.get(2));
elementPin.setOutput(parts.get(3).equals("output)"));
e.addPin(elementPin);
}
while(!readLine().startsWith("\t\t)")){
if(line.startsWith("\t\t\t(cfg ")){
for(int k = 2; k < parts.size(); k++){