Back to index

tetex-bin  3.0
Classes | Defines | Functions | Variables
plural.c File Reference
#include <stddef.h>
#include <stdlib.h>
#include "plural-exp.h"

Go to the source code of this file.

Classes

union  yystype
union  yyalloc

Defines

#define YYBISON   1 /* Identify Bison output. */
#define yyparse   __gettextparse
#define yylex   __gettextlex
#define yyerror   __gettexterror
#define yylval   __gettextlval
#define yychar   __gettextchar
#define yydebug   __gettextdebug
#define yynerrs   __gettextnerrs
#define EQUOP2   257
#define CMPOP2   258
#define ADDOP2   259
#define MULOP2   260
#define NUMBER   261
#define __gettextparse   PLURAL_PARSE
#define YYLEX_PARAM   &((struct parse_args *) arg)->cp
#define YYPARSE_PARAM   arg
#define YYSTYPE   yystype
#define YYSTYPE_IS_TRIVIAL   1
#define YYDEBUG   0
#define YYFINAL   27
#define YYFLAG   -32768
#define YYNTBASE   16
#define YYTRANSLATE(x)   ((unsigned)(x) <= 261 ? yytranslate[x] : 18)
#define YYLAST   53
#define YYPURE   1
#define YYSTACK_ALLOC   malloc
#define YYSTACK_FREE   free
#define YYSTACK_GAP_MAX   (sizeof (union yyalloc) - 1)
#define YYSTACK_BYTES(N)
#define YYCOPY(To, From, Count)
#define YYSTACK_RELOCATE(Stack)
#define YYSIZE_T   unsigned int
#define yyerrok   (yyerrstatus = 0)
#define yyclearin   (yychar = YYEMPTY)
#define YYEMPTY   -2
#define YYEOF   0
#define YYACCEPT   goto yyacceptlab
#define YYABORT   goto yyabortlab
#define YYERROR   goto yyerrlab1
#define YYFAIL   goto yyerrlab
#define YYRECOVERING()   (!!yyerrstatus)
#define YYBACKUP(Token, Value)
#define YYTERROR   1
#define YYERRCODE   256
#define YYLLOC_DEFAULT(Current, Rhs, N)
#define YYLEX   yylex (&yylval, YYLEX_PARAM)
#define YYDPRINTF(Args)
#define YYINITDEPTH   200
#define YYMAXDEPTH   10000
#define YYPARSE_PARAM_ARG   YYPARSE_PARAM
#define YYPARSE_PARAM_DECL   void *YYPARSE_PARAM;
#define YY_DECL_NON_LSP_VARIABLES
#define YY_DECL_VARIABLES   YY_DECL_NON_LSP_VARIABLES
#define YYPOPSTACK   (yyvsp--, yyssp--)

Functions

static int yylex (YYSTYPE *lval, const char **pexp)
static void yyerror (const char *str)
static struct expressionnew_exp (int nargs, enum operator op, struct expression *const *args)
static struct expressionnew_exp_0 (enum operator op)
static struct expressionnew_exp_1 (enum operator op, struct expression *right)
static struct expressionnew_exp_2 (enum operator op, struct expression *left, struct expression *right)
static struct expressionnew_exp_3 (enum operator op, struct expression *bexp, struct expression *tbranch, struct expression *fbranch)
int yyparse (YYPARSE_PARAM_ARG)
void internal_function FREE_EXPRESSION (struct expression *exp)

Variables

static const char yytranslate []
static const short yyr1 []
static const short yyr2 []
static const short yydefact []
static const short yydefgoto []
static const short yypact []
static const short yypgoto []
static const short yytable []
static const short yycheck []

Class Documentation

union yystype

Definition at line 25 of file parser.h.

Collaboration diagram for yystype:
Class Members
enum operator struct expression * exp
unsigned long int num
int yfix
int yint
unsigned yint
left yleft
list ylist
llist ylleft
char * ystring
union yyalloc

Definition at line 375 of file plural.c.

Class Members
short yyss
YYSTYPE yyvs

Define Documentation

Definition at line 59 of file plural.c.

#define ADDOP2   259

Definition at line 15 of file plural.c.

#define CMPOP2   258

Definition at line 14 of file plural.c.

#define EQUOP2   257

Definition at line 13 of file plural.c.

#define MULOP2   260

Definition at line 16 of file plural.c.

#define NUMBER   261

Definition at line 17 of file plural.c.

Value:
/* The lookahead symbol.  */                            \
int yychar;                                      \
                                                 \
/* The semantic value of the lookahead symbol. */       \
YYSTYPE yylval;                                         \
                                                 \
/* Number of parse errors so far.  */                   \
int yynerrs;

Definition at line 646 of file plural.c.

Definition at line 663 of file plural.c.

#define YYABORT   goto yyabortlab

Definition at line 457 of file plural.c.

#define YYACCEPT   goto yyacceptlab

Definition at line 456 of file plural.c.

#define YYBACKUP (   Token,
  Value 
)
Value:
do								\
  if (yychar == YYEMPTY && yylen == 1)                         \
    {                                                   \
      yychar = (Token);                                        \
      yylval = (Value);                                        \
      yychar1 = YYTRANSLATE (yychar);                          \
      YYPOPSTACK;                                       \
      goto yybackup;                                    \
    }                                                   \
  else                                                  \
    {                                                   \
      yyerror ("syntax error: cannot back up");                \
      YYERROR;                                                 \
    }                                                   \
while (0)

Definition at line 464 of file plural.c.

#define YYBISON   1 /* Identify Bison output. */

Definition at line 4 of file plural.c.

#define yychar   __gettextchar

Definition at line 10 of file plural.c.

#define yyclearin   (yychar = YYEMPTY)

Definition at line 453 of file plural.c.

#define YYCOPY (   To,
  From,
  Count 
)
Value:
do                                 \
       {                                  \
         register YYSIZE_T yyi;           \
         for (yyi = 0; yyi < (Count); yyi++)     \
           (To)[yyi] = (From)[yyi];              \
       }                                  \
      while (0)

Definition at line 406 of file plural.c.

#define yydebug   __gettextdebug

Definition at line 11 of file plural.c.

#define YYDEBUG   0

Definition at line 150 of file plural.c.

#define YYDPRINTF (   Args)

Definition at line 537 of file plural.c.

#define YYEMPTY   -2

Definition at line 454 of file plural.c.

#define YYEOF   0

Definition at line 455 of file plural.c.

#define YYERRCODE   256

Definition at line 482 of file plural.c.

#define yyerrok   (yyerrstatus = 0)

Definition at line 452 of file plural.c.

#define yyerror   __gettexterror

Definition at line 8 of file plural.c.

#define YYERROR   goto yyerrlab1

Definition at line 458 of file plural.c.

#define YYFAIL   goto yyerrlab

Definition at line 462 of file plural.c.

#define YYFINAL   27

Definition at line 155 of file plural.c.

#define YYFLAG   -32768

Definition at line 156 of file plural.c.

#define YYINITDEPTH   200

Definition at line 542 of file plural.c.

#define YYLAST   53

Definition at line 274 of file plural.c.

#define yylex   __gettextlex

Definition at line 7 of file plural.c.

#define YYLEX   yylex (&yylval, YYLEX_PARAM)

Definition at line 510 of file plural.c.

#define YYLEX_PARAM   &((struct parse_args *) arg)->cp

Definition at line 62 of file plural.c.

#define YYLLOC_DEFAULT (   Current,
  Rhs,
 
)
Value:
Current.last_line   = Rhs[N].last_line;   \
   Current.last_column = Rhs[N].last_column;

Definition at line 493 of file plural.c.

#define yylval   __gettextlval

Definition at line 9 of file plural.c.

#define YYMAXDEPTH   10000

Definition at line 557 of file plural.c.

#define yynerrs   __gettextnerrs

Definition at line 12 of file plural.c.

#define YYNTBASE   16

Definition at line 157 of file plural.c.

#define yyparse   __gettextparse

Definition at line 6 of file plural.c.

#define YYPARSE_PARAM   arg

Definition at line 63 of file plural.c.

Definition at line 626 of file plural.c.

Definition at line 627 of file plural.c.

#define YYPOPSTACK   (yyvsp--, yyssp--)
#define YYPURE   1

Definition at line 296 of file plural.c.

#define YYRECOVERING ( )    (!!yyerrstatus)

Definition at line 463 of file plural.c.

#define YYSIZE_T   unsigned int

Definition at line 449 of file plural.c.

#define YYSTACK_ALLOC   malloc

Definition at line 364 of file plural.c.

#define YYSTACK_BYTES (   N)
Value:
((N) * (sizeof (short) + sizeof (YYSTYPE))                            \
      + YYSTACK_GAP_MAX)

Definition at line 394 of file plural.c.

#define YYSTACK_FREE   free

Definition at line 365 of file plural.c.

#define YYSTACK_GAP_MAX   (sizeof (union yyalloc) - 1)

Definition at line 385 of file plural.c.

#define YYSTACK_RELOCATE (   Stack)
Value:
do                                                             \
      {                                                               \
       YYSIZE_T yynewbytes;                                    \
       YYCOPY (&yyptr->Stack, Stack, yysize);                         \
       Stack = &yyptr->Stack;                                         \
       yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX;  \
       yyptr += yynewbytes / sizeof (*yyptr);                         \
      }                                                               \
    while (0)

Definition at line 422 of file plural.c.

#define YYSTYPE   yystype

Definition at line 72 of file plural.c.

#define YYSTYPE_IS_TRIVIAL   1

Definition at line 73 of file plural.c.

#define YYTERROR   1

Definition at line 481 of file plural.c.

#define YYTRANSLATE (   x)    ((unsigned)(x) <= 261 ? yytranslate[x] : 18)

Definition at line 160 of file plural.c.


Function Documentation

Definition at line 1318 of file plural.c.

{
  if (exp == NULL)
    return;

  /* Handle the recursive case.  */
  switch (exp->nargs)
    {
    case 3:
      FREE_EXPRESSION (exp->val.args[2]);
      /* FALLTHROUGH */
    case 2:
      FREE_EXPRESSION (exp->val.args[1]);
      /* FALLTHROUGH */
    case 1:
      FREE_EXPRESSION (exp->val.args[0]);
      /* FALLTHROUGH */
    default:
      break;
    }

  free (exp);
}

Here is the call graph for this function:

static struct expression* new_exp ( int  nargs,
enum operator  op,
struct expression *const args 
) [static, read]

Definition at line 84 of file plural.c.

{
  int i;
  struct expression *newp;

  /* If any of the argument could not be malloc'ed, just return NULL.  */
  for (i = nargs - 1; i >= 0; i--)
    if (args[i] == NULL)
      goto fail;

  /* Allocate a new expression.  */
  newp = (struct expression *) malloc (sizeof (*newp));
  if (newp != NULL)
    {
      newp->nargs = nargs;
      newp->operation = op;
      for (i = nargs - 1; i >= 0; i--)
       newp->val.args[i] = args[i];
      return newp;
    }

 fail:
  for (i = nargs - 1; i >= 0; i--)
    FREE_EXPRESSION (args[i]);

  return NULL;
}

Here is the caller graph for this function:

static struct expression* new_exp_0 ( enum operator  op) [static, read]

Definition at line 113 of file plural.c.

{
  return new_exp (0, op, NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static struct expression* new_exp_1 ( enum operator  op,
struct expression right 
) [static, read]

Definition at line 119 of file plural.c.

{
  struct expression *args[1];

  args[0] = right;
  return new_exp (1, op, args);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static struct expression* new_exp_2 ( enum operator  op,
struct expression left,
struct expression right 
) [static, read]

Definition at line 128 of file plural.c.

{
  struct expression *args[2];

  args[0] = left;
  args[1] = right;
  return new_exp (2, op, args);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static struct expression* new_exp_3 ( enum operator  op,
struct expression bexp,
struct expression tbranch,
struct expression fbranch 
) [static, read]

Definition at line 138 of file plural.c.

{
  struct expression *args[3];

  args[0] = bexp;
  args[1] = tbranch;
  args[2] = fbranch;
  return new_exp (3, op, args);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void yyerror ( const char *  str) [static]

Definition at line 1487 of file plural.c.

{
  /* Do nothing.  We don't print error messages here.  */
}
static int yylex ( YYSTYPE lval,
const char **  pexp 
) [static]

Definition at line 1344 of file plural.c.

{
  const char *exp = *pexp;
  int result;

  while (1)
    {
      if (exp[0] == '\0')
       {
         *pexp = exp;
         return YYEOF;
       }

      if (exp[0] != ' ' && exp[0] != '\t')
       break;

      ++exp;
    }

  result = *exp++;
  switch (result)
    {
    case '0': case '1': case '2': case '3': case '4':
    case '5': case '6': case '7': case '8': case '9':
      {
       unsigned long int n = result - '0';
       while (exp[0] >= '0' && exp[0] <= '9')
         {
           n *= 10;
           n += exp[0] - '0';
           ++exp;
         }
       lval->num = n;
       result = NUMBER;
      }
      break;

    case '=':
      if (exp[0] == '=')
       {
         ++exp;
         lval->op = equal;
         result = EQUOP2;
       }
      else
       result = YYERRCODE;
      break;

    case '!':
      if (exp[0] == '=')
       {
         ++exp;
         lval->op = not_equal;
         result = EQUOP2;
       }
      break;

    case '&':
    case '|':
      if (exp[0] == result)
       ++exp;
      else
       result = YYERRCODE;
      break;

    case '<':
      if (exp[0] == '=')
       {
         ++exp;
         lval->op = less_or_equal;
       }
      else
       lval->op = less_than;
      result = CMPOP2;
      break;

    case '>':
      if (exp[0] == '=')
       {
         ++exp;
         lval->op = greater_or_equal;
       }
      else
       lval->op = greater_than;
      result = CMPOP2;
      break;

    case '*':
      lval->op = mult;
      result = MULOP2;
      break;

    case '/':
      lval->op = divide;
      result = MULOP2;
      break;

    case '%':
      lval->op = module;
      result = MULOP2;
      break;

    case '+':
      lval->op = plus;
      result = ADDOP2;
      break;

    case '-':
      lval->op = minus;
      result = ADDOP2;
      break;

    case 'n':
    case '?':
    case ':':
    case '(':
    case ')':
      /* Nothing, just return the character.  */
      break;

    case ';':
    case '\n':
    case '\0':
      /* Be safe and let the user call this function again.  */
      --exp;
      result = YYEOF;
      break;

    default:
      result = YYERRCODE;
#if YYDEBUG != 0
      --exp;
#endif
      break;
    }

  *pexp = exp;

  return result;
}

Definition at line 675 of file plural.c.

{
  /* If reentrant, generate the variables here. */
#if YYPURE
  YY_DECL_VARIABLES
#endif  /* !YYPURE */

  register int yystate;
  register int yyn;
  int yyresult;
  /* Number of tokens to shift before error messages enabled.  */
  int yyerrstatus;
  /* Lookahead token as an internal (translated) token number.  */
  int yychar1 = 0;

  /* Three stacks and their tools:
     `yyss': related to states,
     `yyvs': related to semantic values,
     `yyls': related to locations.

     Refer to the stacks thru separate pointers, to allow yyoverflow
     to reallocate them elsewhere.  */

  /* The state stack. */
  short       yyssa[YYINITDEPTH];
  short *yyss = yyssa;
  register short *yyssp;

  /* The semantic value stack.  */
  YYSTYPE yyvsa[YYINITDEPTH];
  YYSTYPE *yyvs = yyvsa;
  register YYSTYPE *yyvsp;

#if YYLSP_NEEDED
  /* The location stack.  */
  YYLTYPE yylsa[YYINITDEPTH];
  YYLTYPE *yyls = yylsa;
  YYLTYPE *yylsp;
#endif

#if YYLSP_NEEDED
# define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
#else
# define YYPOPSTACK   (yyvsp--, yyssp--)
#endif

  YYSIZE_T yystacksize = YYINITDEPTH;


  /* The variables used to return semantic value and location from the
     action routines.  */
  YYSTYPE yyval;
#if YYLSP_NEEDED
  YYLTYPE yyloc;
#endif

  /* When reducing, the number of symbols on the RHS of the reduced
     rule. */
  int yylen;

  YYDPRINTF ((stderr, "Starting parse\n"));

  yystate = 0;
  yyerrstatus = 0;
  yynerrs = 0;
  yychar = YYEMPTY;         /* Cause a token to be read.  */

  /* Initialize stack pointers.
     Waste one element of value and location stack
     so that they stay on the same level as the state stack.
     The wasted elements are never initialized.  */

  yyssp = yyss;
  yyvsp = yyvs;
#if YYLSP_NEEDED
  yylsp = yyls;
#endif
  goto yysetstate;

/*------------------------------------------------------------.
| yynewstate -- Push a new state, which is found in yystate.  |
`------------------------------------------------------------*/
 yynewstate:
  /* In all cases, when you get here, the value and location stacks
     have just been pushed. so pushing a state here evens the stacks.
     */
  yyssp++;

 yysetstate:
  *yyssp = yystate;

  if (yyssp >= yyss + yystacksize - 1)
    {
      /* Get the current used size of the three stacks, in elements.  */
      YYSIZE_T yysize = yyssp - yyss + 1;

#ifdef yyoverflow
      {
       /* Give user a chance to reallocate the stack. Use copies of
          these so that the &'s don't force the real ones into
          memory.  */
       YYSTYPE *yyvs1 = yyvs;
       short *yyss1 = yyss;

       /* Each stack pointer address is followed by the size of the
          data in use in that stack, in bytes.  */
# if YYLSP_NEEDED
       YYLTYPE *yyls1 = yyls;
       /* This used to be a conditional around just the two extra args,
          but that might be undefined if yyoverflow is a macro.  */
       yyoverflow ("parser stack overflow",
                  &yyss1, yysize * sizeof (*yyssp),
                  &yyvs1, yysize * sizeof (*yyvsp),
                  &yyls1, yysize * sizeof (*yylsp),
                  &yystacksize);
       yyls = yyls1;
# else
       yyoverflow ("parser stack overflow",
                  &yyss1, yysize * sizeof (*yyssp),
                  &yyvs1, yysize * sizeof (*yyvsp),
                  &yystacksize);
# endif
       yyss = yyss1;
       yyvs = yyvs1;
      }
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
      goto yyoverflowlab;
# else
      /* Extend the stack our own way.  */
      if (yystacksize >= YYMAXDEPTH)
       goto yyoverflowlab;
      yystacksize *= 2;
      if (yystacksize > YYMAXDEPTH)
       yystacksize = YYMAXDEPTH;

      {
       short *yyss1 = yyss;
       union yyalloc *yyptr =
         (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
       if (! yyptr)
         goto yyoverflowlab;
       YYSTACK_RELOCATE (yyss);
       YYSTACK_RELOCATE (yyvs);
# if YYLSP_NEEDED
       YYSTACK_RELOCATE (yyls);
# endif
# undef YYSTACK_RELOCATE
       if (yyss1 != yyssa)
         YYSTACK_FREE (yyss1);
      }
# endif
#endif /* no yyoverflow */

      yyssp = yyss + yysize - 1;
      yyvsp = yyvs + yysize - 1;
#if YYLSP_NEEDED
      yylsp = yyls + yysize - 1;
#endif

      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
                (unsigned long int) yystacksize));

      if (yyssp >= yyss + yystacksize - 1)
       YYABORT;
    }

  YYDPRINTF ((stderr, "Entering state %d\n", yystate));

  goto yybackup;


/*-----------.
| yybackup.  |
`-----------*/
yybackup:

/* Do appropriate processing given the current state.  */
/* Read a lookahead token if we need one and don't already have one.  */
/* yyresume: */

  /* First try to decide what to do without reference to lookahead token.  */

  yyn = yypact[yystate];
  if (yyn == YYFLAG)
    goto yydefault;

  /* Not known => get a lookahead token if don't already have one.  */

  /* yychar is either YYEMPTY or YYEOF
     or a valid token in external form.  */

  if (yychar == YYEMPTY)
    {
      YYDPRINTF ((stderr, "Reading a token: "));
      yychar = YYLEX;
    }

  /* Convert token to internal form (in yychar1) for indexing tables with */

  if (yychar <= 0)          /* This means end of input. */
    {
      yychar1 = 0;
      yychar = YYEOF;              /* Don't call YYLEX any more */

      YYDPRINTF ((stderr, "Now at end of input.\n"));
    }
  else
    {
      yychar1 = YYTRANSLATE (yychar);

#if YYDEBUG
     /* We have to keep this `#if YYDEBUG', since we use variables
       which are defined only if `YYDEBUG' is set.  */
      if (yydebug)
       {
         YYFPRINTF (stderr, "Next token is %d (%s",
                   yychar, yytname[yychar1]);
         /* Give the individual parser a way to print the precise
            meaning of a token, for further debugging info.  */
# ifdef YYPRINT
         YYPRINT (stderr, yychar, yylval);
# endif
         YYFPRINTF (stderr, ")\n");
       }
#endif
    }

  yyn += yychar1;
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
    goto yydefault;

  yyn = yytable[yyn];

  /* yyn is what to do for this token type in this state.
     Negative => reduce, -yyn is rule number.
     Positive => shift, yyn is new state.
       New state is final state => don't bother to shift,
       just return success.
     0, or most negative number => error.  */

  if (yyn < 0)
    {
      if (yyn == YYFLAG)
       goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }
  else if (yyn == 0)
    goto yyerrlab;

  if (yyn == YYFINAL)
    YYACCEPT;

  /* Shift the lookahead token.  */
  YYDPRINTF ((stderr, "Shifting token %d (%s), ",
             yychar, yytname[yychar1]));

  /* Discard the token being shifted unless it is eof.  */
  if (yychar != YYEOF)
    yychar = YYEMPTY;

  *++yyvsp = yylval;
#if YYLSP_NEEDED
  *++yylsp = yylloc;
#endif

  /* Count tokens shifted since error; after three, turn off error
     status.  */
  if (yyerrstatus)
    yyerrstatus--;

  yystate = yyn;
  goto yynewstate;


/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state.  |
`-----------------------------------------------------------*/
yydefault:
  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;
  goto yyreduce;


/*-----------------------------.
| yyreduce -- Do a reduction.  |
`-----------------------------*/
yyreduce:
  /* yyn is the number of a rule to reduce with.  */
  yylen = yyr2[yyn];

  /* If YYLEN is nonzero, implement the default value of the action:
     `$$ = $1'.

     Otherwise, the following line sets YYVAL to the semantic value of
     the lookahead token.  This behavior is undocumented and Bison
     users should not rely upon it.  Assigning to YYVAL
     unconditionally makes the parser a bit smaller, and it avoids a
     GCC warning that YYVAL may be used uninitialized.  */
  yyval = yyvsp[1-yylen];

#if YYLSP_NEEDED
  /* Similarly for the default location.  Let the user run additional
     commands if for instance locations are ranges.  */
  yyloc = yylsp[1-yylen];
  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
#endif

#if YYDEBUG
  /* We have to keep this `#if YYDEBUG', since we use variables which
     are defined only if `YYDEBUG' is set.  */
  if (yydebug)
    {
      int yyi;

      YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
               yyn, yyrline[yyn]);

      /* Print the symbols being reduced, and their result.  */
      for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
       YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
      YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
    }
#endif

  switch (yyn) {

case 1:
#line 151 "plural.y"
{
           if (yyvsp[0].exp == NULL)
             YYABORT;
           ((struct parse_args *) arg)->res = yyvsp[0].exp;
         }
    break;
case 2:
#line 159 "plural.y"
{
           yyval.exp = new_exp_3 (qmop, yyvsp[-4].exp, yyvsp[-2].exp, yyvsp[0].exp);
         }
    break;
case 3:
#line 163 "plural.y"
{
           yyval.exp = new_exp_2 (lor, yyvsp[-2].exp, yyvsp[0].exp);
         }
    break;
case 4:
#line 167 "plural.y"
{
           yyval.exp = new_exp_2 (land, yyvsp[-2].exp, yyvsp[0].exp);
         }
    break;
case 5:
#line 171 "plural.y"
{
           yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
         }
    break;
case 6:
#line 175 "plural.y"
{
           yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
         }
    break;
case 7:
#line 179 "plural.y"
{
           yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
         }
    break;
case 8:
#line 183 "plural.y"
{
           yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
         }
    break;
case 9:
#line 187 "plural.y"
{
           yyval.exp = new_exp_1 (lnot, yyvsp[0].exp);
         }
    break;
case 10:
#line 191 "plural.y"
{
           yyval.exp = new_exp_0 (var);
         }
    break;
case 11:
#line 195 "plural.y"
{
           if ((yyval.exp = new_exp_0 (num)) != NULL)
             yyval.exp->val.num = yyvsp[0].num;
         }
    break;
case 12:
#line 200 "plural.y"
{
           yyval.exp = yyvsp[-1].exp;
         }
    break;
}

#line 705 "/usr/local/share/bison/bison.simple"


  yyvsp -= yylen;
  yyssp -= yylen;
#if YYLSP_NEEDED
  yylsp -= yylen;
#endif

#if YYDEBUG
  if (yydebug)
    {
      short *yyssp1 = yyss - 1;
      YYFPRINTF (stderr, "state stack now");
      while (yyssp1 != yyssp)
       YYFPRINTF (stderr, " %d", *++yyssp1);
      YYFPRINTF (stderr, "\n");
    }
#endif

  *++yyvsp = yyval;
#if YYLSP_NEEDED
  *++yylsp = yyloc;
#endif

  /* Now `shift' the result of the reduction.  Determine what state
     that goes to, based on the state we popped back to and the rule
     number reduced by.  */

  yyn = yyr1[yyn];

  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
    yystate = yytable[yystate];
  else
    yystate = yydefgoto[yyn - YYNTBASE];

  goto yynewstate;


/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
  /* If not already recovering from an error, report this error.  */
  if (!yyerrstatus)
    {
      ++yynerrs;

#ifdef YYERROR_VERBOSE
      yyn = yypact[yystate];

      if (yyn > YYFLAG && yyn < YYLAST)
       {
         YYSIZE_T yysize = 0;
         char *yymsg;
         int yyx, yycount;

         yycount = 0;
         /* Start YYX at -YYN if negative to avoid negative indexes in
            YYCHECK.  */
         for (yyx = yyn < 0 ? -yyn : 0;
              yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
           if (yycheck[yyx + yyn] == yyx)
             yysize += yystrlen (yytname[yyx]) + 15, yycount++;
         yysize += yystrlen ("parse error, unexpected ") + 1;
         yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
         yymsg = (char *) YYSTACK_ALLOC (yysize);
         if (yymsg != 0)
           {
             char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
             yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);

             if (yycount < 5)
              {
                yycount = 0;
                for (yyx = yyn < 0 ? -yyn : 0;
                     yyx < (int) (sizeof (yytname) / sizeof (char *));
                     yyx++)
                  if (yycheck[yyx + yyn] == yyx)
                    {
                     const char *yyq = ! yycount ? ", expecting " : " or ";
                     yyp = yystpcpy (yyp, yyq);
                     yyp = yystpcpy (yyp, yytname[yyx]);
                     yycount++;
                    }
              }
             yyerror (yymsg);
             YYSTACK_FREE (yymsg);
           }
         else
           yyerror ("parse error; also virtual memory exhausted");
       }
      else
#endif /* defined (YYERROR_VERBOSE) */
       yyerror ("parse error");
    }
  goto yyerrlab1;


/*--------------------------------------------------.
| yyerrlab1 -- error raised explicitly by an action |
`--------------------------------------------------*/
yyerrlab1:
  if (yyerrstatus == 3)
    {
      /* If just tried and failed to reuse lookahead token after an
        error, discard it.  */

      /* return failure if at end of input */
      if (yychar == YYEOF)
       YYABORT;
      YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
                yychar, yytname[yychar1]));
      yychar = YYEMPTY;
    }

  /* Else will try to reuse lookahead token after shifting the error
     token.  */

  yyerrstatus = 3;          /* Each real token shifted decrements this */

  goto yyerrhandle;


/*-------------------------------------------------------------------.
| yyerrdefault -- current state does not do anything special for the |
| error token.                                                       |
`-------------------------------------------------------------------*/
yyerrdefault:
#if 0
  /* This is wrong; only states that explicitly want error tokens
     should shift them.  */

  /* If its default is to accept any token, ok.  Otherwise pop it.  */
  yyn = yydefact[yystate];
  if (yyn)
    goto yydefault;
#endif


/*---------------------------------------------------------------.
| yyerrpop -- pop the current state because it cannot handle the |
| error token                                                    |
`---------------------------------------------------------------*/
yyerrpop:
  if (yyssp == yyss)
    YYABORT;
  yyvsp--;
  yystate = *--yyssp;
#if YYLSP_NEEDED
  yylsp--;
#endif

#if YYDEBUG
  if (yydebug)
    {
      short *yyssp1 = yyss - 1;
      YYFPRINTF (stderr, "Error: state stack now");
      while (yyssp1 != yyssp)
       YYFPRINTF (stderr, " %d", *++yyssp1);
      YYFPRINTF (stderr, "\n");
    }
#endif

/*--------------.
| yyerrhandle.  |
`--------------*/
yyerrhandle:
  yyn = yypact[yystate];
  if (yyn == YYFLAG)
    goto yyerrdefault;

  yyn += YYTERROR;
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
    goto yyerrdefault;

  yyn = yytable[yyn];
  if (yyn < 0)
    {
      if (yyn == YYFLAG)
       goto yyerrpop;
      yyn = -yyn;
      goto yyreduce;
    }
  else if (yyn == 0)
    goto yyerrpop;

  if (yyn == YYFINAL)
    YYACCEPT;

  YYDPRINTF ((stderr, "Shifting error token, "));

  *++yyvsp = yylval;
#if YYLSP_NEEDED
  *++yylsp = yylloc;
#endif

  yystate = yyn;
  goto yynewstate;


/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here.  |
`-------------------------------------*/
yyacceptlab:
  yyresult = 0;
  goto yyreturn;

/*-----------------------------------.
| yyabortlab -- YYABORT comes here.  |
`-----------------------------------*/
yyabortlab:
  yyresult = 1;
  goto yyreturn;

/*---------------------------------------------.
| yyoverflowab -- parser overflow comes here.  |
`---------------------------------------------*/
yyoverflowlab:
  yyerror ("parser stack overflow");
  yyresult = 2;
  /* Fall through.  */

yyreturn:
#ifndef yyoverflow
  if (yyss != yyssa)
    YYSTACK_FREE (yyss);
#endif
  return yyresult;
}

Here is the call graph for this function:


Variable Documentation

const short yycheck[] [static]
Initial value:
{
       1,    10,    11,     4,    13,    14,     9,     8,     9,    10,
      11,    12,    13,    14,     3,     4,     5,     6,     7,     8,
       9,     0,    23,     7,     8,     9,    15,     3,     4,     5,
       6,     7,     8,     9,     8,     9,    12,     3,     4,     5,
       6,     7,     8,     9,     5,     6,     7,     8,     9,     6,
       7,     8,     9,     0
}

Definition at line 287 of file plural.c.

const short yydefact[] [static]
Initial value:
{
       0,     0,    11,    10,     0,     1,     9,     0,     0,     0,
       0,     0,     0,     0,     0,    12,     0,     3,     4,     5,
       6,     7,     8,     0,     2,     0,     0,     0
}

Definition at line 249 of file plural.c.

const short yydefgoto[] [static]
Initial value:
{
      25,     5
}

Definition at line 256 of file plural.c.

const short yypact[] [static]
Initial value:
{
      -9,    -9,-32768,-32768,    -9,    34,-32768,    11,    -9,    -9,
      -9,    -9,    -9,    -9,    -9,-32768,    24,    39,    43,    16,
      26,    -3,-32768,    -9,    34,    21,    53,-32768
}

Definition at line 261 of file plural.c.

const short yypgoto[] [static]
Initial value:
{
  -32768,    -1
}

Definition at line 268 of file plural.c.

const short yyr1[] [static]
Initial value:
{
       0,    16,    17,    17,    17,    17,    17,    17,    17,    17,
      17,    17,    17
}

Definition at line 233 of file plural.c.

const short yyr2[] [static]
Initial value:
{
       0,     1,     5,     3,     3,     3,     3,     3,     3,     2,
       1,     1,     3
}

Definition at line 240 of file plural.c.

const short yytable[] [static]
Initial value:
{
       6,     1,     2,     7,     3,     4,    14,    16,    17,    18,
      19,    20,    21,    22,     8,     9,    10,    11,    12,    13,
      14,    26,    24,    12,    13,    14,    15,     8,     9,    10,
      11,    12,    13,    14,    13,    14,    23,     8,     9,    10,
      11,    12,    13,    14,    10,    11,    12,    13,    14,    11,
      12,    13,    14,    27
}

Definition at line 277 of file plural.c.

const char yytranslate[] [static]
Initial value:
{
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,    10,     2,     2,     2,     2,     5,     2,
      14,    15,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,    12,     2,
       2,     2,     2,     3,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
      13,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     4,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     1,     6,     7,     8,
       9,    11
}

Definition at line 163 of file plural.c.