2
2
/* Expression parsing for plural form selection.
3
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
3
Copyright (C) 2000-2001, 2003 Free Software Foundation, Inc.
4
4
Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
6
6
This program is free software; you can redistribute it and/or modify it
56
56
/* Prototypes for local functions. */
57
static struct expression *new_exp PARAMS ((int nargs, enum operator op,
58
struct expression * const *args));
59
static inline struct expression *new_exp_0 PARAMS ((enum operator op));
60
static inline struct expression *new_exp_1 PARAMS ((enum operator op,
61
struct expression *right));
62
static struct expression *new_exp_2 PARAMS ((enum operator op,
63
struct expression *left,
64
struct expression *right));
65
static inline struct expression *new_exp_3 PARAMS ((enum operator op,
66
struct expression *bexp,
67
struct expression *tbranch,
68
struct expression *fbranch));
69
static int yylex PARAMS ((YYSTYPE *lval, const char **pexp));
70
static void yyerror PARAMS ((const char *str));
57
static int yylex (YYSTYPE *lval, const char **pexp);
58
static void yyerror (const char *str);
72
60
/* Allocation of expressions. */
74
62
static struct expression *
75
new_exp (nargs, op, args)
78
struct expression * const *args;
63
new_exp (int nargs, enum operator op, struct expression * const *args)
81
66
struct expression *newp;
106
91
static inline struct expression *
92
new_exp_0 (enum operator op)
110
94
return new_exp (0, op, NULL);
113
97
static inline struct expression *
114
new_exp_1 (op, right)
116
struct expression *right;
98
new_exp_1 (enum operator op, struct expression *right)
118
100
struct expression *args[1];
124
106
static struct expression *
125
new_exp_2 (op, left, right)
127
struct expression *left;
128
struct expression *right;
107
new_exp_2 (enum operator op, struct expression *left, struct expression *right)
130
109
struct expression *args[2];
137
116
static inline struct expression *
138
new_exp_3 (op, bexp, tbranch, fbranch)
140
struct expression *bexp;
141
struct expression *tbranch;
142
struct expression *fbranch;
117
new_exp_3 (enum operator op, struct expression *bexp,
118
struct expression *tbranch, struct expression *fbranch)
144
120
struct expression *args[3];