EasyLexer-token.h (3186B)
1 /* -*- C++ -*- vim: set syntax=cpp: 2 * (C) 2004-2009 Frank-Rene Schaefer 3 * ABSOLUTELY NO WARRANTY 4 */ 5 #ifndef __QUEX_INCLUDE_GUARD__TOKEN__GENERATED__QUEX___TOKEN 6 #define __QUEX_INCLUDE_GUARD__TOKEN__GENERATED__QUEX___TOKEN 7 8 /* For '--token-class-only' the following option may not come directly 9 * from the configuration file. */ 10 #ifndef __QUEX_OPTION_PLAIN_C 11 # define __QUEX_OPTION_PLAIN_C 12 #endif 13 #include "definitions" 14 #include "asserts" 15 #include "compatStdint.h" 16 #include "MemoryManager" 17 18 /* LexemeNull object may be used for 'take_text'. */ 19 QUEX_NAMESPACE_LEXEME_NULL_OPEN 20 extern QUEX_TYPE_LEXATOM QUEX_LEXEME_NULL_IN_ITS_NAMESPACE; 21 QUEX_NAMESPACE_LEXEME_NULL_CLOSE 22 23 24 25 # line 2 "CDefault.qx" 26 27 #include <stdio.h> 28 #include <string.h> 29 30 struct quex_Token_tag; 31 32 extern const char* 33 quex_Token_get_string(struct quex_Token_tag* me, char* buffer, size_t BufferSize); 34 35 extern const char* 36 quex_Token_pretty_char_text(struct quex_Token_tag* me, char* buffer, size_t BufferSize); 37 38 # if ! defined(__QUEX_OPTION_WCHAR_T_DISABLED) 39 extern const wchar_t* 40 quex_Token_pretty_wchar_text(struct quex_Token_tag* me, wchar_t* buffer, size_t BufferSize); 41 # endif 42 43 #include "identity" 44 45 46 # line 47 "EasyLexer-token.h" 47 48 49 typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG quex_Token_tag { 50 QUEX_TYPE_TOKEN_ID _id; 51 52 # line 27 "CDefault.qx" 53 const QUEX_TYPE_LEXATOM* text; 54 55 # line 56 "EasyLexer-token.h" 56 57 # line 28 "CDefault.qx" 58 size_t number; 59 60 # line 61 "EasyLexer-token.h" 61 62 63 # ifdef QUEX_OPTION_TOKEN_STAMPING_WITH_LINE_AND_COLUMN 64 # ifdef QUEX_OPTION_LINE_NUMBER_COUNTING 65 QUEX_TYPE_TOKEN_LINE_N _line_n; 66 # endif 67 # ifdef QUEX_OPTION_COLUMN_NUMBER_COUNTING 68 QUEX_TYPE_TOKEN_COLUMN_N _column_n; 69 # endif 70 # endif 71 72 # line 126 "CDefault.qx" 73 74 /* 75 */ 76 77 78 # line 79 "EasyLexer-token.h" 79 80 } quex_Token; 81 82 QUEX_INLINE void quex_Token_construct(quex_Token*); 83 QUEX_INLINE void quex_Token_copy_construct(quex_Token*, 84 const quex_Token*); 85 QUEX_INLINE void quex_Token_copy(quex_Token*, const quex_Token*); 86 QUEX_INLINE void quex_Token_destruct(quex_Token*); 87 88 /* NOTE: Setters and getters as in the C++ version of the token class are not 89 * necessary, since the members are accessed directly. */ 90 91 QUEX_INLINE void 92 quex_Token_set(quex_Token* __this, 93 const QUEX_TYPE_TOKEN_ID ID); 94 95 extern const char* quex_Token_map_id_to_name(const QUEX_TYPE_TOKEN_ID); 96 97 QUEX_INLINE bool 98 quex_Token_take_text(quex_Token* __this, 99 QUEX_TYPE_ANALYZER* analyzer, 100 const QUEX_TYPE_LEXATOM* Begin, const QUEX_TYPE_LEXATOM* End); 101 102 #ifdef QUEX_OPTION_TOKEN_REPETITION_SUPPORT 103 QUEX_INLINE size_t quex_Token_repetition_n_get(quex_Token*); 104 QUEX_INLINE void quex_Token_repetition_n_set(quex_Token*, size_t); 105 #endif /* QUEX_OPTION_TOKEN_REPETITION_SUPPORT */ 106 107 108 109 #endif /* __QUEX_INCLUDE_GUARD__TOKEN__GENERATED__QUEX___TOKEN */