Anarres-Mud-Driver

 view release on metacpan or  search on metacpan

Compiler/parser.c  view on Meta::CPAN

#else /* not sparc */
/* We think this test detects Watcom and Microsoft C.  */
/* This used to test MSDOS, but that is a bad idea
   since that symbol is in the user namespace.  */
#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
#if 0 /* No need for malloc.h, which pollutes the namespace;
	 instead, just don't use alloca.  */
#include <malloc.h>
#endif
#else /* not MSDOS, or __TURBOC__ */
#if defined(_AIX)
/* I don't know what this was needed for, but it pollutes the namespace.
   So I turned it off.   rms, 2 May 1997.  */
/* #include <malloc.h>  */
 #pragma alloca
#define YYSTACK_USE_ALLOCA
#else /* not MSDOS, or __TURBOC__, or _AIX */
#if 0
#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
		 and on HPUX 10.  Eventually we can turn this on.  */
#define YYSTACK_USE_ALLOCA
#define alloca __builtin_alloca
#endif /* __hpux */
#endif
#endif /* not _AIX */
#endif /* not MSDOS, or __TURBOC__ */
#endif /* not sparc */
#endif /* not GNU C */
#endif /* alloca not defined */
#endif /* YYSTACK_USE_ALLOCA not defined */

#ifdef YYSTACK_USE_ALLOCA
#define YYSTACK_ALLOC alloca
#else
#define YYSTACK_ALLOC malloc
#endif

/* Note: there must be only one dollar sign in this file.
   It is replaced by the list of actions, each action
   as one case of the switch.  */

#define amd_yyerrok		(amd_yyerrstatus = 0)
#define amd_yyclearin	(amd_yychar = YYEMPTY)
#define YYEMPTY		-2
#define YYEOF		0
#define YYACCEPT	goto amd_yyacceptlab
#define YYABORT 	goto amd_yyabortlab
#define YYERROR		goto amd_yyerrlab1
/* Like YYERROR except do call amd_yyerror.
   This remains here temporarily to ease the
   transition to the new meaning of YYERROR, for GCC.
   Once GCC version 2 has supplanted version 1, this can go.  */
#define YYFAIL		goto amd_yyerrlab
#define YYRECOVERING()  (!!amd_yyerrstatus)
#define YYBACKUP(token, value) \
do								\
  if (amd_yychar == YYEMPTY && amd_yylen == 1)				\
    { amd_yychar = (token), amd_yylval = (value);			\
      amd_yychar1 = YYTRANSLATE (amd_yychar);				\
      YYPOPSTACK;						\
      goto amd_yybackup;						\
    }								\
  else								\
    { amd_yyerror ("syntax error: cannot back up"); YYERROR; }	\
while (0)

#define YYTERROR	1
#define YYERRCODE	256

#ifndef YYPURE
#define YYLEX		amd_yylex()
#endif

#ifdef YYPURE
#ifdef YYLSP_NEEDED
#ifdef YYLEX_PARAM
#define YYLEX		amd_yylex(&amd_yylval, &amd_yylloc, YYLEX_PARAM)
#else
#define YYLEX		amd_yylex(&amd_yylval, &amd_yylloc)
#endif
#else /* not YYLSP_NEEDED */
#ifdef YYLEX_PARAM
#define YYLEX		amd_yylex(&amd_yylval, YYLEX_PARAM)
#else
#define YYLEX		amd_yylex(&amd_yylval)
#endif
#endif /* not YYLSP_NEEDED */
#endif

/* If nonreentrant, generate the variables here */

#ifndef YYPURE

int	amd_yychar;			/*  the lookahead symbol		*/
AMD_YYSTYPE	amd_yylval;			/*  the semantic value of the		*/
				/*  lookahead symbol			*/

#ifdef YYLSP_NEEDED
YYLTYPE amd_yylloc;			/*  location data for the lookahead	*/
				/*  symbol				*/
#endif

int amd_yynerrs;			/*  number of parse errors so far       */
#endif  /* not YYPURE */

#if YYDEBUG != 0
int amd_yydebug;			/*  nonzero means print parse trace	*/
/* Since this is uninitialized, it does not stop multiple parsers
   from coexisting.  */
#endif

/*  YYINITDEPTH indicates the initial size of the parser's stacks	*/

#ifndef	YYINITDEPTH
#define YYINITDEPTH 200
#endif

/*  YYMAXDEPTH is the maximum size the stacks can grow to
    (effective only if the built-in stack extension method is used).  */

#if YYMAXDEPTH == 0

Compiler/parser.c  view on Meta::CPAN

      amd_yyss = amd_yyss1; amd_yyvs = amd_yyvs1;
#ifdef YYLSP_NEEDED
      amd_yyls = amd_yyls1;
#endif
#else /* no amd_yyoverflow */
      /* Extend the stack our own way.  */
      if (amd_yystacksize >= YYMAXDEPTH)
	{
	  amd_yyerror("parser stack overflow");
#ifndef YYSTACK_USE_ALLOCA
	  if (amd_yyfree_stacks)
	    {
	      free (amd_yyss);
	      free (amd_yyvs);
#ifdef YYLSP_NEEDED
	      free (amd_yyls);
#endif
	    }
#endif	    
	  return 2;
	}
      amd_yystacksize *= 2;
      if (amd_yystacksize > YYMAXDEPTH)
	amd_yystacksize = YYMAXDEPTH;
#ifndef YYSTACK_USE_ALLOCA
      amd_yyfree_stacks = 1;
#endif
      amd_yyss = (short *) YYSTACK_ALLOC (amd_yystacksize * sizeof (*amd_yyssp));
      __yy_memcpy ((char *)amd_yyss, (char *)amd_yyss1,
		   size * (unsigned int) sizeof (*amd_yyssp));
      amd_yyvs = (AMD_YYSTYPE *) YYSTACK_ALLOC (amd_yystacksize * sizeof (*amd_yyvsp));
      __yy_memcpy ((char *)amd_yyvs, (char *)amd_yyvs1,
		   size * (unsigned int) sizeof (*amd_yyvsp));
#ifdef YYLSP_NEEDED
      amd_yyls = (YYLTYPE *) YYSTACK_ALLOC (amd_yystacksize * sizeof (*amd_yylsp));
      __yy_memcpy ((char *)amd_yyls, (char *)amd_yyls1,
		   size * (unsigned int) sizeof (*amd_yylsp));
#endif
#endif /* no amd_yyoverflow */

      amd_yyssp = amd_yyss + size - 1;
      amd_yyvsp = amd_yyvs + size - 1;
#ifdef YYLSP_NEEDED
      amd_yylsp = amd_yyls + size - 1;
#endif

#if YYDEBUG != 0
      if (amd_yydebug)
	fprintf(stderr, "Stack size increased to %d\n", amd_yystacksize);
#endif

      if (amd_yyssp >= amd_yyss + amd_yystacksize - 1)
	YYABORT;
    }

#if YYDEBUG != 0
  if (amd_yydebug)
    fprintf(stderr, "Entering state %d\n", amd_yystate);
#endif

  goto amd_yybackup;
 amd_yybackup:

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

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

  amd_yyn = amd_yypact[amd_yystate];
  if (amd_yyn == YYFLAG)
    goto amd_yydefault;

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

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

  if (amd_yychar == YYEMPTY)
    {
#if YYDEBUG != 0
      if (amd_yydebug)
	fprintf(stderr, "Reading a token: ");
#endif
      amd_yychar = YYLEX;
    }

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

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

#if YYDEBUG != 0
      if (amd_yydebug)
	fprintf(stderr, "Now at end of input.\n");
#endif
    }
  else
    {
      amd_yychar1 = YYTRANSLATE(amd_yychar);

#if YYDEBUG != 0
      if (amd_yydebug)
	{
	  fprintf (stderr, "Next token is %d (%s", amd_yychar, amd_yytname[amd_yychar1]);
	  /* Give the individual parser a way to print the precise meaning
	     of a token, for further debugging info.  */
#ifdef YYPRINT
	  YYPRINT (stderr, amd_yychar, amd_yylval);
#endif
	  fprintf (stderr, ")\n");
	}
#endif
    }

  amd_yyn += amd_yychar1;
  if (amd_yyn < 0 || amd_yyn > YYLAST || amd_yycheck[amd_yyn] != amd_yychar1)
    goto amd_yydefault;

  amd_yyn = amd_yytable[amd_yyn];



( run in 1.202 second using v1.01-cache-2.11-cpan-39bf76dae61 )