00001 #ifndef CYACC_H
00002 #define CYACC_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <stdio.h>
00013 #include <stddef.h>
00014 #include <assert.h>
00015
00016
00017 #include <yytdefs.h>
00018
00019
00020 #if defined(YYTUDEFS) || defined(YYUDEFS)
00021 #include <yytudefs.h>
00022 #endif
00023
00024 #define YY_AYACC
00025
00026
00027 #ifndef YYCDECL
00028 #define YYCDECL
00029 #endif
00030 #ifndef YYDCDECL
00031 #define YYDCDECL
00032 #endif
00033 #ifndef YYNEAR
00034 #define YYNEAR
00035 #endif
00036 #ifndef YYFAR
00037 #define YYFAR
00038 #endif
00039 #ifndef YYNEARFAR
00040 #define YYNEARFAR
00041 #endif
00042 #ifndef YYBASED_CODE
00043 #define YYBASED_CODE
00044 #endif
00045
00046
00047 class YYFAR yylexer;
00048
00049 typedef short yystack_t;
00050
00051
00052 #define YYEXIT_SUCCESS 0
00053 #define YYEXIT_FAILURE 1
00054
00055
00056 #define YYTK_ALL (-1) // match all tokens
00057 #define YYTK_END 0 // $end token
00058 #define YYTK_ERROR 256 // error token
00059
00060 #ifndef YYCSTATEGOTO_T
00061 #define YYCSTATEGOTO_T
00062 typedef short yycstategoto_t;
00063 #endif
00064
00065 #ifndef YYCNONTERMGOTO_T
00066 #define YYCNONTERMGOTO_T
00067 typedef struct yycnontermgoto {
00068 short nonterm;
00069 short next;
00070 } yycnontermgoto_t;
00071 #endif
00072
00073 #ifndef YYSTATEGOTO_T
00074 #define YYSTATEGOTO_T
00075 typedef struct yystategoto {
00076 short base;
00077 short def;
00078 } yystategoto_t;
00079 #endif
00080
00081 #ifndef YYNONTERMGOTO_T
00082 #define YYNONTERMGOTO_T
00083 typedef struct yynontermgoto {
00084 short check;
00085 short next;
00086 } yynontermgoto_t;
00087 #endif
00088
00089
00090 #define YYAT_SHIFT 0 // shift action
00091 #define YYAT_REDUCE 1 // reduce action
00092 #define YYAT_ERROR 2 // error
00093 #define YYAT_ACCEPT 3 // accept
00094 #define YYAT_DEFAULT 4 // default state
00095
00096 #ifndef YYCSTATEACTION_T
00097 #define YYCSTATEACTION_T
00098 typedef short yycstateaction_t;
00099 #endif
00100
00101 #ifndef YYCTOKENACTION_T
00102 #define YYCTOKENACTION_T
00103 typedef struct yyctokenaction {
00104 int token;
00105 unsigned char type;
00106 short sr;
00107 } yyctokenaction_t;
00108 #endif
00109
00110 #ifndef YYSTATEACTION_T
00111 #define YYSTATEACTION_T
00112 typedef struct yystateaction {
00113 short base;
00114 unsigned char lookahead;
00115 unsigned char type;
00116 short sr;
00117 } yystateaction_t;
00118 #endif
00119
00120 #ifndef YYTOKENACTION_T
00121 #define YYTOKENACTION_T
00122 typedef struct yytokenaction {
00123 short check;
00124 unsigned char type;
00125 short sr;
00126 } yytokenaction_t;
00127 #endif
00128
00129
00130 #define YYNT_ALL (-1) // match all nonterminals
00131
00132
00133 #define YYST_ERROR (-1) // goto error
00134
00135 #ifndef YYREDUCTION_T
00136 #define YYREDUCTION_T
00137 typedef struct yyreduction {
00138 short nonterm;
00139 short length;
00140 short action;
00141 } yyreduction_t;
00142 #endif
00143
00144 typedef short yydestructor_t;
00145
00146 typedef short yytokendest_t;
00147
00148 #ifndef YYCTOKENDEST_T
00149 #define YYCTOKENDEST_T
00150 typedef struct yyctokendest {
00151 int token;
00152 short action;
00153 } yyctokendest_t;
00154 #endif
00155
00156
00157 #ifdef YYDEBUG
00158 #ifndef YYSYMBOL_T
00159 #define YYSYMBOL_T
00160 typedef struct yysymbol {
00161 const char* name;
00162 int token;
00163 } yysymbol_t;
00164 #endif
00165 #endif
00166
00167 class YYFAR yyparser {
00168 public:
00169 yyparser();
00170 virtual ~yyparser();
00171
00172
00173 protected:
00174
00175 yystack_t YYFAR* yystackptr;
00176 yystack_t YYFAR* yysstackptr;
00177 void YYFAR* yyattributestackptr;
00178 void YYFAR* yysattributestackptr;
00179 int yystack_size;
00180 int yysstack_size;
00181
00182 int yytop;
00183 size_t yyattribute_size;
00184
00185 void YYFAR* yyvalptr;
00186
00187
00188 unsigned char yylookahead;
00189 int yychar;
00190
00191
00192 unsigned char yywipeflg;
00193 unsigned char yypopflg;
00194 int yyskip;
00195
00196
00197 unsigned char yyexitflg;
00198 unsigned char yyretireflg;
00199 unsigned char yyerrorflg;
00200 int yyexitcode;
00201 int yyretirecode;
00202 int yyerrorpop;
00203 public:
00204 yylexer YYFAR* yylexerptr;
00205
00206 unsigned char yystackgrow;
00207 void YYFAR* yylvalptr;
00208 FILE YYFAR* yyerr;
00209 int yyerrorcount;
00210
00211
00212 protected:
00213 virtual void yyaction(int action) = 0;
00214
00215
00216 #ifdef YYDEBUG
00217 void yypop(int num);
00218 void yysetskip(int skip);
00219 #else
00220 void yypop(int num) { yytop -= num; }
00221 void yysetskip(int skip) { yyskip = skip; }
00222 #endif
00223 int yypush(yystack_t state);
00224 yystack_t yypeek() const { return yystackptr[yytop]; }
00225
00226 public:
00227
00228 int yycreate(yylexer YYFAR* lexerptr = NULL);
00229 void yydestroy();
00230
00231
00232 void yydestructpop(int num);
00233 int yyparse();
00234 void yycleanup();
00235 int yysetstacksize(int size);
00236 int yysetup();
00237 void yywipe();
00238 virtual int yywork() = 0;
00239 virtual void yydestructclearin() = 0;
00240
00241
00242 virtual void yystackoverflow();
00243 virtual void yyerror(const char YYFAR* text);
00244 virtual void yysyntaxerror();
00245 virtual void yydiscard(int token);
00246 virtual int yygettoken();
00247
00248
00249 void yysetin(int token);
00250 int yyunclearin();
00251 void yyabort() { yyexit(1); }
00252 void yyaccept() { yyexit(0); }
00253 #ifndef YY_COMPATIBLE
00254 void yyclearin() { yylookahead = 0; }
00255 void yyerrok() { yysetskip(0); }
00256 #else
00257 void _yyclearin() { yylookahead = 0; }
00258 void _yyerrok() { yysetskip(0); }
00259 #endif
00260 void yyexit(int exitcode) { yyexitflg = 1; yyexitcode = exitcode; }
00261 void yyforceerror() { yythrowerror(); }
00262 int yypopping() const { return yypopflg; }
00263 int yyrecovering() const { return yyskip > 0; }
00264 void yyretire(int retirecode) { yyretireflg = 1; yyretirecode = retirecode; }
00265 void yythrowerror(int pop = 0) { yyerrorflg = 1; yyerrorpop = pop; }
00266
00267
00268 int yycparse() { return yyparse(); }
00269 int yycwork() { return yywork(); }
00270 void yyparsecleanup() { yycleanup(); }
00271 void yyparseinit() { }
00272 #ifdef YY_COMPATIBLE
00273 #define yyclearin _yyclearin()
00274 #define yyerrok _yyerrok()
00275 #endif
00276 #define YYABORT yyexit(1)
00277 #define YYACCEPT yyexit(0)
00278 #define YYERROR yyforceerror()
00279 #define YYRECOVERING yyrecovering()
00280
00281
00282 protected:
00283 const yyreduction_t YYNEARFAR* yyreduction;
00284 const yydestructor_t YYNEARFAR* yydestructorptr;
00285
00286
00287 #ifdef YYDEBUG
00288 public:
00289 int yydebug;
00290 int yydebugstack;
00291 int yydebugflush;
00292 FILE YYFAR* yydebugout;
00293 protected:
00294 const yysymbol_t YYNEARFAR* yysymbol;
00295 const char* const YYNEARFAR* yyrule;
00296
00297
00298 protected:
00299 const char* yytokenstring(int token) const;
00300 void yydgettoken(int token) const;
00301 void yydshift(int token) const;
00302 void yydreduce(int rule) const;
00303 void yydsyntaxerror() const;
00304 void yydaccept() const;
00305 void yydabort() const;
00306 void yyddiscard(int token) const;
00307 void yydexit(int exitcode) const;
00308 void yydthrowerror(int errorpop) const;
00309 void yydretire(int retirecode) const;
00310 void yydattemptrecovery() const;
00311 void yydebugoutput(const char* string) const;
00312 #endif
00313 };
00314
00315 class YYFAR yyfparser : public yyparser {
00316 public:
00317 yyfparser() { }
00318
00319
00320 public:
00321 virtual int yywork();
00322 virtual void yydestructclearin();
00323
00324
00325 protected:
00326 const yystateaction_t YYNEARFAR* yystateaction;
00327 const yytokenaction_t YYNEARFAR* yytokenaction;
00328 int yytokenaction_size;
00329 const yystategoto_t YYNEARFAR* yystategoto;
00330 const yynontermgoto_t YYNEARFAR* yynontermgoto;
00331 int yynontermgoto_size;
00332 const yytokendest_t YYNEARFAR* yytokendestptr;
00333 int yytokendest_size;
00334 int yytokendestbase;
00335 };
00336
00337 class YYFAR yycparser : public yyparser {
00338 public:
00339 yycparser() { }
00340
00341
00342 public:
00343 virtual int yywork();
00344 virtual void yydestructclearin();
00345
00346
00347 protected:
00348 const yycstateaction_t YYNEARFAR* yycstateaction;
00349 const yyctokenaction_t YYNEARFAR* yyctokenaction;
00350 const yycstategoto_t YYNEARFAR* yycstategoto;
00351 const yycnontermgoto_t YYNEARFAR* yycnontermgoto;
00352 const yyctokendest_t YYNEARFAR* yyctokendestptr;
00353 };
00354
00355
00356 #ifndef yyassert
00357 #define yyassert(expr) assert(expr)
00358 #endif
00359
00360
00361 #ifdef YYDEBUG
00362 extern "C" int YYNEAR YYDCDECL yydebug;
00363 extern "C" int YYNEAR YYDCDECL yydebugstack;
00364 extern "C" int YYNEAR YYDCDECL yydebugflush;
00365 #endif
00366
00367
00368 #if defined(YYBUDEFS) || defined(YYUDEFS)
00369 #include <yybudefs.h>
00370 #endif
00371
00372
00373 #include <yybdefs.h>
00374
00375 #endif
00376