mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-21 18:23:03 +00:00
grammar: style changes
* src/parse-gram.y (PARAM_TYPE): Remove useless typedef guard. There's a header guard. Use 'yyo' with %printer. Use a consistent style for %union one-liners.
This commit is contained in:
@@ -217,8 +217,6 @@ static char const *char_name (char);
|
|||||||
`---------*/
|
`---------*/
|
||||||
%code requires
|
%code requires
|
||||||
{
|
{
|
||||||
# ifndef PARAM_TYPE
|
|
||||||
# define PARAM_TYPE
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
param_none = 0,
|
param_none = 0,
|
||||||
@@ -226,7 +224,6 @@ static char const *char_name (char);
|
|||||||
param_parse = 1 << 1,
|
param_parse = 1 << 1,
|
||||||
param_both = param_lex | param_parse
|
param_both = param_lex | param_parse
|
||||||
} param_type;
|
} param_type;
|
||||||
# endif
|
|
||||||
};
|
};
|
||||||
%code
|
%code
|
||||||
{
|
{
|
||||||
@@ -239,17 +236,14 @@ static char const *char_name (char);
|
|||||||
static void add_param (param_type type, char *decl, location loc);
|
static void add_param (param_type type, char *decl, location loc);
|
||||||
static param_type current_param = param_none;
|
static param_type current_param = param_none;
|
||||||
};
|
};
|
||||||
%union
|
%union {param_type param;}
|
||||||
{
|
|
||||||
param_type param;
|
|
||||||
}
|
|
||||||
%token <param> PERCENT_PARAM "%param";
|
%token <param> PERCENT_PARAM "%param";
|
||||||
%printer
|
%printer
|
||||||
{
|
{
|
||||||
switch ($$)
|
switch ($$)
|
||||||
{
|
{
|
||||||
#define CASE(In, Out) \
|
#define CASE(In, Out) \
|
||||||
case param_ ## In: fputs ("%" #Out, stderr); break
|
case param_ ## In: fputs ("%" #Out, yyo); break
|
||||||
CASE (lex, lex-param);
|
CASE (lex, lex-param);
|
||||||
CASE (parse, parse-param);
|
CASE (parse, parse-param);
|
||||||
CASE (both, param);
|
CASE (both, param);
|
||||||
|
|||||||
Reference in New Issue
Block a user