anchor.diff:  	print >>f, "    r = extra_setup(inst, extra_arg);"
   	print >>f, "    if(r != 0) return r;"
   
  -    for name, type, dir, value in pins:
  -        print >>f, "    r = hal_pin_%s_newf(%s, &(inst->%s), comp_id," % (
  -            type, dirmap[dir], name)
  -        print >>f, "        \"%%s%s\", prefix);" % to_hal("." + name)
  -        print >>f, "    if(r != 0) return r;"
  -        if value is not None:
  -            print >>f, "    *(inst->%s) = %s;" % (name, value)
  +    for name, type, array, dir, value in pins:
  +        if array:
  +            print >>f, "    for(j=0; j < %s; j++) {" % array
  +            print >>f, "    r = hal_pin_%s_newf(%s, &(inst->%s[j]), comp_id," % (
  +                type, dirmap[dir], to_c(name))
  +            print >>f, "        \"%%s%s\", prefix, j);" % to_hal("." + name)
  +            print >>f, "    if(r != 0) return r;"
  +            if value is not None:
  +                print >>f, "    *(inst->%s[j]) = %s;" % (to_c(name), value)
  +            print >>f, "    }"
  +        else:
  +            print >>f, "    r = hal_pin_%s_newf(%s, &(inst->%s), comp_id," % (
  +                type, dirmap[dir], to_c(name))
  +            print >>f, "        \"%%s%s\", prefix);" % to_hal("." + name)
  +            print >>f, "    if(r != 0) return r;"
  +            if value is not None:
  +                print >>f, "    *(inst->%s) = %s;" % (to_c(name), value)
   
       for name, type, dir, value in params:
           print >>f, "    r = hal_param_%s_newf(%s, &(inst->%s), comp_id," % (
  -            type, dirmap[dir], name)
  +            type, dirmap[dir], to_c(name))
           print >>f, "        \"%%s%s\", prefix);" % to_hal("." + name)
           if value is not None:
  -            print >>f, "    inst->%s = %s;" % (name, value)
  +            print >>f, "    inst->%s = %s;" % (to_c(name), value)
           print >>f, "    if(r != 0) return r;"
   
       for name, fp in functions:
           print >>f, "    rtapi_snprintf(buf, HAL_NAME_LEN, \"%%s%s\", prefix);"\
               % to_hal("." + name)
           print >>f, "    r = hal_export_funct(buf, (void(*)(void *inst, long))%s, inst, %s, 0, comp_id);" % (
  -            name, int(fp))
  +            to_c(name), int(fp))
           print >>f, "    if(r != 0) return r;"
       print >>f, "    inst->_next = first_inst;"
       print >>f, "    first_inst = inst;"
  
positive.code:     token PINDIRECTION: "in|out|io"
      token TYPE: "float|bit|signed|unsigned|u32|s32"
      token NAME: "[a-zA-Z_][a-zA-Z0-9_]*"
      token FPNUMBER: "-?([0-9]*\.[0-9]+|[0-9]+\.?)([Ee][+-]?[0-9]+)?f?"
      token NUMBER: "-?[0-9]+|0x[0-9a-fA-F]+"
      token STRING: '"(\\.|[^\\"])*"'
  
negative.code:             raise SystemExit, "Component must have at least one pin"
          prologue(f)
          lineno = a.count("\n") + 3
          #f.write("#line %d \"%s\"\n" % (lineno, filename))
          f.write(b)
          epilogue(f)
          f.close()
  