anchor.diff:              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)
  +        if "FUNCTION" in b:
  +            f.write("#line %d \"%s\"\n" % (lineno, filename))
  +            f.write(b)
  +        elif len(functions) == 1:
  +            f.write("FUNCTION(%s) {\n" % functions[0][0])
  +            f.write("#line %d \"%s\"\n" % (lineno, filename))
  +            f.write(b)
  +            f.write("}\n")
  +        else:
  +            raise SystemExit, "Must use FUNCTION() when more than one function is defined"
           epilogue(f)
           f.close()
   
  
positive.code:       | "option" NAME OptValue ";"   {{ option(NAME, OptValue) }}
        | "see_also" String ";"   {{ see_also(String) }}
        | "description" String ";"   {{ description(String) }}
  
      rule String: TSTRING {{ return eval(TSTRING) }} 
              | STRING {{ return eval(STRING) }}
  
negative.code: 
  Usage:
      %(name)s [--install|--compile|--preprocess|--document] compfile...
      %(name)s [--install|--compile] [--userspace] cfile...
  """ % {'name': os.path.basename(sys.argv[0])}
      raise SystemExit, exitval
  
  def main():
      mode = PREPROCESS
      outfile = None
      userspace = False
      try:
          opts, args = getopt.getopt(sys.argv[1:], "uicpdo:h?",
                             ['install', 'compile', 'preprocess', 'outfile=',
                              'document', 'help', 'userspace'])
      except getopt.GetoptError:
          usage(1)
  
      for k, v in opts:
          if k in ("-u", "--userspace"):
              userspace = True
          if k in ("-i", "--install"):
              mode = INSTALL
          if k in ("-c", "--compile"):
  