guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guile C preprocessor


From: Bruce Korb
Subject: Re: Guile C preprocessor
Date: Tue, 12 Dec 2000 02:47:37 -0800

Keisuke Nishida wrote:

> > - What happens to the docstring?
> 
> Probably we should produce several files (*.c, *.h, *.doc) from a single
> source (say, *.gc).  I think this is easier to maintain.

If you are willing to tolerate embedded comments like this:

  /*=gfunc get
   *
   * what: get named value
   *
   * arg:  ag-name, name of AutoGen value
   *
   * doc:  get the first string value associated with the name.
  =*/

I already have code written that will produce these outputs:

.menu:

  @menu
  * SCM get::               @file{get} - get named value
  @end menu

  = = = = = = =

.texi:

  @node SCM get
  @subsection @file{get} - get named value
  @findex get
  @ignore
  Extracted from ../agen5/expState.c on line 517.
  @end ignore
  Usage:  (get ag-name)
  @*
  get the first string value associated with the name.

  = = = = = = =

.x:

  static const char s_get[] = "get";
  gh_new_procedure( (char*)s_get, scm_get, 1, 0, 0 );

  = = = = = = =

.h:

  extern SCM scm_get( SCM );

The name is transformed via sed as in:  sed 's/_to_/->/;s/_p$/?/'
The name can also be aliased to something completely unreleated.
Any other desired transform is trivial, too.
It is also trivial to add additional attributes that can be
massaged into the output.  See:

  http://AutoGen.SourceForge.net/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]