www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/15/08:46:06

Date: Sat, 15 Nov 1997 08:45:01 -0500 (EST)
Message-Id: <199711151345.IAA28493@delorie.com>
To: DJGPP mailing list <djgpp AT delorie DOT com>
From: Alexander Bokovoy <bokovoy AT bspu DOT ac DOT by>
Subject: Re: Where is "genclass"?
In-Reply-To: <3469C7D6.B791E2C7@tpts5.seed.net.tw>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 971111170640 DOT 17425J-100000 AT is> <3469C7D6 DOT B791E2C7 AT tpts5 DOT seed DOT net DOT tw>
MIME-Version: 1.0

On Wed, 12 Nov 1997 23:14:30 +0800 pasomar <pasomar AT tpts5 DOT seed DOT net DOT tw> wrote:

> 
>    Sorry if I didn't make myself clear.  I just
> wanted to know what this "genclass" is.
> Is it a program?  Where can I find it?  And
> do I need it if I want to use those generic
> classes like LinkedList?
> Thanks for the help.
> 
> pasomar
> 
Here is a text from info libgplus.inf:
Introduction to container class prototypes:
[snipped]
   Specific classes may be generated via the `genclass' shell script
program. This program has arguments specifying the kinds of base
types(s) to be used. Specifying base types requires two arguments. The
first is the name of the base type, which may be any named type, like
`int' or `String'. Only named types are supported; things like `int*'
are not accepted. However, pointers like this may be used by supplying
the appropriate typedefs (e.g., editing the resulting files to include
`typedef int* intp;'). The type name must be followed by one of the
words `val' or `ref', to indicate whether the base elements should be
passed to functions by-value or by-reference.

   You can specify basic container classes using `genclass base
[val,ref] proto', where `proto' is the name of the class being
generated.  Container classes like dictionaries and maps that require
two types may be specified via `genclass -2 keytype [val, ref],
basetype [val, ref] proto', where the key type is specified first and
the contents type second.  The resulting classnames and filenames are
generated by prepending the specified type names to the prototype names,
and separating the filename parts with dots.  For example, `genclass
int val List' generates class `intList' residing in files `int.List.h'
and `int.List.cc'. `genclass -2 String ref int val VHMap' generates
(the awkward, but unavoidable) class name `StringintVHMap'. Of course,
programmers may use `typedef' or simple editing to create more
appropriate names.  The existence of dot seperators in file names
allows the use of GNU make to help automate configuration and
recompilation. An example Makefile exploiting such capabilities may be
found in the `libg++/proto-kit' directory.

   The `genclass' utility operates via simple text substitution using
`sed'. All occurrences of the pseudo-types `<T>' and `<C>' (if there
are two types) are replaced with the indicated type, and occurrences of
`<T&>' and `<C&>' are replaced by just the types, if `val' is
specified, or types followed by "&" if `ref' is specified.

   Programmers will frequently need to edit the `.h' file in order to
insert additional `#include' directives or other modifications.  A
simple utility, `prepend-header' to prepend other `.h' files to
generated files is provided in the distribution.

[]
You can find it on the DJ's FTP-site (I don't remember proper URL)

Alexander Bokovoy, <bokovoy AT bspu DOT ac DOT by>
---== The Soft Age coming soon ==---

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019