anchor.diff:      token NAME: "[a-zA-Z_][a-zA-Z0-9_]*"
       token HALNAME: "[#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: '"(\\.|[^\\"])*"'
  -    token TSTRING: '"""(\\.|\\\n|[^\\"]|"(?!"")|\n)*"""'
  +    token NUMBER: "0x[0-9a-fA-F]+|[+-]?[0-9]+"
  +    token STRING: "\"(\\.|[^\\\"])*\""
  +    token POP: "[-()+*/]|&&|\\|\\||personality|==|&|!=|<|<=|>|>="
  +    token TSTRING: "\"\"\"(\\.|\\\n|[^\\\"]|\"(?!\"\")|\n)*\"\"\""
   
       rule File: Declaration* "$" {{ return True }}
       rule Declaration:
           "component" NAME OptString";" {{ comp(NAME, OptString); }}
  -      | "pin" PINDIRECTION TYPE HALNAME OptArray OptAssign OptString ";"  {{ pin(HALNAME, TYPE, OptArray, PINDIRECTION, OptString, OptAssign) }}
  -      | "param" PARAMDIRECTION TYPE HALNAME OptArray OptAssign OptString ";" {{ param(HALNAME, TYPE, OptArray, PARAMDIRECTION, OptString, OptAssign) }}
  +      | "pin" PINDIRECTION TYPE HALNAME OptArray OptAssign OptPersonality OptString ";"  {{ pin(HALNAME, TYPE, OptArray, PINDIRECTION, OptString, OptAssign, OptPersonality) }}
  +      | "param" PARAMDIRECTION TYPE HALNAME OptArray OptAssign OptPersonality OptString ";" {{ param(HALNAME, TYPE, OptArray, PARAMDIRECTION, OptString, OptAssign, OptPersonality) }}
         | "function" NAME OptFP OptString ";"       {{ function(NAME, OptFP, OptString) }}
         | "option" NAME OptValue ";"   {{ option(NAME, OptValue) }}
         | "see_also" String ";"   {{ see_also(String) }}
  
positive.code:             print >>f, "    if(r != 0) return r;"
              if value is not None:
                  print >>f, "    *(inst->%s) = %s;" % (to_c(name), value)
  
      for name, type, array, dir, value in params:
          if array:
              print >>f, "    for(j=0; j < %s; j++) {" % array
              print >>f, "        r = hal_param_%s_newf(%s, &(inst->%s[j]), comp_id," % (
                  type, dirmap[dir], to_c(name))
  
negative.code:                     print >>f, "#define %s (0+*inst->%s)" % (to_c(name), to_c(name))
                  else:
                      print >>f, "#define %s (*inst->%s)" % (to_c(name), to_c(name))
          for name, type, array, dir, value, personality in params:
              if array:
                  print >>f, "#define %s(i) (inst->%s[i])" % (to_c(name), to_c(name))
              else:
  