1
0
mirror of https://git.savannah.gnu.org/git/gperf.git synced 2025-12-02 13:09:22 +00:00

New declaration "%define initializer-suffix".

This commit is contained in:
Bruno Haible
2003-04-30 10:36:10 +00:00
parent 5fbcad1840
commit ff0be60810
6 changed files with 39 additions and 4 deletions

View File

@@ -1,3 +1,13 @@
2003-03-01 Bruno Haible <bruno@clisp.org>
* src/options.h (Options::set_initializer_suffix): New declaration.
* src/options.cc (Options::set_initializer_suffix): New method.
* src/input.cc (Input::read_input): Recognize %define
initializer-suffix.
* doc/gperf.texi (Gperf Declarations): Document %define
initializer-suffix.
* NEWS: Update.
2003-02-26 Bruno Haible <bruno@clisp.org>
* Makefile.msvc: New file.

1
NEWS
View File

@@ -13,6 +13,7 @@ New in 2.97:
%ignore-case
%language=LANGUAGE-NAME
%define slot-name NAME
%define initializer-suffix INITIALIZERS
%define hash-function-name NAME
%define lookup-function-name NAME
%define class-name NAME

View File

@@ -7,7 +7,7 @@
@c some day we should @include version.texi instead of defining
@c these values at hand.
@set UPDATED 1 January 2003
@set UPDATED 1 March 2003
@set EDITION 2.7.2
@set VERSION 2.7.2
@c ---------------------
@@ -472,13 +472,22 @@ The default is C.
@item %define slot-name @var{name}
@cindex @samp{%define slot-name}
This option is only useful when option @samp{-t} (or, equivalently, the
This declaration is only useful when option @samp{-t} (or, equivalently, the
@samp{%struct-type} declaration) has been given.
By default, the program assumes the structure component identifier for
the keyword is @samp{name}. This option allows an arbitrary choice of
identifier for this component, although it still must occur as the first
field in your supplied @code{struct}.
@item %define initializer-suffix @var{initializers}
@cindex @samp{%define initializer-suffix}
This declaration is only useful when option @samp{-t} (or, equivalently, the
@samp{%struct-type} declaration) has been given.
It permits to specify initializers for the structure members following
@var{slot-name} in empty hash table entries. The list of initializers
should start with a comma. By default, the emitted code will
zero-initialize structure members following @var{slot-name}.
@item %define hash-function-name @var{name}
@cindex @samp{%define hash-function-name}
Allows you to specify the name for the generated hash function. Default

View File

@@ -486,6 +486,11 @@ Input::read_input ()
option.set_slot_name (arg);
else
if (is_define_declaration (line, line_end, lineno,
"initializer-suffix", &arg))
option.set_initializer_suffix (arg);
else
if (is_define_declaration (line, line_end, lineno,
"hash-function-name", &arg))
option.set_hash_name (arg);

View File

@@ -593,7 +593,7 @@ Options::set_function_name (const char *name)
_function_name = name;
}
/* Set the keyword key name, if not already set. */
/* Sets the keyword key name, if not already set. */
void
Options::set_slot_name (const char *name)
{
@@ -601,6 +601,14 @@ Options::set_slot_name (const char *name)
_slot_name = name;
}
/* Sets the struct initializer suffix, if not already set. */
void
Options::set_initializer_suffix (const char *initializers)
{
if (_initializer_suffix == DEFAULT_INITIALIZER_SUFFIX)
_initializer_suffix = initializers;
}
/* Sets the generated class name, if not already set. */
void
Options::set_class_name (const char *name)

View File

@@ -171,11 +171,13 @@ public:
/* Returns the keyword key name. */
const char * get_slot_name () const;
/* Set the keyword key name, if not already set. */
/* Sets the keyword key name, if not already set. */
void set_slot_name (const char *name);
/* Returns the struct initializer suffix. */
const char * get_initializer_suffix () const;
/* Sets the struct initializer suffix, if not already set. */
void set_initializer_suffix (const char *initializers);
/* Returns the generated class name. */
const char * get_class_name () const;