analyzerAsserts (2407B)
1 /* -*- C++ -*- vim: set syntax=cpp: */ 2 #ifndef __QUEX_INCLUDE_GUARD__ANALYZER__ASSERTS 3 #define __QUEX_INCLUDE_GUARD__ANALYZER__ASSERTS 4 5 #if ! defined(QUEX_OPTION_ASSERTS) 6 # define __QUEX_ASSERT_COUNTER_CONSISTENCY(ME) /* empty */ 7 #else 8 # if defined(QUEX_OPTION_LINE_NUMBER_COUNTING) && defined(QUEX_OPTION_COLUMN_NUMBER_COUNTING) 9 # define __QUEX_ASSERT_COUNTER_CONSISTENCY(ME) \ 10 { \ 11 /* The line number can never decrease. */ \ 12 __quex_assert((ME)->_line_number_at_begin <= (ME)->_line_number_at_end); \ 13 /* If line number remained the same, then column number **must** have increased. */ \ 14 /* There is not pattern of a length less than 1 */ \ 15 if((ME)->_line_number_at_begin == (ME)->_line_number_at_end ) { \ 16 __quex_assert((ME)->_column_number_at_begin < (ME)->_column_number_at_end); \ 17 } \ 18 } 19 # elif defined(QUEX_OPTION_LINE_NUMBER_COUNTING) && ! defined(QUEX_OPTION_COLUMN_NUMBER_COUNTING) 20 # define __QUEX_ASSERT_COUNTER_CONSISTENCY(ME) \ 21 { \ 22 __quex_assert((ME)->_line_number_at_begin <= (ME)->_line_number_at_end); \ 23 } 24 # else 25 /* If only column numbers are counted, then no assumptions can be made about increase */ 26 /* or decrease. If a newline appearse, for example, the column number may decrease. */ 27 # define __QUEX_ASSERT_COUNTER_CONSISTENCY(ME) /* empty */ 28 # endif 29 30 # include "bufferBuffer" 31 32 QUEX_NAMESPACE_MAIN_OPEN 33 34 QUEX_INLINE QUEX_TYPE_LEXATOM* QUEX_NAME(access_Lexeme)(const char* FileName, size_t LineN, QUEX_NAME(Buffer)*); 35 QUEX_INLINE size_t QUEX_NAME(access_LexemeL)(const char* FileName, size_t LineN, QUEX_NAME(Buffer)*); 36 QUEX_INLINE QUEX_TYPE_LEXATOM* QUEX_NAME(access_LexemeEnd)(const char* FileName, size_t LineN, QUEX_NAME(Buffer)*); 37 38 QUEX_NAMESPACE_MAIN_CLOSE 39 40 #endif 41 42 #endif /* __INCLUDE_GUARD__QUEX_LEXER_CLASS_COUNT_LINE_COLUMN_COMMON */ 43