[Top][All Lists]

[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:


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

  = = = = = = =


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

  = = = = = = =


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

  = = = = = = =


  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:

reply via email to

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