~ubuntu-branches/ubuntu/oneiric/vorbis-tools/oneiric

« back to all changes in this revision

Viewing changes to intl/plural.y

  • Committer: Bazaar Package Importer
  • Author(s): Adeodato Simó
  • Date: 2006-07-13 21:25:09 UTC
  • mfrom: (2.1.6 edgy)
  • Revision ID: james.westby@ubuntu.com-20060713212509-903jomi0kuu1gzy0
Tags: 1.1.1-6
* Include vorbistagedit script from martin f. krafft to edit vorbis tags in
  an editor.  (Closes: #357421)

* Build with LFS, without touching configure.ac this time, as adviced by the
  submitter. Submit however debian/patches/for_upstream-largefile_support.diff
  to upstream, together with dean gaudet's include_config_h_everywhere.patch.
  (Closes: #364527)

* Fix typos in manpages spotted by A Costa.  (Closes: #353184, #353185)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
%{
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.
5
5
 
6
6
   This program is free software; you can redistribute it and/or modify it
30
30
# include <config.h>
31
31
#endif
32
32
 
 
33
#include <stddef.h>
33
34
#include <stdlib.h>
34
 
#include "gettextP.h"
 
35
#include "plural-exp.h"
35
36
 
36
 
/* Names for the libintl functions are a problem.  They must not clash
37
 
   with existing names and they should follow ANSI C.  But this source
38
 
   code is also used in GNU C Library where the names have a __
39
 
   prefix.  So we have to make a difference here.  */
40
 
#ifdef _LIBC
41
 
# define FREE_EXPRESSION __gettext_free_exp
42
 
#else
43
 
# define FREE_EXPRESSION gettext_free_exp__
44
 
# define __gettextparse gettextparse__
 
37
/* The main function generated by the parser is called __gettextparse,
 
38
   but we want it to be called PLURAL_PARSE.  */
 
39
#ifndef _LIBC
 
40
# define __gettextparse PLURAL_PARSE
45
41
#endif
46
42
 
47
43
#define YYLEX_PARAM     &((struct parse_args *) arg)->cp
48
44
#define YYPARSE_PARAM   arg
49
45
%}
50
46
%pure_parser
51
 
%expect 10
 
47
%expect 7
52
48
 
53
49
%union {
54
50
  unsigned long int num;
58
54
 
59
55
%{
60
56
/* Prototypes for local functions.  */
61
 
static struct expression *new_exp PARAMS ((int nargs, enum operator op,
62
 
                                           struct expression * const *args));
63
 
static inline struct expression *new_exp_0 PARAMS ((enum operator op));
64
 
static inline struct expression *new_exp_1 PARAMS ((enum operator op,
65
 
                                                   struct expression *right));
66
 
static struct expression *new_exp_2 PARAMS ((enum operator op,
67
 
                                             struct expression *left,
68
 
                                             struct expression *right));
69
 
static inline struct expression *new_exp_3 PARAMS ((enum operator op,
70
 
                                                   struct expression *bexp,
71
 
                                                   struct expression *tbranch,
72
 
                                                   struct expression *fbranch));
73
 
static int yylex PARAMS ((YYSTYPE *lval, const char **pexp));
74
 
static void yyerror PARAMS ((const char *str));
 
57
static int yylex (YYSTYPE *lval, const char **pexp);
 
58
static void yyerror (const char *str);
75
59
 
76
60
/* Allocation of expressions.  */
77
61
 
78
62
static struct expression *
79
 
new_exp (nargs, op, args)
80
 
     int nargs;
81
 
     enum operator op;
82
 
     struct expression * const *args;
 
63
new_exp (int nargs, enum operator op, struct expression * const *args)
83
64
{
84
65
  int i;
85
66
  struct expression *newp;
108
89
}
109
90
 
110
91
static inline struct expression *
111
 
new_exp_0 (op)
112
 
     enum operator op;
 
92
new_exp_0 (enum operator op)
113
93
{
114
94
  return new_exp (0, op, NULL);
115
95
}
116
96
 
117
97
static inline struct expression *
118
 
new_exp_1 (op, right)
119
 
     enum operator op;
120
 
     struct expression *right;
 
98
new_exp_1 (enum operator op, struct expression *right)
121
99
{
122
100
  struct expression *args[1];
123
101
 
126
104
}
127
105
 
128
106
static struct expression *
129
 
new_exp_2 (op, left, right)
130
 
     enum operator op;
131
 
     struct expression *left;
132
 
     struct expression *right;
 
107
new_exp_2 (enum operator op, struct expression *left, struct expression *right)
133
108
{
134
109
  struct expression *args[2];
135
110
 
139
114
}
140
115
 
141
116
static inline struct expression *
142
 
new_exp_3 (op, bexp, tbranch, fbranch)
143
 
     enum operator op;
144
 
     struct expression *bexp;
145
 
     struct expression *tbranch;
146
 
     struct expression *fbranch;
 
117
new_exp_3 (enum operator op, struct expression *bexp,
 
118
           struct expression *tbranch, struct expression *fbranch)
147
119
{
148
120
  struct expression *args[3];
149
121
 
234
206
 
235
207
void
236
208
internal_function
237
 
FREE_EXPRESSION (exp)
238
 
     struct expression *exp;
 
209
FREE_EXPRESSION (struct expression *exp)
239
210
{
240
211
  if (exp == NULL)
241
212
    return;
261
232
 
262
233
 
263
234
static int
264
 
yylex (lval, pexp)
265
 
     YYSTYPE *lval;
266
 
     const char **pexp;
 
235
yylex (YYSTYPE *lval, const char **pexp)
267
236
{
268
237
  const char *exp = *pexp;
269
238
  int result;
406
375
 
407
376
 
408
377
static void
409
 
yyerror (str)
410
 
     const char *str;
 
378
yyerror (const char *str)
411
379
{
412
380
  /* Do nothing.  We don't print error messages here.  */
413
381
}