File tree Expand file tree Collapse file tree 4 files changed +18
-5
lines changed
Expand file tree Collapse file tree 4 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 99#define GRAMMARINATOR_VERSION " 0.0 (unknown)"
1010#endif
1111
12- #ifndef GRAMMARINATOR_GENERATOR
13- #error "GRAMMARINATOR_GENERATOR must be defined"
14- #endif
15-
1612#ifndef GRAMMARINATOR_MODEL
1713#define GRAMMARINATOR_MODEL grammarinator::runtime::DefaultModel
1814#endif
3430#endif
3531
3632#ifndef GRAMMARINATOR_INCLUDE
33+ #ifdef GRAMMARINATOR_GENERATOR
3734#define GRAMMARINATOR_INCLUDE GRAMMARINATOR_GENERATOR.hpp
3835#endif
36+ #endif
3937
4038#define GRAMMARINATOR_STRFY_INTERNAL (MACRO ) #MACRO
4139#define GRAMMARINATOR_STRFY (MACRO ) GRAMMARINATOR_STRFY_INTERNAL(MACRO)
40+
41+ #ifdef GRAMMARINATOR_INCLUDE
4242#include GRAMMARINATOR_STRFY(GRAMMARINATOR_INCLUDE)
43+ #endif
Original file line number Diff line number Diff line change @@ -31,17 +31,21 @@ def build_options_append(cmakeopt, cliarg):
3131 build_options_append ('GRAMMARINATOR_DECODE' , 'ON' if args .decode else 'OFF' )
3232 build_options_append ('GRAMMARINATOR_FUZZNULL' , 'ON' if args .fuzznull else 'OFF' )
3333 build_options_append ('GRAMMARINATOR_GRLF' , 'ON' if args .grlf else 'OFF' )
34- if args .generate or args .decode or args .fuzznull or args .grlf :
34+
35+ if args .generate or args .fuzznull or args .grlf :
3536 build_options_append ('GRAMMARINATOR_GENERATOR' , args .generator )
3637 build_options_append ('GRAMMARINATOR_MODEL' , args .model )
3738 build_options_append ('GRAMMARINATOR_LISTENER' , args .listener )
3839 build_options_append ('GRAMMARINATOR_TRANSFORMER' , args .transformer )
40+
41+ if args .generate or args .decode or args .fuzznull or args .grlf :
3942 build_options_append ('GRAMMARINATOR_SERIALIZER' , args .serializer )
4043 build_options_append ('GRAMMARINATOR_TREECODEC' , args .treecodec )
4144 build_options_append ('GRAMMARINATOR_INCLUDE' , args .include )
4245 build_options_append ('GRAMMARINATOR_INCLUDEDIRS' , ';' .join (os .path .abspath (includedir ) for includedir in args .includedir ))
4346 build_options_append ('GRAMMARINATOR_SUFFIX' , args .suffix )
4447 build_options_append ('GRAMMARINATOR_LOG_LEVEL' , args .log_level )
48+
4549 return build_options
4650
4751
Original file line number Diff line number Diff line change 2020
2121#include " grammarinator/config.hpp"
2222
23+ #ifndef GRAMMARINATOR_GENERATOR
24+ #error "GRAMMARINATOR_GENERATOR must be defined"
25+ #endif
26+
2327namespace {
2428
2529struct {
Original file line number Diff line number Diff line change 2020
2121#include " grammarinator/config.hpp"
2222
23+ #ifndef GRAMMARINATOR_GENERATOR
24+ #error "GRAMMARINATOR_GENERATOR must be defined"
25+ #endif
26+
2327using namespace grammarinator ::runtime;
2428using namespace grammarinator ::tool;
2529using namespace grammarinator ::util;
You can’t perform that action at this time.
0 commit comments