sheepy

build system (sheepy) and package manager (spm) for C
git clone https://spartatek.se/git/sheepy.git
Log | Files | Refs | README | LICENSE

analyzerMode (2780B)


      1 /* -*- C++ -*-  vim:set syntax=cpp: 
      2  *
      3  * (C) 2004-2010 Frank-Rene Schaefer
      4  * ABSOLUTELY NO WARRANTY              */
      5 #ifndef __QUEX_INCLUDE_GUARD__ANALYZER__MODE
      6 #define __QUEX_INCLUDE_GUARD__ANALYZER__MODE
      7 #ifndef   QUEX_TYPE_ANALYZER
      8 #   error "Macro QUEX_TYPE_ANALYZER must be defined before inclusion of this file."
      9 #endif
     10 
     11 #include "definitions"
     12 
     13 QUEX_NAMESPACE_MAIN_OPEN
     14     
     15 #   if ! defined(__QUEX_OPTION_PLAIN_C)
     16     class QUEX_TYPE0_ANALYZER;
     17 #   else
     18     QUEX_TYPE0_ANALYZER;   
     19 #   endif
     20 
     21     typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG QUEX_NAME(Mode_tag) {  
     22         int                  id;
     23         const char*          name;
     24 
     25 #   if      defined(QUEX_OPTION_INDENTATION_TRIGGER) \
     26        && ! defined(QUEX_OPTION_INDENTATION_DEFAULT_HANDLER)
     27         void (*on_indentation)(QUEX_TYPE_ANALYZER*    me, 
     28                                QUEX_TYPE_INDENTATION  Indentation, 
     29                                QUEX_TYPE_LEXATOM*   Begin);
     30 #       endif
     31         void (*on_entry)(QUEX_TYPE_ANALYZER*, const struct QUEX_NAME(Mode_tag)* FromMode);
     32         void (*on_exit)(QUEX_TYPE_ANALYZER*, const struct QUEX_NAME(Mode_tag)* ToMode);
     33 #       ifdef QUEX_OPTION_RUNTIME_MODE_TRANSITION_CHECK
     34         bool (*has_base)(const struct QUEX_NAME(Mode_tag)* Mode);
     35         bool (*has_entry_from)(const struct QUEX_NAME(Mode_tag)* Mode);
     36         bool (*has_exit_to)(const struct QUEX_NAME(Mode_tag)* Mode);
     37 #       endif
     38 
     39         /* Choose the analyzer function to be the last, because it has a unique
     40          * signature. The function pointers are assigned in a table. If the 
     41          * content of this class changes, any mismatch of pointers is likely
     42          * to trigger a compilation error, thus signalling that the setup is
     43          * incorrect.                                                        */
     44         QUEX_NAME(AnalyzerFunctionP)    analyzer_function;
     45     } QUEX_NAME(Mode);
     46     
     47     QUEX_INLINE __QUEX_TYPE_ANALYZER_RETURN_VALUE
     48     QUEX_NAME(Mode_uncallable_analyzer_function)(QUEX_TYPE_ANALYZER*);
     49 
     50 #   if ! defined(QUEX_OPTION_INDENTATION_DEFAULT_HANDLER)
     51     QUEX_INLINE void
     52     QUEX_NAME(Mode_on_indentation_null_function)(QUEX_TYPE_ANALYZER*, 
     53                                                  QUEX_TYPE_LEXATOM* LexemeBegin, 
     54                                                  QUEX_TYPE_LEXATOM* LexemeEnd);
     55 #   endif
     56 
     57     QUEX_INLINE void
     58     QUEX_NAME(Mode_on_entry_exit_null_function)(QUEX_TYPE_ANALYZER*, const QUEX_NAME(Mode)*);
     59 
     60     typedef struct QUEX_SETTING_USER_CLASS_DECLARATION_EPILOG {
     61         QUEX_NAME(Mode)*  (begin[QUEX_SETTING_MODE_STACK_SIZE]);
     62         QUEX_NAME(Mode)** end;
     63         QUEX_NAME(Mode)** memory_end;
     64     } QUEX_NAME(ModeStack);
     65 QUEX_NAMESPACE_MAIN_CLOSE
     66 
     67 
     68 #endif /* __QUEX_INCLUDE_GUARD__ANALYZER__QUEX_MODE */