Run it in src/ for a start.
* src/AnnotationList.h, src/InadequacyList.h, src/Sbitset.h,
* src/closure.c, src/complain.h, src/flex-scanner.h, src/getargs.h,
* src/gram.h, src/graphviz.h, src/ielr.h, src/location.h,
* src/muscle-tab.h, src/named-ref.h, src/relation.h, src/scan-code.h,
* src/state.h, src/symtab.h, src/system.h, src/uniqstr.h:
Reindent preprocessor directives.
19 files changed:
#ifndef ANNOTATION_LIST_H_
# define ANNOTATION_LIST_H_
#ifndef ANNOTATION_LIST_H_
# define ANNOTATION_LIST_H_
-#include <bitsetv.h>
-#include "Sbitset.h"
-#include "InadequacyList.h"
-#include "state.h"
+# include <bitsetv.h>
+# include "Sbitset.h"
+# include "InadequacyList.h"
+# include "state.h"
typedef unsigned int AnnotationIndex;
typedef unsigned int AnnotationIndex;
#ifndef INADEQUACY_LIST_H_
# define INADEQUACY_LIST_H_
#ifndef INADEQUACY_LIST_H_
# define INADEQUACY_LIST_H_
-#include <bitset.h>
-#include "gram.h"
-#include "state.h"
-#include "symtab.h"
+# include <bitset.h>
+# include "gram.h"
+# include "state.h"
+# include "symtab.h"
/**
* A unique ID assigned to every \c InadequacyList node.
/**
* A unique ID assigned to every \c InadequacyList node.
typedef unsigned char *Sbitset;
typedef size_t Sbitset__Index;
typedef unsigned char *Sbitset;
typedef size_t Sbitset__Index;
-#define SBITSET__INDEX__CONVERSION_SPEC "zu"
+# define SBITSET__INDEX__CONVERSION_SPEC "zu"
-#define Sbitset__nbytes(NBITS) \
+# define Sbitset__nbytes(NBITS) \
(((NBITS) + CHAR_BIT - 1) / CHAR_BIT)
(((NBITS) + CHAR_BIT - 1) / CHAR_BIT)
-#define Sbitset__byteAddress(SELF, INDEX) \
+# define Sbitset__byteAddress(SELF, INDEX) \
(((SELF) + (INDEX) / CHAR_BIT))
(((SELF) + (INDEX) / CHAR_BIT))
-#define Sbitset__bit_mask(INDEX) \
+# define Sbitset__bit_mask(INDEX) \
(1 << (CHAR_BIT - 1 - (INDEX) % CHAR_BIT))
(1 << (CHAR_BIT - 1 - (INDEX) % CHAR_BIT))
-#define Sbitset__last_byte_mask(NBITS) \
+# define Sbitset__last_byte_mask(NBITS) \
(UCHAR_MAX << (CHAR_BIT - 1 - ((NBITS) - 1) % CHAR_BIT))
/* nbits must not be 0. */
(UCHAR_MAX << (CHAR_BIT - 1 - ((NBITS) - 1) % CHAR_BIT))
/* nbits must not be 0. */
struct obstack *obstackp);
void Sbitset__delete (Sbitset self);
struct obstack *obstackp);
void Sbitset__delete (Sbitset self);
-#define Sbitset__test(SELF, INDEX) \
+# define Sbitset__test(SELF, INDEX) \
((*Sbitset__byteAddress ((SELF), (INDEX)) & Sbitset__bit_mask (INDEX)) != 0)
bool Sbitset__isEmpty (Sbitset self, Sbitset__Index nbits);
void Sbitset__fprint(Sbitset self, Sbitset__Index nbits, FILE *file);
((*Sbitset__byteAddress ((SELF), (INDEX)) & Sbitset__bit_mask (INDEX)) != 0)
bool Sbitset__isEmpty (Sbitset self, Sbitset__Index nbits);
void Sbitset__fprint(Sbitset self, Sbitset__Index nbits, FILE *file);
-#define Sbitset__set(SELF, INDEX) \
-do { \
- *Sbitset__byteAddress ((SELF), (INDEX)) = \
- *Sbitset__byteAddress ((SELF), (INDEX)) | Sbitset__bit_mask (INDEX); \
-} while(0)
+# define Sbitset__set(SELF, INDEX) \
+ do { \
+ *Sbitset__byteAddress ((SELF), (INDEX)) = \
+ *Sbitset__byteAddress ((SELF), (INDEX)) | Sbitset__bit_mask (INDEX); \
+ } while(0)
-#define Sbitset__reset(SELF, INDEX) \
-do { \
- *Sbitset__byteAddress ((SELF), (INDEX)) = \
- *Sbitset__byteAddress ((SELF), (INDEX)) & ~Sbitset__bit_mask (INDEX); \
-} while(0)
+# define Sbitset__reset(SELF, INDEX) \
+ do { \
+ *Sbitset__byteAddress ((SELF), (INDEX)) = \
+ *Sbitset__byteAddress ((SELF), (INDEX)) & ~Sbitset__bit_mask (INDEX); \
+ } while(0)
/* NBITS is the size of the bitset. More than NBITS bits might be reset. */
/* NBITS is the size of the bitset. More than NBITS bits might be reset. */
-#define Sbitset__zero(SELF, NBITS) \
-do { \
- memset (SELF, 0, Sbitset__nbytes (NBITS)); \
-} while(0)
+# define Sbitset__zero(SELF, NBITS) \
+ do { \
+ memset (SELF, 0, Sbitset__nbytes (NBITS)); \
+ } while(0)
/* NBITS is the size of the bitset. More than NBITS bits might be set. */
/* NBITS is the size of the bitset. More than NBITS bits might be set. */
-#define Sbitset__ones(SELF, NBITS) \
-do { \
- memset (SELF, UCHAR_MAX, Sbitset__nbytes (NBITS)); \
-} while(0)
+# define Sbitset__ones(SELF, NBITS) \
+ do { \
+ memset (SELF, UCHAR_MAX, Sbitset__nbytes (NBITS)); \
+ } while(0)
/* NBITS is the size of every bitset. More than NBITS bits might be set. */
/* NBITS is the size of every bitset. More than NBITS bits might be set. */
-#define Sbitset__or(SELF, OTHER1, OTHER2, NBITS) \
-do { \
- Sbitset ptr_self = (SELF); \
- Sbitset ptr_other1 = (OTHER1); \
- Sbitset ptr_other2 = (OTHER2); \
- Sbitset end_self = ptr_self + Sbitset__nbytes (NBITS); \
- for (; ptr_self < end_self; ++ptr_self, ++ptr_other1, ++ptr_other2) \
- *ptr_self = *ptr_other1 | *ptr_other2; \
-} while(0)
-
-#define SBITSET__FOR_EACH(SELF, NBITS, ITER, INDEX) \
- for ((ITER) = (SELF); (ITER) < (SELF) + Sbitset__nbytes (NBITS); ++(ITER)) \
- if (*(ITER) != 0) \
- for ((INDEX) = ((ITER)-(SELF))*CHAR_BIT; \
- (INDEX) < (NBITS) && (SELF)+(INDEX)/CHAR_BIT < (ITER)+1; \
- ++(INDEX)) \
+# define Sbitset__or(SELF, OTHER1, OTHER2, NBITS) \
+ do { \
+ Sbitset ptr_self = (SELF); \
+ Sbitset ptr_other1 = (OTHER1); \
+ Sbitset ptr_other2 = (OTHER2); \
+ Sbitset end_self = ptr_self + Sbitset__nbytes (NBITS); \
+ for (; ptr_self < end_self; ++ptr_self, ++ptr_other1, ++ptr_other2) \
+ *ptr_self = *ptr_other1 | *ptr_other2; \
+ } while(0)
+
+# define SBITSET__FOR_EACH(SELF, NBITS, ITER, INDEX) \
+ for ((ITER) = (SELF); (ITER) < (SELF) + Sbitset__nbytes (NBITS); ++(ITER)) \
+ if (*(ITER) != 0) \
+ for ((INDEX) = ((ITER)-(SELF))*CHAR_BIT; \
+ (INDEX) < (NBITS) && (SELF)+(INDEX)/CHAR_BIT < (ITER)+1; \
+ ++(INDEX)) \
if (((*ITER) & Sbitset__bit_mask (INDEX)) != 0)
#endif /* !SBITSET_H_ */
if (((*ITER) & Sbitset__bit_mask (INDEX)) != 0)
#endif /* !SBITSET_H_ */
/* Retrieve the FDERIVES/FIRSTS sets of the nonterminals numbered Var. */
#define FDERIVES(Var) fderives[(Var) - ntokens]
/* Retrieve the FDERIVES/FIRSTS sets of the nonterminals numbered Var. */
#define FDERIVES(Var) fderives[(Var) - ntokens]
-#define FIRSTS(Var) firsts[(Var) - ntokens]
+#define FIRSTS(Var) firsts[(Var) - ntokens]
# include "location.h"
/* Sub-messages indent. */
# include "location.h"
/* Sub-messages indent. */
/*-------------.
| --warnings. |
/*-------------.
| --warnings. |
+ (YY_FLEX_SUBMINOR_VERSION))
/* Pacify "gcc -Wmissing-prototypes" when flex 2.5.31 is used. */
+ (YY_FLEX_SUBMINOR_VERSION))
/* Pacify "gcc -Wmissing-prototypes" when flex 2.5.31 is used. */
-# if FLEX_VERSION <= 2005031
+#if FLEX_VERSION <= 2005031
int FLEX_PREFIX (get_lineno) (void);
FILE *FLEX_PREFIX (get_in) (void);
FILE *FLEX_PREFIX (get_out) (void);
int FLEX_PREFIX (get_lineno) (void);
FILE *FLEX_PREFIX (get_in) (void);
FILE *FLEX_PREFIX (get_out) (void);
#ifndef GETARGS_H_
# define GETARGS_H_
#ifndef GETARGS_H_
# define GETARGS_H_
enum { command_line_prio, grammar_prio, default_prio };
enum { command_line_prio, grammar_prio, default_prio };
extern int nvars;
typedef int item_number;
extern int nvars;
typedef int item_number;
-#define ITEM_NUMBER_MAX INT_MAX
+# define ITEM_NUMBER_MAX INT_MAX
extern item_number *ritem;
extern unsigned int nritems;
extern item_number *ritem;
extern unsigned int nritems;
/* Rule numbers. */
typedef int rule_number;
/* Rule numbers. */
typedef int rule_number;
-#define RULE_NUMBER_MAX INT_MAX
+# define RULE_NUMBER_MAX INT_MAX
extern rule_number nrules;
static inline item_number
extern rule_number nrules;
static inline item_number
#ifndef GRAPHVIZ_H_
# define GRAPHVIZ_H_
#ifndef GRAPHVIZ_H_
# define GRAPHVIZ_H_
#ifndef IELR_H_
# define IELR_H_
#ifndef IELR_H_
# define IELR_H_
-#define GRAM_LTYPE location
+# define GRAM_LTYPE location
-#define EMPTY_LOCATION_INIT {{NULL, 0, 0}, {NULL, 0, 0}}
+# define EMPTY_LOCATION_INIT {{NULL, 0, 0}, {NULL, 0, 0}}
extern location const empty_location;
/* Set *LOC and adjust scanner cursor to account for token TOKEN of
extern location const empty_location;
/* Set *LOC and adjust scanner cursor to account for token TOKEN of
/* An obstack dedicated to receive muscle keys and values. */
extern struct obstack muscle_obstack;
/* An obstack dedicated to receive muscle keys and values. */
extern struct obstack muscle_obstack;
-#define MUSCLE_INSERT_BOOL(Key, Value) \
- do { \
- int v__ = Value; \
- MUSCLE_INSERT_INT (Key, v__); \
+# define MUSCLE_INSERT_BOOL(Key, Value) \
+ do { \
+ int v__ = Value; \
+ MUSCLE_INSERT_INT (Key, v__); \
-#define MUSCLE_INSERTF(Key, Format, Value) \
+# define MUSCLE_INSERTF(Key, Format, Value) \
do { \
obstack_printf (&muscle_obstack, Format, Value); \
muscle_insert (Key, obstack_finish0 (&muscle_obstack)); \
} while (0)
do { \
obstack_printf (&muscle_obstack, Format, Value); \
muscle_insert (Key, obstack_finish0 (&muscle_obstack)); \
} while (0)
-#define MUSCLE_INSERT_INT(Key, Value) \
+# define MUSCLE_INSERT_INT(Key, Value) \
MUSCLE_INSERTF(Key, "%d", Value)
MUSCLE_INSERTF(Key, "%d", Value)
-#define MUSCLE_INSERT_LONG_INT(Key, Value) \
+# define MUSCLE_INSERT_LONG_INT(Key, Value) \
MUSCLE_INSERTF(Key, "%ld", Value)
/* Key -> Value, but don't apply escaping to Value. */
MUSCLE_INSERTF(Key, "%ld", Value)
/* Key -> Value, but don't apply escaping to Value. */
-#define MUSCLE_INSERT_STRING_RAW(Key, Value) \
+# define MUSCLE_INSERT_STRING_RAW(Key, Value) \
MUSCLE_INSERTF(Key, "%s", Value)
/* Key -> Value, applying M4 escaping to Value. */
MUSCLE_INSERTF(Key, "%s", Value)
/* Key -> Value, applying M4 escaping to Value. */
-#define MUSCLE_INSERT_STRING(Key, Value) \
+# define MUSCLE_INSERT_STRING(Key, Value) \
do { \
obstack_escape (&muscle_obstack, Value); \
muscle_insert (Key, obstack_finish0 (&muscle_obstack)); \
} while (0)
do { \
obstack_escape (&muscle_obstack, Value); \
muscle_insert (Key, obstack_finish0 (&muscle_obstack)); \
} while (0)
-#define MUSCLE_INSERT_C_STRING(Key, Value) \
+# define MUSCLE_INSERT_C_STRING(Key, Value) \
do { \
obstack_escape (&muscle_obstack, \
quotearg_style (c_quoting_style, Value)); \
do { \
obstack_escape (&muscle_obstack, \
quotearg_style (c_quoting_style, Value)); \
#ifndef NAMED_REF_H_
# define NAMED_REF_H_
#ifndef NAMED_REF_H_
# define NAMED_REF_H_
-#include "location.h"
-#include "uniqstr.h"
+# include "location.h"
+# include "uniqstr.h"
/* Named reference object. Keeps information about
a symbolic name of a symbol in a rule. */
/* Named reference object. Keeps information about
a symbolic name of a symbol in a rule. */
If GRAPH is a relation, then GRAPH[Node] is a list of adjacent
nodes, ended with END_NODE. */
If GRAPH is a relation, then GRAPH[Node] is a list of adjacent
nodes, ended with END_NODE. */
-#define END_NODE ((relation_node) -1)
+# define END_NODE ((relation_node) -1)
typedef size_t relation_node;
typedef relation_node *relation_nodes;
typedef size_t relation_node;
typedef relation_node *relation_nodes;
void code_props_none_init (code_props *self);
/** Equivalent to \c code_props_none_init. */
void code_props_none_init (code_props *self);
/** Equivalent to \c code_props_none_init. */
-#define CODE_PROPS_NONE_INIT \
+# define CODE_PROPS_NONE_INIT \
{ \
/* .kind = */ CODE_PROPS_NONE, \
/* .code = */ NULL, \
{ \
/* .kind = */ CODE_PROPS_NONE, \
/* .code = */ NULL, \
TRANSITIONS->states[Num]? Can be a token (amongst which the error
token), or non terminals in case of gotos. */
TRANSITIONS->states[Num]? Can be a token (amongst which the error
token), or non terminals in case of gotos. */
-#define TRANSITION_SYMBOL(Transitions, Num) \
+# define TRANSITION_SYMBOL(Transitions, Num) \
(Transitions->states[Num]->accessing_symbol)
/* Is the TRANSITIONS->states[Num] a shift? (as opposed to gotos). */
(Transitions->states[Num]->accessing_symbol)
/* Is the TRANSITIONS->states[Num] a shift? (as opposed to gotos). */
-#define TRANSITION_IS_SHIFT(Transitions, Num) \
+# define TRANSITION_IS_SHIFT(Transitions, Num) \
(ISTOKEN (TRANSITION_SYMBOL (Transitions, Num)))
/* Is the TRANSITIONS->states[Num] a goto?. */
(ISTOKEN (TRANSITION_SYMBOL (Transitions, Num)))
/* Is the TRANSITIONS->states[Num] a goto?. */
-#define TRANSITION_IS_GOTO(Transitions, Num) \
+# define TRANSITION_IS_GOTO(Transitions, Num) \
(!TRANSITION_IS_SHIFT (Transitions, Num))
/* Is the TRANSITIONS->states[Num] labelled by the error token? */
(!TRANSITION_IS_SHIFT (Transitions, Num))
/* Is the TRANSITIONS->states[Num] labelled by the error token? */
-#define TRANSITION_IS_ERROR(Transitions, Num) \
+# define TRANSITION_IS_ERROR(Transitions, Num) \
(TRANSITION_SYMBOL (Transitions, Num) == errtoken->number)
/* When resolving a SR conflicts, if the reduction wins, the shift is
disabled. */
(TRANSITION_SYMBOL (Transitions, Num) == errtoken->number)
/* When resolving a SR conflicts, if the reduction wins, the shift is
disabled. */
-#define TRANSITION_DISABLE(Transitions, Num) \
+# define TRANSITION_DISABLE(Transitions, Num) \
(Transitions->states[Num] = NULL)
(Transitions->states[Num] = NULL)
-#define TRANSITION_IS_DISABLED(Transitions, Num) \
+# define TRANSITION_IS_DISABLED(Transitions, Num) \
(Transitions->states[Num] == NULL)
/* Iterate over each transition over a token (shifts). */
(Transitions->states[Num] == NULL)
/* Iterate over each transition over a token (shifts). */
-#define FOR_EACH_SHIFT(Transitions, Iter) \
+# define FOR_EACH_SHIFT(Transitions, Iter) \
for (Iter = 0; \
Iter < Transitions->num \
&& (TRANSITION_IS_DISABLED (Transitions, Iter) \
for (Iter = 0; \
Iter < Transitions->num \
&& (TRANSITION_IS_DISABLED (Transitions, Iter) \
/** Internal token numbers. */
typedef int symbol_number;
/** Internal token numbers. */
typedef int symbol_number;
-#define SYMBOL_NUMBER_MAXIMUM INT_MAX
+# define SYMBOL_NUMBER_MAXIMUM INT_MAX
typedef struct symbol symbol;
typedef struct symbol symbol;
};
/** Undefined user number. */
};
/** Undefined user number. */
-#define USER_NUMBER_UNDEFINED -1
+# define USER_NUMBER_UNDEFINED -1
/* `symbol->user_token_number == USER_NUMBER_HAS_STRING_ALIAS' means
this symbol has a literal string alias. For instance, `%token foo
"foo"' has `"foo"' numbered regularly, and `foo' numbered as
USER_NUMBER_HAS_STRING_ALIAS. */
/* `symbol->user_token_number == USER_NUMBER_HAS_STRING_ALIAS' means
this symbol has a literal string alias. For instance, `%token foo
"foo"' has `"foo"' numbered regularly, and `foo' numbered as
USER_NUMBER_HAS_STRING_ALIAS. */
-#define USER_NUMBER_HAS_STRING_ALIAS -9991
+# define USER_NUMBER_HAS_STRING_ALIAS -9991
/* Undefined internal token number. */
/* Undefined internal token number. */
-#define NUMBER_UNDEFINED (-1)
+# define NUMBER_UNDEFINED (-1)
/** Fetch (or create) the symbol associated to KEY. */
symbol *symbol_from_uniqstr (const uniqstr key, location loc);
/** Fetch (or create) the symbol associated to KEY. */
symbol *symbol_from_uniqstr (const uniqstr key, location loc);
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef BISON_SYSTEM_H
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef BISON_SYSTEM_H
/* flex 2.5.31 gratutiously defines macros like INT8_MIN. But this
runs afoul of pre-C99 compilers that have <inttypes.h> or
<stdint.h>, which are included below if available. It also runs
afoul of pre-C99 compilers that define these macros in <limits.h>. */
/* flex 2.5.31 gratutiously defines macros like INT8_MIN. But this
runs afoul of pre-C99 compilers that have <inttypes.h> or
<stdint.h>, which are included below if available. It also runs
afoul of pre-C99 compilers that define these macros in <limits.h>. */
-#if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901
-# undef INT8_MIN
-# undef INT16_MIN
-# undef INT32_MIN
-# undef INT8_MAX
-# undef INT16_MAX
-# undef UINT8_MAX
-# undef INT32_MAX
-# undef UINT16_MAX
-# undef UINT32_MAX
-#endif
-
-#include <limits.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array))
-#define STREQ(L, R) (strcmp(L, R) == 0)
-#define STRNEQ(L, R) (!STREQ(L, R))
+# if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901
+# undef INT8_MIN
+# undef INT16_MIN
+# undef INT32_MIN
+# undef INT8_MAX
+# undef INT16_MAX
+# undef UINT8_MAX
+# undef INT32_MAX
+# undef UINT16_MAX
+# undef UINT32_MAX
+# endif
+
+# include <limits.h>
+# include <stddef.h>
+# include <stdlib.h>
+# include <string.h>
+
+# define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array))
+# define STREQ(L, R) (strcmp(L, R) == 0)
+# define STRNEQ(L, R) (!STREQ(L, R))
/* Just like strncmp, but the second argument must be a literal string
and you don't specify the length. */
/* Just like strncmp, but the second argument must be a literal string
and you don't specify the length. */
-#define STRNCMP_LIT(S, Literal) \
+# define STRNCMP_LIT(S, Literal) \
strncmp (S, "" Literal "", sizeof (Literal) - 1)
/* Whether Literal is a prefix of S. */
strncmp (S, "" Literal "", sizeof (Literal) - 1)
/* Whether Literal is a prefix of S. */
-#define STRPREFIX_LIT(Literal, S) \
+# define STRPREFIX_LIT(Literal, S) \
(STRNCMP_LIT (S, Literal) == 0)
(STRNCMP_LIT (S, Literal) == 0)
-#include <unistd.h>
-#include <inttypes.h>
+# include <unistd.h>
+# include <inttypes.h>
/* This isn't perfect, but it's good enough for Bison, which needs
only to hash pointers. */
typedef size_t uintptr_t;
/* This isn't perfect, but it's good enough for Bison, which needs
only to hash pointers. */
typedef size_t uintptr_t;
/*---------.
| Gnulib. |
`---------*/
/*---------.
| Gnulib. |
`---------*/
-#include <unlocked-io.h>
-#include <verify.h>
-#include <xalloc.h>
+# include <unlocked-io.h>
+# include <verify.h>
+# include <xalloc.h>
and safer logic than it would for users. Due to the overhead of M4,
suppressing Code is unlikely to offer any significant improvement in
Bison's performance anyway. */
and safer logic than it would for users. Due to the overhead of M4,
suppressing Code is unlikely to offer any significant improvement in
Bison's performance anyway. */
-#define PACIFY_CC(Code) Code
+# define PACIFY_CC(Code) Code
/* This feature is available in gcc versions 2.5 and later. */
/* This feature is available in gcc versions 2.5 and later. */
-# if (! defined __GNUC__ || __GNUC__ < 2 \
+# if (! defined __GNUC__ || __GNUC__ < 2 \
|| (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
|| (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
-# define __attribute__(Spec) /* empty */
+# define __attribute__(Spec) /* empty */
+# endif
/* The __-protected variants of `format' and `printf' attributes
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
/* The __-protected variants of `format' and `printf' attributes
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
-#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
-# define __format__ format
-# define __printf__ printf
-#endif
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
+# define __format__ format
+# define __printf__ printf
+# endif
-#ifndef ATTRIBUTE_NORETURN
-# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
-#endif
+# ifndef ATTRIBUTE_NORETURN
+# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
+# endif
-#ifndef ATTRIBUTE_UNUSED
-# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
-#endif
+# ifndef ATTRIBUTE_UNUSED
+# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+# endif
/*------.
| NLS. |
`------*/
/*------.
| NLS. |
`------*/
-#include <gettext.h>
-#define _(Msgid) gettext (Msgid)
-#define N_(Msgid) (Msgid)
+# include <gettext.h>
+# define _(Msgid) gettext (Msgid)
+# define N_(Msgid) (Msgid)
/*-----------.
| Booleans. |
`-----------*/
/*-----------.
| Booleans. |
`-----------*/
For now, we use assert but we call it aver throughout Bison in case
we later wish to try another scheme.
*/
For now, we use assert but we call it aver throughout Bison in case
we later wish to try another scheme.
*/
-#include <assert.h>
-#define aver assert
+# include <assert.h>
+# define aver assert
/*-----------.
| Obstacks. |
`-----------*/
/*-----------.
| Obstacks. |
`-----------*/
-#define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free free
-#include <obstack.h>
+# define obstack_chunk_alloc xmalloc
+# define obstack_chunk_free free
+# include <obstack.h>
/* String-grow: append Str to Obs. */
/* String-grow: append Str to Obs. */
-#define obstack_sgrow(Obs, Str) \
+# define obstack_sgrow(Obs, Str) \
obstack_grow (Obs, Str, strlen (Str))
/* Output Str escaped for our postprocessing (i.e., escape M4 special
obstack_grow (Obs, Str, strlen (Str))
/* Output Str escaped for our postprocessing (i.e., escape M4 special
/* Append the ending 0, finish Obs, and return the string. */
/* Append the ending 0, finish Obs, and return the string. */
-# define obstack_finish0(Obs) \
+# define obstack_finish0(Obs) \
(obstack_1grow (Obs, '\0'), (char *) obstack_finish (Obs))
(obstack_1grow (Obs, '\0'), (char *) obstack_finish (Obs))
| Extensions to use for the output files. |
`-----------------------------------------*/
| Extensions to use for the output files. |
`-----------------------------------------*/
-#ifndef OUTPUT_EXT
-# define OUTPUT_EXT ".output"
-#endif
+# ifndef OUTPUT_EXT
+# define OUTPUT_EXT ".output"
+# endif
-#ifndef TAB_EXT
-# define TAB_EXT ".tab"
-#endif
+# ifndef TAB_EXT
+# define TAB_EXT ".tab"
+# endif
| Free a linked list. |
`---------------------*/
| Free a linked list. |
`---------------------*/
-#define LIST_FREE(Type, List) \
-do { \
- Type *_node, *_next; \
- for (_node = List; _node; _node = _next) \
- { \
- _next = _node->next; \
- free (_node); \
- } \
-} while (0)
+# define LIST_FREE(Type, List) \
+ do { \
+ Type *_node, *_next; \
+ for (_node = List; _node; _node = _next) \
+ { \
+ _next = _node->next; \
+ free (_node); \
+ } \
+ } while (0)
/*---------------------------------------------.
/*---------------------------------------------.
__attribute__ ((__format__ (__printf__, 1, 2)));
/* Two uniqstr values have the same value iff they are the same. */
__attribute__ ((__format__ (__printf__, 1, 2)));
/* Two uniqstr values have the same value iff they are the same. */
-#define UNIQSTR_EQ(USTR1, USTR2) (!!((USTR1) == (USTR2)))
+# define UNIQSTR_EQ(USTR1, USTR2) (!!((USTR1) == (USTR2)))
/* Compare two uniqstr a la strcmp: negative for <, nul for =, and
positive for >. Undefined order, relies on addresses. */
/* Compare two uniqstr a la strcmp: negative for <, nul for =, and
positive for >. Undefined order, relies on addresses. */
-#define UNIQSTR_CMP(USTR1, USTR2) ((USTR1) - (USTR2))
+# define UNIQSTR_CMP(USTR1, USTR2) ((USTR1) - (USTR2))
/*--------------------------------------.
| Initializing, destroying, debugging. |
/*--------------------------------------.
| Initializing, destroying, debugging. |
checking. Unfortunately, because of the missing format string in the
macro invocation, the argument number reported by gcc for a bad
argument type is 1 too large. */
checking. Unfortunately, because of the missing format string in the
macro invocation, the argument number reported by gcc for a bad
argument type is 1 too large. */
-#define UNIQSTR_CONCAT(...) \
- uniqstr_vsprintf (UNIQSTR_GEN_FORMAT (__VA_ARGS__, \
- "%s", "%s", "%s", "%s", "%s", \
- "%s", "%s", "%s", "%s", "%s", \
- "%s", "%s", "%s", "%s", "%s", \
- "%s", "%s", "%s", "%s", "%s"), \
+# define UNIQSTR_CONCAT(...) \
+ uniqstr_vsprintf (UNIQSTR_GEN_FORMAT (__VA_ARGS__, \
+ "%s", "%s", "%s", "%s", "%s", \
+ "%s", "%s", "%s", "%s", "%s", \
+ "%s", "%s", "%s", "%s", "%s", \
+ "%s", "%s", "%s", "%s", "%s"), \
-#define UNIQSTR_GEN_FORMAT(F1, F2, F3, F4, F5, \
- F6, F7, F8, F9, F10, \
- F11, F12, F13, F14, F15, \
- F16, F17, F18, F19, F20, \
- ...) \
- UNIQSTR_GEN_FORMAT_ (__VA_ARGS__, \
- "", "", "", "", "", \
- "", "", "", "", "", \
- "", "", "", "", "", \
+# define UNIQSTR_GEN_FORMAT(F1, F2, F3, F4, F5, \
+ F6, F7, F8, F9, F10, \
+ F11, F12, F13, F14, F15, \
+ F16, F17, F18, F19, F20, \
+ ...) \
+ UNIQSTR_GEN_FORMAT_ (__VA_ARGS__, \
+ "", "", "", "", "", \
+ "", "", "", "", "", \
+ "", "", "", "", "", \
-#define UNIQSTR_GEN_FORMAT_(F1, F2, F3, F4, F5, \
- F6, F7, F8, F9, F10, \
- F11, F12, F13, F14, F15, \
- F16, F17, F18, F19, F20, ...) \
- F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 \
+# define UNIQSTR_GEN_FORMAT_(F1, F2, F3, F4, F5, \
+ F6, F7, F8, F9, F10, \
+ F11, F12, F13, F14, F15, \
+ F16, F17, F18, F19, F20, ...) \
+ F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 \
F11 F12 F13 F14 F15 F16 F17 F18 F19 F20
#endif /* ! defined UNIQSTR_H_ */
F11 F12 F13 F14 F15 F16 F17 F18 F19 F20
#endif /* ! defined UNIQSTR_H_ */