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

clex.h

Go to the documentation of this file.
00001 #ifndef CLEX_H
00002 #define CLEX_H
00003 
00004 /************************************************************
00005 clex.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 <assert.h>
00014 
00015 // defines
00016 #include <yytdefs.h>
00017 
00018 // user defines
00019 #if defined(YYTUDEFS) || defined(YYUDEFS)
00020 #include <yytudefs.h>
00021 #endif
00022 
00023 #define YY_ALEX
00024 
00025 // modifiers
00026 #ifndef YYCDECL
00027 #define YYCDECL
00028 #endif
00029 #ifndef YYDCDECL
00030 #define YYDCDECL
00031 #endif
00032 #ifndef YYNEAR
00033 #define YYNEAR
00034 #endif
00035 #ifndef YYFAR
00036 #define YYFAR
00037 #endif
00038 #ifndef YYNEARFAR
00039 #define YYNEARFAR
00040 #endif
00041 #ifndef YYBASED_CODE
00042 #define YYBASED_CODE
00043 #endif
00044 
00045 // forward references
00046 class YYFAR yyparser;
00047 
00048 // yylex return values
00049 #define YYEOF 0                 // end of file
00050 
00051 #ifndef YYSTATE_T
00052 #define YYSTATE_T
00053 typedef struct yystate {
00054         short def;                      // default state
00055         short base;                     // base
00056         short match;            // action associated with state
00057 } yystate_t;
00058 #endif
00059 
00060 #ifndef YYTRANSITION_T
00061 #define YYTRANSITION_T
00062 typedef struct yytransition {
00063         short next;                     // next state on transition
00064         short check;            // check
00065 } yytransition_t;
00066 #endif
00067 
00068 #ifndef YYCTRANSITION_T
00069 #define YYCTRANSITION_T
00070 typedef struct yyctransition {
00071         unsigned char first;    // first character in range
00072         unsigned char last;             // last character in range
00073         short next;                             // next state on transition
00074 } yyctransition_t;
00075 #endif
00076 
00077 typedef short yymatch_t;
00078 typedef unsigned char yybackup_t;
00079 
00080 class YYFAR yylexer {
00081 public:
00082         yylexer();
00083         virtual ~yylexer();
00084 
00085 // Attributes
00086 protected:
00087         // left context
00088         int yystart;                                    // current start state
00089         unsigned char yyeol;                    // whether an end-of-line '\n' has been seen
00090         unsigned char yyoldeol;                 // previous end-of-line value
00091 
00092         // text buffer
00093         int YYFAR* yystatebuf;                  // state buffer
00094         int YYFAR* yysstatebuf;                 // initial (static) state buffer
00095         char YYFAR* yystext;                    // initial (static) text buffer
00096         int yytext_size;                                // text buffer size
00097         int yystext_size;                               // initial (static) text buffer size
00098 
00099         // unput buffer
00100         int YYFAR* yyunputbufptr;               // unput buffer
00101         int YYFAR* yysunputbufptr;              // initial (static) unput buffer
00102         int yyunput_size;                               // unput buffer size
00103         int yysunput_size;                              // initial (static) unput buffer size
00104         int yyunputindex;                               // unput buffer position
00105 
00106         // actions
00107         unsigned char yymoreflg;                // concatenate matched strings
00108         unsigned char yyrejectflg;              // yyreject called from an action
00109         unsigned char yyreturnflg;              // return from an action
00110 public:
00111         yyparser YYFAR* yyparserptr;    // pointer to the attached parser
00112 
00113         // buffer flags
00114         unsigned char yytextgrow;               // whether text buffer is allowed to grow
00115         unsigned char yyunputgrow;              // whether unput buffer is allowed to grow
00116 
00117         // streams
00118         FILE YYFAR* yyin;                               // input text stream
00119         FILE YYFAR* yyout;                              // output text stream
00120         FILE YYFAR* yyerr;                              // error stream
00121 
00122         // matched string
00123         char YYFAR* yytext;                             // text buffer
00124         int yyleng;                                             // matched string length
00125         int yylineno;                                   // current line number
00126 
00127 // Operations
00128 protected:
00129         // helper functions
00130         int yyback(const yymatch_t YYNEARFAR* p, int action) const;
00131 public:
00132         // instance functions
00133         int yycreate(yyparser YYFAR* parserptr = NULL);
00134         void yydestroy();
00135 
00136         // general functions
00137         void yycleanup();
00138         virtual int yylex() = 0;
00139         void yyreset();
00140         int yysettextsize(int size);
00141         int yysetunputsize(int size);
00142 
00143         // service functions
00144         virtual int yyinput();
00145         virtual void yyoutput(int ch);
00146         virtual void yyunput(int ch);
00147         virtual int yywrap();
00148         virtual int yygetchar();
00149         virtual void yytextoverflow();
00150         virtual void yyunputoverflow();
00151         virtual int yyaction(int action) = 0;
00152 
00153         // action functions
00154         void yyecho();
00155         void yyless(int length);
00156         void yybegin(int state) { yystart = state; }
00157         void yymore() { yymoreflg = 1; }
00158         void yynewline(int newline) { newline ? yyeol = 1 : (yyeol = 0); }
00159         void yyreject() { yyrejectflg = 1; }
00160         int yyunputcount() const { return yyunputindex; }
00161 
00162         // compatibility
00163         int yyclex() { return yylex(); }
00164         void yylexcleanup() { yycleanup(); }
00165         void yylexinit() { /* do nothing */ }
00166 #define BEGIN yystart = 
00167 #define ECHO yyecho()
00168 #define REJECT yyreject()
00169 #define YYSTATE yystart
00170 #define YY_START yystart
00171 
00172 // Tables
00173 protected:
00174         const yymatch_t YYNEARFAR* yymatch;
00175         const yystate_t YYNEARFAR* yystate;
00176         const yybackup_t YYNEARFAR* yybackup;
00177 
00178 // Debugging
00179 #ifdef YYDEBUG
00180 public:
00181         int yydebug;                                    // whether debug information should be output
00182         int yydebugflush;                               // whether debug output should be flushed
00183         FILE YYFAR* yydebugout;                 // debug output file
00184 protected:
00185         void yydebugoutput(int ch) const;
00186         void yydmatch(int expr) const;
00187         void yydebugoutput(const char* string) const;
00188 #endif
00189 };
00190 
00191 class YYFAR yyflexer : public yylexer {
00192 public:
00193         yyflexer() { /* do nothing */ }
00194 
00195 // Operations
00196 public:
00197         virtual int yylex();
00198 
00199 // Tables
00200 protected:
00201         const yytransition_t YYNEARFAR* yytransition;
00202         int yytransitionmax;
00203 };
00204 
00205 class YYFAR yyclexer : public yylexer {
00206 public:
00207         yyclexer() { /* do nothing */ }
00208 
00209 // Operations
00210 public:
00211         virtual int yylex();
00212 
00213 // Tables
00214 protected:
00215         const yyctransition_t YYNEARFAR* yyctransition;
00216 };
00217 
00218 // helper functions
00219 #ifndef yyassert
00220 #define yyassert(expr) assert(expr)
00221 #endif
00222 
00223 // debugging variables
00224 #ifdef YYDEBUG
00225 extern "C" int YYNEAR YYDCDECL yydebug;
00226 extern "C" int YYNEAR YYDCDECL yydebugflush;
00227 #endif
00228 
00229 // user defines
00230 #if defined(YYBUDEFS) || defined(YYUDEFS)
00231 #include <yybudefs.h>
00232 #endif
00233 
00234 // defines
00235 #include <yybdefs.h>
00236 
00237 #endif
00238 

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