Back to index

courier  0.68.2
Classes | Defines | Typedefs | Enumerations | Functions | Variables
plural.c File Reference
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include "plural-exp.h"

Go to the source code of this file.

Classes

union  YYSTYPE
union  yyalloc

Defines

#define YYBISON   1
#define YYBISON_VERSION   "2.3a"
#define YYSKELETON_NAME   "yacc.c"
#define YYPURE   1
#define YYLSP_NEEDED   0
#define yyparse   __gettextparse
#define yylex   __gettextlex
#define yyerror   __gettexterror
#define yylval   __gettextlval
#define yychar   __gettextchar
#define yydebug   __gettextdebug
#define yynerrs   __gettextnerrs
#define __gettextparse   PLURAL_PARSE
#define YYLEX_PARAM   &((struct parse_args *) arg)->cp
#define YYPARSE_PARAM   arg
#define YYDEBUG   0
#define YYERROR_VERBOSE   0
#define YYTOKEN_TABLE   0
#define YYTOKENTYPE
#define EQUOP2   258
#define CMPOP2   259
#define ADDOP2   260
#define MULOP2   261
#define NUMBER   262
#define YYSTYPE_IS_TRIVIAL   1
#define yystype   YYSTYPE /* obsolescent; will be withdrawn */
#define YYSTYPE_IS_DECLARED   1
#define YYSIZE_T   unsigned int
#define YYSIZE_MAXIMUM   ((YYSIZE_T) -1)
#define YY_(msgid)   msgid
#define YYUSE(e)   ((void) (e))
#define YYID(n)   (n)
#define YYSTACK_ALLOC   YYMALLOC
#define YYSTACK_FREE   YYFREE
#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM
#define YYMALLOC   malloc
#define YYFREE   free
#define YYSTACK_GAP_MAXIMUM   (sizeof (union yyalloc) - 1)
#define YYSTACK_BYTES(N)
#define YYCOPY(To, From, Count)
#define YYSTACK_RELOCATE(Stack)
#define YYFINAL   9
#define YYLAST   54
#define YYNTOKENS   16
#define YYNNTS   3
#define YYNRULES   13
#define YYNSTATES   27
#define YYUNDEFTOK   2
#define YYMAXUTOK   262
#define YYTRANSLATE(YYX)   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
#define YYPACT_NINF   -10
#define YYTABLE_NINF   -1
#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 yyerrorlab
#define YYFAIL   goto yyerrlab
#define YYRECOVERING()   (!!yyerrstatus)
#define YYBACKUP(Token, Value)
#define YYTERROR   1
#define YYERRCODE   256
#define YYRHSLOC(Rhs, K)   ((Rhs)[K])
#define YYLLOC_DEFAULT(Current, Rhs, N)
#define YY_LOCATION_PRINT(File, Loc)   ((void) 0)
#define YYLEX   yylex (&yylval, YYLEX_PARAM)
#define YYDPRINTF(Args)
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
#define YY_STACK_PRINT(Bottom, Top)
#define YY_REDUCE_PRINT(Rule)
#define YYINITDEPTH   200
#define YYMAXDEPTH   10000
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))

Typedefs

typedef union YYSTYPE YYSTYPE
typedef unsigned char yytype_uint8
typedef short int yytype_int8
typedef unsigned short int yytype_uint16
typedef short int yytype_int16

Enumerations

enum  yytokentype {
  EQUOP2 = 258, CMPOP2 = 259, ADDOP2 = 260, MULOP2 = 261,
  NUMBER = 262
}

Functions

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

Variables

static const yytype_uint8 yytranslate []
static const yytype_uint8 yyr1 []
static const yytype_uint8 yyr2 []
static const yytype_uint8 yydefact []
static const yytype_int8 yydefgoto []
static const yytype_int8 yypact []
static const yytype_int8 yypgoto []
static const yytype_uint8 yytable []
static const yytype_int8 yycheck []
static const yytype_uint8 yystos []

Class Documentation

union YYSTYPE

Definition at line 165 of file plural.c.

Collaboration diagram for YYSTYPE:
Class Members
enum expression_operator
struct expression *
exp
unsigned long int num
union yyalloc

Definition at line 425 of file plural.c.

Collaboration diagram for yyalloc:
Class Members
yytype_int16 yyss
YYSTYPE yyvs

Define Documentation

Definition at line 115 of file plural.c.

#define ADDOP2   260

Definition at line 157 of file plural.c.

#define CMPOP2   259

Definition at line 156 of file plural.c.

#define EQUOP2   258

Definition at line 155 of file plural.c.

#define MULOP2   261

Definition at line 158 of file plural.c.

#define NUMBER   262

Definition at line 159 of file plural.c.

#define YY_ (   msgid)    msgid

Definition at line 321 of file plural.c.

#define YY_LOCATION_PRINT (   File,
  Loc 
)    ((void) 0)

Definition at line 734 of file plural.c.

#define YY_REDUCE_PRINT (   Rule)

Definition at line 907 of file plural.c.

#define YY_STACK_PRINT (   Bottom,
  Top 
)

Definition at line 906 of file plural.c.

#define YY_SYMBOL_PRINT (   Title,
  Type,
  Value,
  Location 
)

Definition at line 905 of file plural.c.

#define YYABORT   goto yyabortlab

Definition at line 663 of file plural.c.

#define YYACCEPT   goto yyacceptlab

Definition at line 662 of file plural.c.

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

Definition at line 675 of file plural.c.

#define YYBISON   1

Definition at line 47 of file plural.c.

#define YYBISON_VERSION   "2.3a"

Definition at line 50 of file plural.c.

#define yychar   __gettextchar

Definition at line 66 of file plural.c.

#define yyclearin   (yychar = YYEMPTY)

Definition at line 658 of file plural.c.

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

Definition at line 447 of file plural.c.

#define yydebug   __gettextdebug

Definition at line 67 of file plural.c.

#define YYDEBUG   0

Definition at line 124 of file plural.c.

#define YYDPRINTF (   Args)

Definition at line 904 of file plural.c.

#define YYEMPTY   (-2)

Definition at line 659 of file plural.c.

#define YYEOF   0

Definition at line 660 of file plural.c.

#define YYERRCODE   256

Definition at line 694 of file plural.c.

#define yyerrok   (yyerrstatus = 0)

Definition at line 657 of file plural.c.

#define yyerror   __gettexterror

Definition at line 64 of file plural.c.

#define YYERROR   goto yyerrorlab

Definition at line 664 of file plural.c.

#define YYERROR_VERBOSE   0

Definition at line 132 of file plural.c.

#define YYFAIL   goto yyerrlab

Definition at line 671 of file plural.c.

#define YYFINAL   9

Definition at line 477 of file plural.c.

#define YYFREE   free

Definition at line 410 of file plural.c.

#define YYID (   n)    (n)

Definition at line 334 of file plural.c.

#define YYINITDEPTH   200

Definition at line 913 of file plural.c.

#define YYLAST   54

Definition at line 479 of file plural.c.

#define yylex   __gettextlex

Definition at line 63 of file plural.c.

#define YYLEX   yylex (&yylval, YYLEX_PARAM)

Definition at line 742 of file plural.c.

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

Definition at line 118 of file plural.c.

#define YYLLOC_DEFAULT (   Current,
  Rhs,
 
)
Value:
do                                                             \
      if (YYID (N))                                                    \
       {                                                       \
         (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;       \
         (Current).first_column = YYRHSLOC (Rhs, 1).first_column;     \
         (Current).last_line    = YYRHSLOC (Rhs, N).last_line;        \
         (Current).last_column  = YYRHSLOC (Rhs, N).last_column;      \
       }                                                       \
      else                                                     \
       {                                                       \
         (Current).first_line   = (Current).last_line   =             \
           YYRHSLOC (Rhs, 0).last_line;                        \
         (Current).first_column = (Current).last_column =             \
           YYRHSLOC (Rhs, 0).last_column;                      \
       }                                                       \
    while (YYID (0))

Definition at line 703 of file plural.c.

#define YYLSP_NEEDED   0

Definition at line 59 of file plural.c.

#define yylval   __gettextlval

Definition at line 65 of file plural.c.

#define YYMALLOC   malloc

Definition at line 403 of file plural.c.

#define YYMAXDEPTH   10000

Definition at line 924 of file plural.c.

#define YYMAXUTOK   262

Definition at line 492 of file plural.c.

#define yynerrs   __gettextnerrs

Definition at line 68 of file plural.c.

#define YYNNTS   3

Definition at line 484 of file plural.c.

#define YYNRULES   13

Definition at line 486 of file plural.c.

#define YYNSTATES   27

Definition at line 488 of file plural.c.

#define YYNTOKENS   16

Definition at line 482 of file plural.c.

#define YYPACT_NINF   -10

Definition at line 609 of file plural.c.

#define yyparse   __gettextparse

Definition at line 62 of file plural.c.

#define YYPARSE_PARAM   arg

Definition at line 119 of file plural.c.

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

Definition at line 56 of file plural.c.

#define YYRECOVERING ( )    (!!yyerrstatus)

Definition at line 673 of file plural.c.

#define YYRHSLOC (   Rhs,
  K 
)    ((Rhs)[K])

Definition at line 701 of file plural.c.

#define YYSIZE_MAXIMUM   ((YYSIZE_T) -1)

Definition at line 311 of file plural.c.

#define YYSIZE_T   unsigned int

Definition at line 307 of file plural.c.

#define YYSKELETON_NAME   "yacc.c"

Definition at line 53 of file plural.c.

#define YYSTACK_ALLOC   YYMALLOC

Definition at line 389 of file plural.c.

Definition at line 392 of file plural.c.

#define YYSTACK_BYTES (   N)
Value:
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
      + YYSTACK_GAP_MAXIMUM)

Definition at line 436 of file plural.c.

#define YYSTACK_FREE   YYFREE

Definition at line 390 of file plural.c.

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

Definition at line 432 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_MAXIMUM; \
       yyptr += yynewbytes / sizeof (*yyptr);                         \
      }                                                               \
    while (YYID (0))

Definition at line 463 of file plural.c.

#define yystype   YYSTYPE /* obsolescent; will be withdrawn */

Definition at line 177 of file plural.c.

#define YYSTYPE_IS_DECLARED   1

Definition at line 178 of file plural.c.

#define YYSTYPE_IS_TRIVIAL   1

Definition at line 176 of file plural.c.

#define YYTABLE_NINF   -1

Definition at line 627 of file plural.c.

#define YYTERROR   1

Definition at line 693 of file plural.c.

#define YYTOKEN_TABLE   0

Definition at line 137 of file plural.c.

#define YYTOKENTYPE

Definition at line 143 of file plural.c.

#define YYTRANSLATE (   YYX)    ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)

Definition at line 494 of file plural.c.

#define YYUNDEFTOK   2

Definition at line 491 of file plural.c.

#define YYUSE (   e)    ((void) (e))

Definition at line 327 of file plural.c.


Typedef Documentation

typedef union YYSTYPE YYSTYPE
typedef short int yytype_int16

Definition at line 294 of file plural.c.

typedef short int yytype_int8

Definition at line 282 of file plural.c.

typedef unsigned short int yytype_uint16

Definition at line 288 of file plural.c.

typedef unsigned char yytype_uint8

Definition at line 273 of file plural.c.


Enumeration Type Documentation

Enumerator:
EQUOP2 
CMPOP2 
ADDOP2 
MULOP2 
NUMBER 

Definition at line 146 of file plural.c.

                    {
     EQUOP2 = 258,
     CMPOP2 = 259,
     ADDOP2 = 260,
     MULOP2 = 261,
     NUMBER = 262
   };

Function Documentation

Definition at line 1788 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);
}
static struct expression* new_exp ( int  nargs,
enum expression_operator  op,
struct expression *const *  args 
) [static, read]

Definition at line 195 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 expression_operator  op) [static, read]

Definition at line 225 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 expression_operator  op,
struct expression right 
) [static, read]

Definition at line 231 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 expression_operator  op,
struct expression left,
struct expression right 
) [static, read]

Definition at line 240 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 expression_operator  op,
struct expression bexp,
struct expression tbranch,
struct expression fbranch 
) [static, read]

Definition at line 251 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 yydestruct ( char *  yymsg,
int  yytype,
YYSTYPE yyvaluep 
) const [static]

Definition at line 1151 of file plural.c.

{
  YYUSE (yyvaluep);

  if (!yymsg)
    yymsg = "Deleting";
  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);

  switch (yytype)
    {

      default:
       break;
    }
}

Here is the caller graph for this function:

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

Definition at line 1957 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 1814 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;
}

Here is the call graph for this function:

int yyparse ( )
int yyparse ( void *  YYPARSE_PARAM)

Definition at line 1204 of file plural.c.

{
  /* The lookahead symbol.  */
int yychar;

/* The semantic value of the lookahead symbol.  */
YYSTYPE yylval;

/* Number of syntax errors so far.  */
int yynerrs;

  int yystate;
  int yyn;
  int yyresult;
  /* Number of tokens to shift before error messages enabled.  */
  int yyerrstatus;
  /* Lookahead token as an internal (translated) token number.  */
  int yytoken = 0;
#if YYERROR_VERBOSE
  /* Buffer for error messages, and its allocated size.  */
  char yymsgbuf[128];
  char *yymsg = yymsgbuf;
  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif

  /* 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.  */
  yytype_int16 yyssa[YYINITDEPTH];
  yytype_int16 *yyss = yyssa;
  yytype_int16 *yyssp;

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



#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))

  YYSIZE_T yystacksize = YYINITDEPTH;

  /* The variables used to return semantic value and location from the
     action routines.  */
  YYSTYPE yyval;


  /* The number of symbols on the RHS of the reduced rule.
     Keep to zero when no symbol should be popped.  */
  int yylen = 0;

  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;

  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 (yyss + yystacksize - 1 <= yyssp)
    {
      /* 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;
       yytype_int16 *yyss1 = yyss;


       /* Each stack pointer address is followed by the size of the
          data in use in that stack, in bytes.  This used to be a
          conditional around just the two extra args, but that might
          be undefined if yyoverflow is a macro.  */
       yyoverflow (YY_("memory exhausted"),
                  &yyss1, yysize * sizeof (*yyssp),
                  &yyvs1, yysize * sizeof (*yyvsp),

                  &yystacksize);

       yyss = yyss1;
       yyvs = yyvs1;
      }
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
      goto yyexhaustedlab;
# else
      /* Extend the stack our own way.  */
      if (YYMAXDEPTH <= yystacksize)
       goto yyexhaustedlab;
      yystacksize *= 2;
      if (YYMAXDEPTH < yystacksize)
       yystacksize = YYMAXDEPTH;

      {
       yytype_int16 *yyss1 = yyss;
       union yyalloc *yyptr =
         (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
       if (! yyptr)
         goto yyexhaustedlab;
       YYSTACK_RELOCATE (yyss);
       YYSTACK_RELOCATE (yyvs);

#  undef YYSTACK_RELOCATE
       if (yyss1 != yyssa)
         YYSTACK_FREE (yyss1);
      }
# endif
#endif /* no yyoverflow */

      yyssp = yyss + yysize - 1;
      yyvsp = yyvs + yysize - 1;


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

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

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

  if (yystate == YYFINAL)
    YYACCEPT;

  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.  */

  /* First try to decide what to do without reference to lookahead token.  */
  yyn = yypact[yystate];
  if (yyn == YYPACT_NINF)
    goto yydefault;

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

  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
  if (yychar == YYEMPTY)
    {
      YYDPRINTF ((stderr, "Reading a token: "));
      yychar = YYLEX;
    }

  if (yychar <= YYEOF)
    {
      yychar = yytoken = YYEOF;
      YYDPRINTF ((stderr, "Now at end of input.\n"));
    }
  else
    {
      yytoken = YYTRANSLATE (yychar);
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
    }

  /* If the proper action on seeing token YYTOKEN is to reduce or to
     detect an error, take that action.  */
  yyn += yytoken;
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
    goto yydefault;
  yyn = yytable[yyn];
  if (yyn <= 0)
    {
      if (yyn == 0 || yyn == YYTABLE_NINF)
       goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }

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

  /* Shift the lookahead token.  */
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);

  /* Discard the shifted token.  */
  yychar = YYEMPTY;

  yystate = yyn;
  *++yyvsp = yylval;

  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 garbage.
     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];


  YY_REDUCE_PRINT (yyn);
  switch (yyn)
    {
        case 2:
/* Line 1269 of yacc.c.  */
#line 155 "plural.y"
    {
           if ((yyvsp[(1) - (1)].exp) == NULL)
             YYABORT;
           ((struct parse_args *) arg)->res = (yyvsp[(1) - (1)].exp);
         }
    break;

  case 3:
/* Line 1269 of yacc.c.  */
#line 163 "plural.y"
    {
           (yyval.exp) = new_exp_3 (qmop, (yyvsp[(1) - (5)].exp), (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].exp));
         }
    break;

  case 4:
/* Line 1269 of yacc.c.  */
#line 167 "plural.y"
    {
           (yyval.exp) = new_exp_2 (lor, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
         }
    break;

  case 5:
/* Line 1269 of yacc.c.  */
#line 171 "plural.y"
    {
           (yyval.exp) = new_exp_2 (land, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
         }
    break;

  case 6:
/* Line 1269 of yacc.c.  */
#line 175 "plural.y"
    {
           (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
         }
    break;

  case 7:
/* Line 1269 of yacc.c.  */
#line 179 "plural.y"
    {
           (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
         }
    break;

  case 8:
/* Line 1269 of yacc.c.  */
#line 183 "plural.y"
    {
           (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
         }
    break;

  case 9:
/* Line 1269 of yacc.c.  */
#line 187 "plural.y"
    {
           (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
         }
    break;

  case 10:
/* Line 1269 of yacc.c.  */
#line 191 "plural.y"
    {
           (yyval.exp) = new_exp_1 (lnot, (yyvsp[(2) - (2)].exp));
         }
    break;

  case 11:
/* Line 1269 of yacc.c.  */
#line 195 "plural.y"
    {
           (yyval.exp) = new_exp_0 (var);
         }
    break;

  case 12:
/* Line 1269 of yacc.c.  */
#line 199 "plural.y"
    {
           if (((yyval.exp) = new_exp_0 (num)) != NULL)
             (yyval.exp)->val.num = (yyvsp[(1) - (1)].num);
         }
    break;

  case 13:
/* Line 1269 of yacc.c.  */
#line 204 "plural.y"
    {
           (yyval.exp) = (yyvsp[(2) - (3)].exp);
         }
    break;


/* Line 1269 of yacc.c.  */
#line 1572 "plural.c"
      default: break;
    }
  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);

  YYPOPSTACK (yylen);
  yylen = 0;
  YY_STACK_PRINT (yyss, yyssp);

  *++yyvsp = yyval;


  /* 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 - YYNTOKENS] + *yyssp;
  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
    yystate = yytable[yystate];
  else
    yystate = yydefgoto[yyn - YYNTOKENS];

  goto yynewstate;


/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
  /* If not already recovering from an error, report this error.  */
  if (!yyerrstatus)
    {
      ++yynerrs;
#if ! YYERROR_VERBOSE
      yyerror (YY_("syntax error"));
#else
      {
       YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
       if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
         {
           YYSIZE_T yyalloc = 2 * yysize;
           if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
             yyalloc = YYSTACK_ALLOC_MAXIMUM;
           if (yymsg != yymsgbuf)
             YYSTACK_FREE (yymsg);
           yymsg = (char *) YYSTACK_ALLOC (yyalloc);
           if (yymsg)
             yymsg_alloc = yyalloc;
           else
             {
              yymsg = yymsgbuf;
              yymsg_alloc = sizeof yymsgbuf;
             }
         }

       if (0 < yysize && yysize <= yymsg_alloc)
         {
           (void) yysyntax_error (yymsg, yystate, yychar);
           yyerror (yymsg);
         }
       else
         {
           yyerror (YY_("syntax error"));
           if (yysize != 0)
             goto yyexhaustedlab;
         }
      }
#endif
    }



  if (yyerrstatus == 3)
    {
      /* If just tried and failed to reuse lookahead token after an
        error, discard it.  */

      if (yychar <= YYEOF)
       {
         /* Return failure if at end of input.  */
         if (yychar == YYEOF)
           YYABORT;
       }
      else
       {
         yydestruct ("Error: discarding",
                    yytoken, &yylval);
         yychar = YYEMPTY;
       }
    }

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


/*---------------------------------------------------.
| yyerrorlab -- error raised explicitly by YYERROR.  |
`---------------------------------------------------*/
yyerrorlab:

  /* Pacify compilers like GCC when the user code never invokes
     YYERROR and the label yyerrorlab therefore never appears in user
     code.  */
  if (/*CONSTCOND*/ 0)
     goto yyerrorlab;

  /* Do not reclaim the symbols of the rule which action triggered
     this YYERROR.  */
  YYPOPSTACK (yylen);
  yylen = 0;
  YY_STACK_PRINT (yyss, yyssp);
  yystate = *yyssp;
  goto yyerrlab1;


/*-------------------------------------------------------------.
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
`-------------------------------------------------------------*/
yyerrlab1:
  yyerrstatus = 3;   /* Each real token shifted decrements this.  */

  for (;;)
    {
      yyn = yypact[yystate];
      if (yyn != YYPACT_NINF)
       {
         yyn += YYTERROR;
         if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
           {
             yyn = yytable[yyn];
             if (0 < yyn)
              break;
           }
       }

      /* Pop the current state because it cannot handle the error token.  */
      if (yyssp == yyss)
       YYABORT;


      yydestruct ("Error: popping",
                yystos[yystate], yyvsp);
      YYPOPSTACK (1);
      yystate = *yyssp;
      YY_STACK_PRINT (yyss, yyssp);
    }

  *++yyvsp = yylval;


  /* Shift the error token.  */
  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);

  yystate = yyn;
  goto yynewstate;


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

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

#ifndef yyoverflow
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here.  |
`-------------------------------------------------*/
yyexhaustedlab:
  yyerror (YY_("memory exhausted"));
  yyresult = 2;
  /* Fall through.  */
#endif

yyreturn:
  if (yychar != YYEMPTY)
     yydestruct ("Cleanup: discarding lookahead",
               yytoken, &yylval);
  /* Do not reclaim the symbols of the rule which action triggered
     this YYABORT or YYACCEPT.  */
  YYPOPSTACK (yylen);
  YY_STACK_PRINT (yyss, yyssp);
  while (yyssp != yyss)
    {
      yydestruct ("Cleanup: popping",
                yystos[*yyssp], yyvsp);
      YYPOPSTACK (1);
    }
#ifndef yyoverflow
  if (yyss != yyssa)
    YYSTACK_FREE (yyss);
#endif
#if YYERROR_VERBOSE
  if (yymsg != yymsgbuf)
    YYSTACK_FREE (yymsg);
#endif
  /* Make sure YYID is used.  */
  return YYID (yyresult);
}

Here is the call graph for this function:


Variable Documentation

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

Definition at line 638 of file plural.c.

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

Definition at line 594 of file plural.c.

const yytype_int8 yydefgoto[] [static]
Initial value:
{
      -1,     5,     6
}

Definition at line 602 of file plural.c.

const yytype_int8 yypact[] [static]
Initial value:
{
      -9,    -9,   -10,   -10,    -9,     8,    36,   -10,    13,   -10,
      -9,    -9,    -9,    -9,    -9,    -9,    -9,   -10,    26,    41,
      45,    18,    -2,    14,   -10,    -9,    36
}

Definition at line 610 of file plural.c.

const yytype_int8 yypgoto[] [static]
Initial value:
{
     -10,   -10,    -1
}

Definition at line 618 of file plural.c.

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

Definition at line 578 of file plural.c.

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

Definition at line 585 of file plural.c.

const yytype_uint8 yystos[] [static]
Initial value:
{
       0,    10,    11,    13,    14,    17,    18,    18,    18,     0,
       3,     4,     5,     6,     7,     8,     9,    15,    18,    18,
      18,    18,    18,    18,    18,    12,    18
}

Definition at line 650 of file plural.c.

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

Definition at line 628 of file plural.c.

const yytype_uint8 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,     2,     6,     7,
       8,     9,    11
}

Definition at line 498 of file plural.c.