anchor.diff:      for name, fp in functions:
           if names.has_key(name):
               raise RuntimeError, "Duplicate item name: %s" % name
  -        print >>f, "static void %s(struct state *inst, long period);" % name
  +        print >>f, "static void %s(struct state *inst, long period);" % to_c(name)
           names[name] = 1
   
       print >>f, "static int get_data_size(void);"
  
positive.code:     return s
  
  def to_hal(name):
      return name.replace("_", "-").rstrip("-").rstrip(".")
  
  def prologue(f):
      print >> f, "/* Autogenerated by %s on %s -- do not edit */" % (
  
negative.code:     token PINDIRECTION: "in|out|io"
      token TYPE: "float|bit|signed|unsigned|u32|s32"
      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: '"(\\.|[^\\"])*"'
  