EasyLexer.h (4229B)
1 /* -*- C++ -*- vim: set syntax=cpp: 2 * CONTENT: 3 * 4 * (1) Includes for required standard headers. 5 * (2) Definitions of options and settings for the particular application. 6 * (3) #include "definitions" for default settings. 7 * (4) Lexical Analyzer class EasyLexer and its memento class. 8 * (5) Constructor and init core of EasyLexer. 9 * (6) Memento pack and unpack functions. 10 * 11 * File content generated by Quex 0.66.5. 12 * 13 * (C) 2005-2012 Frank-Rene Schaefer 14 * ABSOLUTELY NO WARRANTY */ 15 #ifndef __QUEX_INCLUDE_GUARD__ANALYZER__GENERATED__QUEX___EASYLEXER 16 #define __QUEX_INCLUDE_GUARD__ANALYZER__GENERATED__QUEX___EASYLEXER 17 18 #ifdef __QUEX_INCLUDE_INDICATOR__ANALYZER__MAIN 19 /* In case that multiple lexical analyzers are used the same header 20 * files are compiled with a different setting of the macros. The 21 * undef of the include guards happens in the following file. */ 22 # ifdef __QUEX_SIGNAL_DEFINED_LEXER_IN_NAMESPACE_QUEX_ 23 # error "More than one lexical analyzer have been generated in the same name space. Read documentation on command line option '-o'." 24 # endif 25 # ifndef QUEX_OPTION_MULTI 26 # error "Multiple lexical analyzers detected. QUEX_OPTION_MULTI must be defined and 'quex/code_base/multi.i' must be included in one single file!" 27 # endif 28 # include <quex/code_base/include-guard-undef> 29 # include <quex/code_base/analyzer/member/token-sending-undef.i> 30 # undef __QUEX_INCLUDE_GUARD__ANALYZER__CONFIGURATION__QUEX___EASYLEXER 31 #else 32 # define __QUEX_INCLUDE_INDICATOR__ANALYZER__MAIN 33 #endif 34 #define __QUEX_SIGNAL_DEFINED_LEXER_IN_NAMESPACE_QUEX_ 35 36 #include "EasyLexer-configuration.h" 37 38 #include "definitions" 39 40 struct QUEX_NAME(Engine_tag); 41 struct QUEX_NAME(Memento_tag); 42 QUEX_TYPE0_ANALYZER; /* quex_EasyLexer */ 43 typedef __QUEX_TYPE_ANALYZER_RETURN_VALUE (*QUEX_NAME(AnalyzerFunctionP))(QUEX_TYPE0_ANALYZER*); 44 45 /* Token Class Declaration must preceed the user's header, so that the user 46 * can refer to it at ease. */ 47 QUEX_TYPE0_TOKEN; 48 49 /* START: User defined header content _________________________________________ 50 * Must come before token class definition, since the token class 51 * might rely on contents of the header. */ 52 53 54 /* END: _______________________________________________________________________*/ 55 #if defined(__QUEX_OPTION_CONVERTER_HELPER) 56 # include "from-unicode-buffer" 57 #else 58 # include "from-unicode-buffer" 59 #endif 60 #include "analyzerHeaders" 61 62 #include "EasyLexer-token_ids.h" 63 #include "EasyLexer-token.h" 64 65 66 QUEX_NAMESPACE_MAIN_OPEN 67 68 enum { 69 QUEX_NAME(ModeID_PROGRAM) = 0 70 }; 71 72 extern QUEX_NAME(Mode) QUEX_NAME(PROGRAM); 73 74 75 extern __QUEX_TYPE_ANALYZER_RETURN_VALUE QUEX_NAME(PROGRAM_analyzer_function)(QUEX_TYPE_ANALYZER*); 76 #ifdef QUEX_OPTION_RUNTIME_MODE_TRANSITION_CHECK 77 extern bool QUEX_NAME(PROGRAM_has_base)(const QUEX_NAME(Mode)*); 78 extern bool QUEX_NAME(PROGRAM_has_entry_from)(const QUEX_NAME(Mode)*); 79 extern bool QUEX_NAME(PROGRAM_has_exit_to)(const QUEX_NAME(Mode)*); 80 #endif 81 82 83 84 typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG QUEX_NAME(Memento_tag) { 85 # include "EngineMemento_body" 86 87 /* Con- and Destruction are **not** necessary in C. No con- or de- 88 * structors of members need to be triggered. */ 89 90 /* START: User's memento extentions ___________________________________________*/ 91 92 /* END: _______________________________________________________________________*/ 93 } QUEX_NAME(Memento); 94 95 QUEX_NAMESPACE_MAIN_CLOSE 96 97 QUEX_NAMESPACE_MAIN_OPEN 98 99 extern QUEX_NAME(Mode)* (QUEX_NAME(mode_db)[__QUEX_SETTING_MAX_MODE_CLASS_N]); 100 101 typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG quex_EasyLexer_tag { 102 103 #include "Engine_body" 104 #define self (*(QUEX_TYPE_DERIVED_ANALYZER*)this) 105 /* START: User's class body extensions _____________________________________________*/ 106 107 /* END: ____________________________________________________________________________*/ 108 #undef self 109 110 } quex_EasyLexer; 111 112 QUEX_NAMESPACE_MAIN_CLOSE 113 114 #endif /* __QUEX_INCLUDE_GUARD__ANALYZER__GENERATED__QUEX___EASYLEXER */