source: src/Parser/ParserTypes.hpp

Candidate_v1.6.1
Last change on this file was aa91de0, checked in by Frederik Heber <frederik.heber@…>, 8 years ago

FIX: size_t definition missing and other fixes.

  • cstddef defines both size_t and NULL.
  • also string include missing.
  • this is in preparation for removing MemDebug include.
  • Property mode set to 100644
File size: 1.5 KB
Line 
1/** \file ParserTypes.hpp
2 *
3 * date: Sep, 27 2011
4 * author: heber
5 *
6 */
7
8#ifndef PARSERTYPES_HPP_
9#define PARSERTYPES_HPP_
10
11// include config.h
12#ifdef HAVE_CONFIG_H
13#include <config.h>
14#endif
15
16#include <cstddef>
17
18#include <boost/preprocessor/seq/elem.hpp>
19#include <boost/preprocessor/seq/seq.hpp>
20#include <boost/preprocessor/seq/size.hpp>
21#include <boost/preprocessor/iteration/local.hpp>
22
23
24#include "ParserTypes.def"
25
26//!> function to print each member of the sequence in the enumeration
27#define sequence_print(z,n,seq) \
28 BOOST_PP_SEQ_ELEM(n, seq) ,
29
30//!> Enumeration of all known parsers
31enum ParserTypes {
32// some proprocessor magic to generate the body from the above sequence
33#if defined ParserTypes_END // do we have parameters at all?
34#define BOOST_PP_LOCAL_MACRO(n) sequence_print(~, n, PARSERSEQUENCE)
35#define BOOST_PP_LOCAL_LIMITS (0, ParserTypes_END-1)
36#include BOOST_PP_LOCAL_ITERATE()
37#undef BOOST_PP_LOCAL_MACRO
38#undef BOOST_PP_LOCAL_LIMITS
39#endif
40 ParserTypes_end = ParserTypes_END,
41 ParserTypes_begin = BOOST_PP_SEQ_HEAD(PARSERSEQUENCE)
42};
43
44#undef sequence_print
45
46//!> Number of known ParserTypes
47const size_t ParserTypesMax = ParserTypes_END;
48
49#include "ParserTypes.undef"
50
51//!> Typedef for enumeration to ease its use
52typedef enum ParserTypes ParserTypes;
53
54/** Increment operator for the enumeration ParserTypes to allow loops.
55 * \param &type value
56 * \return value incremented by one
57 */
58ParserTypes &operator++(ParserTypes &type);
59
60#endif /* PARSERTYPES_HPP_ */
61
Note: See TracBrowser for help on using the repository browser.