Closed jafl closed 3 years ago
The option does what it says: it names the lexer class. It does not claim that code will be separable, since you'll need C++ namespaces for that or use option -P
to specify a prefix.
There is also no problem to include header files in practice. They do specify the options used, which will be undef-defined if multiple header files are included. In between these includes, you can extract the REFLEX_OPTION
value's you need, if any.
I can only see that perhaps -P
should apply to REFLEX_code_INITIAL
-> REFLEX_PREFIX_code_INITIAL
, since it needs to be globally accessible when -P
is used instead of C++ namespaces.
That would work. It would have to be for all of them, however, not just INITIAL
. I have multiple lexers in the same program that have the same state names.
Fixed.
This doesn't work for me because the symbol
reflex_code_INITIAL
is defined asextern
in the generated source, and every lexer has it. Only by using namespaces can I successfully run the linker.