Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

cyacc.h

Go to the documentation of this file.
00001 #ifndef CYACC_H
00002 #define CYACC_H
00003 
00004 /************************************************************
00005 cyacc.h
00006 This file can be freely modified for the generation of
00007 custom code.
00008 
00009 Copyright (c) 1999-2001 Bumble-Bee Software Ltd.
00010 ************************************************************/
00011 
00012 #include <stdio.h>
00013 #include <stddef.h>
00014 #include <assert.h>
00015 
00016 // defines
00017 #include <yytdefs.h>
00018 
00019 // user defines
00020 #if defined(YYTUDEFS) || defined(YYUDEFS)
00021 #include <yytudefs.h>
00022 #endif
00023 
00024 #define YY_AYACC
00025 
00026 // modifiers
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 // forward references
00047 class YYFAR yylexer;
00048 
00049 typedef short yystack_t;
00050 
00051 // yyparse return values
00052 #define YYEXIT_SUCCESS  0
00053 #define YYEXIT_FAILURE  1
00054 
00055 // common tokens
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;                                  // nonterminal
00069         short next;                                             // next state
00070 } yycnontermgoto_t;
00071 #endif
00072 
00073 #ifndef YYSTATEGOTO_T
00074 #define YYSTATEGOTO_T
00075 typedef struct yystategoto {
00076         short base;                                             // base
00077         short def;                                              // default state
00078 } yystategoto_t;
00079 #endif
00080 
00081 #ifndef YYNONTERMGOTO_T
00082 #define YYNONTERMGOTO_T
00083 typedef struct yynontermgoto {
00084         short check;                                    // check
00085         short next;                                             // next state
00086 } yynontermgoto_t;
00087 #endif
00088 
00089 // action types
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;                                              // lookahead token
00105         unsigned char type;                             // action to perform
00106         short sr;                                               // state to shift/production to reduce
00107 } yyctokenaction_t;
00108 #endif
00109 
00110 #ifndef YYSTATEACTION_T
00111 #define YYSTATEACTION_T
00112 typedef struct yystateaction {
00113         short base;                                             // base
00114         unsigned char lookahead;                // lookahead needed
00115         unsigned char type;                             // action to perform
00116         short sr;                                               // shift/reduce
00117 } yystateaction_t;
00118 #endif
00119 
00120 #ifndef YYTOKENACTION_T
00121 #define YYTOKENACTION_T
00122 typedef struct yytokenaction {
00123         short check;                                    // check
00124         unsigned char type;                             // action type
00125         short sr;                                               // shift/reduce
00126 } yytokenaction_t;
00127 #endif
00128 
00129 // nonterminals
00130 #define YYNT_ALL                (-1)            // match all nonterminals
00131 
00132 // states
00133 #define YYST_ERROR              (-1)            // goto error
00134 
00135 #ifndef YYREDUCTION_T
00136 #define YYREDUCTION_T
00137 typedef struct yyreduction {
00138         short nonterm;                                  // the rhs symbol
00139         short length;                                   // number of symbols on lhs
00140         short action;                                   // the user 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;                                              /* token */
00152         short action;                                   /* the user action */
00153 } yyctokendest_t;
00154 #endif
00155 
00156 // debugging
00157 #ifdef YYDEBUG
00158 #ifndef YYSYMBOL_T
00159 #define YYSYMBOL_T
00160 typedef struct yysymbol {
00161         const char* name;                               // symbol name
00162         int token;                                              // symbol token
00163 } yysymbol_t;
00164 #endif
00165 #endif
00166 
00167 class YYFAR yyparser {
00168 public:
00169         yyparser();
00170         virtual ~yyparser();
00171 
00172 // Attributes
00173 protected:
00174         // stack
00175         yystack_t YYFAR* yystackptr;            // (state) stack
00176         yystack_t YYFAR* yysstackptr;           // static (state) stack
00177         void YYFAR* yyattributestackptr;        // attribute stack
00178         void YYFAR* yysattributestackptr;       // static attribute stack
00179         int yystack_size;                                       // number of elements in stack
00180         int yysstack_size;                                      // initial number of elements in stack
00181 
00182         int yytop;                                                      // the current top of the stack
00183         size_t yyattribute_size;                        // size of attribute
00184 
00185         void YYFAR* yyvalptr;                           // attribute for $$
00186 
00187         // lookahead token
00188         unsigned char yylookahead;                      // whether current lookahead token is valid
00189         int yychar;                                                     // current lookahead token
00190 
00191         // error recovery
00192         unsigned char yywipeflg;                        // whether to "wipe" stack on abort
00193         unsigned char yypopflg;                         // popping symbols during error recovery
00194         int yyskip;                                                     // error recovery token shift counter
00195 
00196         // actions
00197         unsigned char yyexitflg;                        // whether yymexit called
00198         unsigned char yyretireflg;                      // whether yymretire called
00199         unsigned char yyerrorflg;                       // whether yymforceerror called
00200         int yyexitcode;                                         // yymexit exit code
00201         int yyretirecode;                                       // yymretire exit code
00202         int yyerrorpop;                                         // how many error transitions to pop
00203 public:
00204         yylexer YYFAR* yylexerptr;                      // pointer to the attached lexical analyser
00205 
00206         unsigned char yystackgrow;                      // whether stack can grow
00207         void YYFAR* yylvalptr;                          // current token attribute
00208         FILE YYFAR* yyerr;                                      // error output file
00209         int yyerrorcount;                                       // how many syntax errors have occurred
00210 
00211 // Operations
00212 protected:
00213         virtual void yyaction(int action) = 0;
00214 
00215 // utility functions
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         // instance functions
00228         int yycreate(yylexer YYFAR* lexerptr = NULL);
00229         void yydestroy();
00230 
00231         // general functions
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         // service functions
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         // action functions
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         // compatibility
00268         int yycparse() { return yyparse(); }
00269         int yycwork() { return yywork(); }
00270         void yyparsecleanup() { yycleanup(); }
00271         void yyparseinit() { /* do nothing */ }
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 // Tables
00282 protected:
00283         const yyreduction_t YYNEARFAR* yyreduction;
00284         const yydestructor_t YYNEARFAR* yydestructorptr;
00285 
00286 // Debugging
00287 #ifdef YYDEBUG
00288 public:
00289         int yydebug;                            // whether debug information should be output
00290         int yydebugstack;                       // whether stack debug information should be output
00291         int yydebugflush;                       // whether debug output should be flushed
00292         FILE YYFAR* yydebugout;         // debug output file
00293 protected:
00294         const yysymbol_t YYNEARFAR* yysymbol;
00295         const char* const YYNEARFAR* yyrule;
00296 
00297         // debugging functions
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() { /* do nothing */ }
00318 
00319 // Operations
00320 public:
00321         virtual int yywork();
00322         virtual void yydestructclearin();
00323 
00324 // Tables
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() { /* do nothing */ }
00340 
00341 // Operations
00342 public:
00343         virtual int yywork();
00344         virtual void yydestructclearin();
00345 
00346 // Tables
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 // utility functions
00356 #ifndef yyassert
00357 #define yyassert(expr) assert(expr)
00358 #endif
00359 
00360 // debugging variables
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 // user defines
00368 #if defined(YYBUDEFS) || defined(YYUDEFS)
00369 #include <yybudefs.h>
00370 #endif
00371 
00372 // defines
00373 #include <yybdefs.h>
00374 
00375 #endif
00376 

Generated on Wed Mar 16 00:10:26 2005 for Dibbler - a portable DHCPv6 by  doxygen 1.3.9.1