yacc.h 11.1 KB
Newer Older
moh_lo's avatar
moh_lo committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416
#ifndef YACC_H
#define YACC_H

/************************************************************
yacc.h
This file can be freely modified for the generation of
custom code.

Copyright (c) 1997-99 P. D. Stearns
************************************************************/

#ifdef __cplusplus
extern "C" {
#endif

#define YY_AYACC

#include <stdio.h>
#include <stddef.h>
#include <assert.h>

/* defines */
#include <yytdefs.h>

/* user defines */
#if defined(YYTUDEFS) || defined(YYUDEFS)
#include <yytudefs.h>
#endif

/* modifiers */
#ifndef YYCDECL
#define YYCDECL
#endif
#ifndef YYDCDECL
#define YYDCDECL
#endif
#ifndef YYNEAR
#define YYNEAR
#endif
#ifndef YYFAR
#define YYFAR
#endif
#ifndef YYNEARFAR
#define YYNEARFAR
#endif
#ifndef YYBASED_CODE
#define YYBASED_CODE
#endif

/* function prototypes */
#ifndef YYPROTOTYPE
#if defined(__STDC__) || defined(__cplusplus)
#define YYPROTOTYPE
#endif
#endif

/* qualifiers */
#ifndef YYCONST
#if defined(__STDC__) || defined(__cplusplus)
#define YYCONST const
#else
#define YYCONST
#endif
#endif

/* testing */
#ifdef YYNOPROTOTYPE
#undef YYPROTOTYPE
#endif
#ifdef YYNOCONST
#undef YYCONST
#define YYCONST
#endif

typedef short yystack_t;

/* yyparse return values */
#define YYEXIT_SUCCESS	0
#define YYEXIT_FAILURE	1

/* common tokens */
#define YYTK_ALL		(-1)		/* match all tokens */
#define YYTK_END		0			/* $end token */
#define YYTK_ERROR		256			/* error token */

#ifndef YYCNONTERMGOTO_T
#define YYCNONTERMGOTO_T
typedef short yycnontermgoto_t;
#endif

#ifndef YYCSTATEGOTO_T
#define YYCSTATEGOTO_T
typedef struct yycstategoto {
	short current;					/* current state */
	short next;						/* next state */
} yycstategoto_t;
#endif

#ifndef YYNONTERMGOTO_T
#define YYNONTERMGOTO_T
typedef struct yynontermgoto {
	short base;						/* base */
	short def;						/* default state */
} yynontermgoto_t;
#endif

#ifndef YYSTATEGOTO_T
#define YYSTATEGOTO_T
typedef struct yystategoto {
	short check;					/* check */
	short next;						/* next state */
} yystategoto_t;
#endif

/* action types */
#define YYAT_SHIFT		0			/* shift action */
#define YYAT_REDUCE		1			/* reduce action */
#define YYAT_ERROR		2			/* error */
#define YYAT_ACCEPT		3			/* accept */
#define YYAT_DEFAULT	4			/* default state */

#ifndef YYCSTATEACTION_T
#define YYCSTATEACTION_T
typedef short yycstateaction_t;
#endif

#ifndef YYCTOKENACTION_T
#define YYCTOKENACTION_T
typedef struct yyctokenaction {
	int token;						/* lookahead token */
	unsigned char type;				/* action to perform */
	short sr;						/* state to shift/production to reduce */
} yyctokenaction_t;
#endif

#ifndef YYSTATEACTION_T
#define YYSTATEACTION_T
typedef struct yystateaction {
	short base;						/* base */
	unsigned char lookahead;		/* lookahead needed */
	unsigned char type;				/* action to perform */
	short sr;						/* shift/reduce */
} yystateaction_t;
#endif

#ifndef YYTOKENACTION_T
#define YYTOKENACTION_T
typedef struct yytokenaction {
	short check;					/* check */
	unsigned char type;				/* action type */
	short sr;						/* shift/reduce */
} yytokenaction_t;
#endif

/* states */
#define YYST_ALL		(-1)		/* match all states */
#define YYST_ERROR		(-1)		/* goto error */

#ifndef YYREDUCTION_T
#define YYREDUCTION_T
typedef struct yyreduction {
	short rule;						/* the rhs symbol */
	short length;					/* number of symbols on lhs */
	short action;					/* the user action */
} yyreduction_t;
#endif

typedef short yydestructor_t;

typedef short yytokendest_t;

#ifndef YYCTOKENDEST_T
#define YYCTOKENDEST_T
typedef struct yyctokendest {
	int token;						/* token */
	short action;					/* the user action */
} yyctokendest_t;
#endif

/* debugging */
#ifdef YYDEBUG
#ifndef YYSYMBOL_T
#define YYSYMBOL_T
typedef struct yysymbol {
	YYCONST char *name;				/* symbol name */
	int token;						/* symbol token */
} yysymbol_t;
#endif
#endif

/* general functions */
#ifdef YYPROTOTYPE
int YYCDECL yycparse(void);
void YYCDECL yycwipe(void);
int YYCDECL yycwork(void);
void YYCDECL yydestructpop(int num);
int YYCDECL yyparse(void);
void YYCDECL yyparsecleanup(void);
void YYCDECL yyparseinit(void);
int YYCDECL yysetstacksize(int size);
int YYCDECL yysetup(void);
void YYCDECL yywipe(void);
int YYCDECL yywork(void);
#else
int YYCDECL yycparse();
void YYCDECL yycwipe();
int YYCDECL yycwork();
void YYCDECL yydestructpop();
int YYCDECL yyparse();
void YYCDECL yyparsecleanup();
void YYCDECL yyparseinit();
int YYCDECL yysetstacksize();
int YYCDECL yysetup();
void YYCDECL yywipe();
int YYCDECL yywork();
#endif

/* service functions */
#ifdef YYPROTOTYPE
void YYCDECL yydiscard(int token);
void YYCDECL yyerror(YYCONST char YYFAR *text);
int YYCDECL yygettoken(void);
void YYCDECL yystackoverflow(void);
void YYCDECL yysyntaxerror(void);
#else
void YYCDECL yydiscard();
void YYCDECL yyerror();
int YYCDECL yygettoken();
void YYCDECL yystackoverflow();
void YYCDECL yysyntaxerror();
#endif

/* action functions */
#ifdef YYPROTOTYPE
void YYCDECL yycdestructclearin(void);
void YYCDECL yydestructclearin(void);
void YYCDECL yysetin(int token);
int YYCDECL yyunclearin(void);
#else
void YYCDECL yycdestructclearin();
void YYCDECL yydestructclearin();
void YYCDECL yysetin();
int YYCDECL yyunclearin();
#endif
#define yyabort() yyexit(1)
#define yyaccept() yyexit(0)
#define yyclearin() (yylookahead = 0)
#define yyerrok() yysetskip(0)
#define yyexit(exitcode) (yyexitflg = 1, yyexitcode = (exitcode))
#define yyforceerror() yythrowerror(0)
#define yypopping() yypopflg
#define yyrecovering() (yyskip > 0)
#define yyretire(retirecode) (yyretireflg = 1, yyretirecode = (retirecode))
#define yythrowerror(pop) (yyerrorflg = 1, yyerrorpop = (pop))

/* compatibility */
#ifdef YY_COMPATIBLE
#undef yyclearin
#define yyclearin (yylookahead = 0)
#undef yyerrok
#define yyerrok yysetskip(0)
#endif
#define YYABORT yyexit(1)
#define YYACCEPT yyexit(0)
#define YYERROR yyforceerror()
#define YYRECOVERING yyrecovering()

/* helper functions */
#ifdef YYPROTOTYPE
#ifdef YYDEBUG
void YYCDECL yypop(int num);
void YYCDECL yysetskip(int skip);
#endif
int YYCDECL yypush(yystack_t state);
#else
#ifdef YYDEBUG
void YYCDECL yypop();
void YYCDECL yysetskip();
#endif
int YYCDECL yypush();
#endif
#ifndef yyassert
#define yyassert(expr) assert(expr)
#endif
#define yypeek() (yystackptr[yytop])
#ifndef YYDEBUG
#define yypop(num) (yytop -= (num))
#define yysetskip(skip) (yyskip = (skip))
#endif

/* variables */
extern unsigned char YYNEAR YYDCDECL yylookahead;
extern unsigned char YYNEAR YYDCDECL yystackgrow;
extern unsigned char YYNEAR YYDCDECL yyexitflg;
extern unsigned char YYNEAR YYDCDECL yyretireflg;
extern unsigned char YYNEAR YYDCDECL yyerrorflg;
extern unsigned char YYNEAR YYDCDECL yypopflg;
extern unsigned char YYNEAR YYDCDECL yywipeflg;
extern int YYNEAR YYDCDECL yytop;				/* the current top of the stack */
extern int YYNEAR YYDCDECL yychar;
extern int YYNEAR YYDCDECL yyskip;
extern int YYNEAR YYDCDECL yyerrorcount;
extern FILE YYFAR *YYNEAR YYDCDECL yyparseerr;
extern int YYNEAR YYDCDECL yyexitcode;
extern int YYNEAR YYDCDECL yyretirecode;
extern int YYNEAR YYDCDECL yyerrorpop;

/* debugging functions */
#ifdef YYDEBUG
#ifdef YYPROTOTYPE
YYCONST char *YYCDECL yytokenstring(int token);
void YYCDECL yydgettoken(int token);
void YYCDECL yydshift(int token);
void YYCDECL yydreduce(int rule);
void YYCDECL yydsyntaxerror(void);
void YYCDECL yydaccept(void);
void YYCDECL yydabort(void);
void YYCDECL yyddiscard(int token);
void YYCDECL yydexit(int exitcode);
void YYCDECL yydthrowerror(int errorpop);
void YYCDECL yydretire(int retirecode);
void YYCDECL yydattemptrecovery(void);
void YYCDECL yyparsedebugoutput(YYCONST char *string);
#else
YYCONST char *YYCDECL yytokenstring();
void YYCDECL yydgettoken();
void YYCDECL yydshift();
void YYCDECL yydreduce();
void YYCDECL yydsyntaxerror();
void YYCDECL yydaccept();
void YYCDECL yydabort();
void YYCDECL yyddiscard();
void YYCDECL yydexit();
void YYCDECL yydthrowerror();
void YYCDECL yydretire();
void YYCDECL yydattemptrecovery();
void YYCDECL yyparsedebugoutput();
#endif
#endif

/* debugging variables */
#ifdef YYDEBUG
extern int YYNEAR YYDCDECL yydebug;
extern int YYNEAR YYDCDECL yydebugstack;
extern int YYNEAR YYDCDECL yydebugflush;
extern int YYNEAR YYDCDECL yyparsedebug;
extern int YYNEAR YYDCDECL yyparsedebugstack;
extern int YYNEAR YYDCDECL yyparsedebugflush;
extern FILE YYFAR *YYNEAR YYDCDECL yyparsedebugout;
extern YYCONST yysymbol_t YYNEARFAR YYDCDECL yysymbol[];
extern YYCONST char *YYCONST YYNEARFAR YYDCDECL yyrule[];
#endif

/* externally defined */
#ifdef YYPROTOTYPE
int YYCDECL yylex(void);
void YYCDECL yyparseaction(int action);
#else
int YYCDECL yylex();
void YYCDECL yyparseaction();
#endif

extern yystack_t YYFAR *YYNEAR YYDCDECL yystackptr;			/* (state) stack */
extern yystack_t YYFAR *YYNEAR YYDCDECL yysstackptr;		/* static (state) stack */
extern int YYNEAR YYDCDECL yystack_size;					/* number of elements in stack */
extern int YYNEAR YYDCDECL yysstack_size;					/* initial number of elements in stack */

extern size_t YYNEAR YYDCDECL yyattribute_size;				/* size of attribute */

#ifdef YYPROTOTYPE
extern void YYFAR *YYNEAR YYDCDECL yyvalptr;				/* attribute for $$ */
extern void YYFAR *YYNEAR YYDCDECL yylvalptr;				/* current token attribute */
extern void YYFAR *YYNEAR YYDCDECL yyattributestackptr;		/* attribute stack */
extern void YYFAR *YYNEAR YYDCDECL yysattributestackptr;	/* static attribute stack */
#else
extern char YYFAR *YYNEAR YYDCDECL yyvalptr;				/* attribute for $$ */
extern char YYFAR *YYNEAR YYDCDECL yylvalptr;				/* current token attribute */
extern char YYFAR *YYNEAR YYDCDECL yyattributestackptr;		/* attribute stack */
extern char YYFAR *YYNEAR YYDCDECL yysattributestackptr;	/* static attribute stack */
#endif

/* compact parser */
extern YYCONST yycstateaction_t YYNEARFAR YYDCDECL yycstateaction[];
extern YYCONST yyctokenaction_t YYNEARFAR YYDCDECL yyctokenaction[];
extern YYCONST yycnontermgoto_t YYNEARFAR YYDCDECL yycnontermgoto[];
extern YYCONST yycstategoto_t YYNEARFAR YYDCDECL yycstategoto[];
extern YYCONST yyctokendest_t YYNEARFAR *YYNEAR YYDCDECL yyctokendestptr;

/* fast parser */
extern YYCONST yystateaction_t YYNEARFAR YYDCDECL yystateaction[];
extern YYCONST yytokenaction_t YYNEARFAR YYDCDECL yytokenaction[];
extern int YYNEAR YYDCDECL yytokenaction_size;
extern YYCONST yynontermgoto_t YYNEARFAR YYDCDECL yynontermgoto[];
extern YYCONST yystategoto_t YYNEARFAR YYDCDECL yystategoto[];
extern int YYNEAR YYDCDECL yystategoto_size;
extern YYCONST yytokendest_t YYNEARFAR *YYNEAR YYDCDECL yytokendestptr;
extern int YYNEAR YYDCDECL yytokendest_size;
extern int YYNEAR YYDCDECL yytokendestbase;

extern YYCONST yyreduction_t YYNEARFAR YYDCDECL yyreduction[];

extern YYCONST yydestructor_t YYNEARFAR *YYNEAR YYDCDECL yydestructorptr;

/* user defines */
#if defined(YYBUDEFS) || defined(YYUDEFS)
#include <yybudefs.h>
#endif

/* defines */
#include <yybdefs.h>

#ifdef __cplusplus
};
#endif

#endif