Accumulator (2114B)
1 /* -*- C++ -*- vim:set syntax=cpp: 2 * 3 * (C) 2004-2009 Frank-Rene Schaefer 4 * 5 * __QUEX_INCLUDE_GUARD__ANALYZER__ACCUMULATOR may be undefined in case 6 * that multiple lexical analyzers are used. Then, the name of the 7 * QUEX_NAME(Accumulator) must be different. */ 8 #ifndef __QUEX_INCLUDE_GUARD__ANALYZER__ACCUMULATOR 9 #define __QUEX_INCLUDE_GUARD__ANALYZER__ACCUMULATOR 10 11 12 #include "definitions" 13 14 15 QUEX_NAMESPACE_MAIN_OPEN 16 17 # ifdef __QUEX_OPTION_PLAIN_C 18 QUEX_TYPE0_ANALYZER; 19 # else 20 class QUEX_TYPE0_ANALYZER; 21 # endif 22 23 /* (*) pure text accumulation and flushing */ 24 typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG { 25 # ifdef QUEX_OPTION_LINE_NUMBER_COUNTING 26 size_t _begin_line; 27 # endif 28 # ifdef QUEX_OPTION_COLUMN_NUMBER_COUNTING 29 size_t _begin_column; 30 # endif 31 32 struct { 33 QUEX_TYPE_LEXATOM* begin; 34 QUEX_TYPE_LEXATOM* end; 35 QUEX_TYPE_LEXATOM* memory_end; 36 } text; 37 QUEX_TYPE_ANALYZER* the_lexer; 38 39 } QUEX_NAME(Accumulator); 40 41 QUEX_INLINE void 42 QUEX_NAME(Accumulator_init_memory)(QUEX_NAME(Accumulator)* me); 43 44 QUEX_INLINE void 45 QUEX_NAME(Accumulator_construct)(QUEX_NAME(Accumulator)*, QUEX_TYPE_ANALYZER*); 46 47 QUEX_INLINE void 48 QUEX_NAME(Accumulator_destruct)(QUEX_NAME(Accumulator)* me); 49 50 QUEX_INLINE bool 51 QUEX_NAME(Accumulator_extend)(QUEX_NAME(Accumulator)* me, size_t MinAddSize); 52 53 QUEX_INLINE void 54 QUEX_NAME(Accumulator_clear)(QUEX_NAME(Accumulator)* me); 55 56 QUEX_INLINE void 57 QUEX_NAME(Accumulator_add)(QUEX_NAME(Accumulator)* me, 58 const QUEX_TYPE_LEXATOM* Begin, const QUEX_TYPE_LEXATOM* End); 59 60 QUEX_INLINE void 61 QUEX_NAME(Accumulator_add_character)(QUEX_NAME(Accumulator)* me, 62 const QUEX_TYPE_LEXATOM Character); 63 64 QUEX_INLINE void 65 QUEX_NAME(Accumulator_print_this)(QUEX_NAME(Accumulator)* me); 66 67 QUEX_NAMESPACE_MAIN_CLOSE 68 69 #endif /* __QUEX_INCLUDE_GUARD__ANALYZER__ACCUMULATOR */