mjradwin / stubgen

a member function stub generator for C++
Other
22 stars 6 forks source link

Sized enum parse error #5

Open Archivist062 opened 7 years ago

Archivist062 commented 7 years ago

Parse error on sized enumerations:

enum Type : size_t
{
salsa,mayo,mustard
}
     enum Type : size_t
parse error on ^
mjradwin commented 7 years ago

Thanks for the bug report!

stubgen's parser does not conform to the latest C++ standard. It was developed back in 1998 as a gigantic hack that I created when I was teaching myself lex/yacc. Hacking the yacc grammar further probably isn’t a good idea, since C++ isn’t an LALR(1) language anyways.

At the time it was written it handled C++98 pretty well - but it may not handle C++03 or C++11 well at all.

If you would be interested in adapting the grammar to handle this case, we would gladly accept a pull request.