Closed falkoschindler closed 2 years ago
Does your grammar include anything called class
in it? Owl will give errors for C keywords used in grammars, but not C++ keywords. I'm reluctant to check for C++ keywords by default, since it would unnecessarily restrict people using only C.
Oh, you're right! I thought the word "class" comes from owl, but it's from my grammar. Then I will fix it on my side. Feel free to close this issue. Thanks!
I'm trying to use owl in a C++ project. Therefore I need to include parser.h (at least without implementation) in the main.cpp, where I call e.g.
owl_tree_create_from_string()
. The implementation is included in an almost empty file parser.c. The C++ compiler, however, has trouble parsingparser.h
while compiling main.cpp due to the keywordclass
, which occurs at unexpected places.I fixed the generated parser.h with the following sed command, appending an underscore after every "class":
This is a bit more than necessary, because "class" also occurs as part of longer words. But this fix works.
It might be reasonable to slightly change the naming in 1-parse.h to make it C++ compatible. After all owl works nicely in C as well as C++.