stubgen icon indicating copy to clipboard operation
stubgen copied to clipboard

namespce is treated as class

Open westfly opened this issue 11 years ago • 3 comments

namesapce a { class B { void fun(); }; }

stubgen will generate void a::B::fun() {}

but it should be namespace a { void B::fun() {} }

westfly avatar Jan 19 '14 03:01 westfly

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.

Sent from my mobile device

On Jan 18, 2014, at 7:27 PM, Ares Young [email protected] wrote:

namesapce a { class B { void fun(); }; }

stubgen will generate void a::B::fun() {}

but it should be namespace a { void B::fun() {} }

— Reply to this email directly or view it on GitHub.

mjradwin avatar Jan 19 '14 15:01 mjradwin

Do you have some plan to fixed this issue. for example, you may ignore namespace or support limited namespace.

westfly avatar Jan 20 '14 12:01 westfly

Based on mjradwin's comment I don't think any fix is planned. You do have the option of fixing the issue yourself, if you think it's worth your time. I would not recommend attempting to achieve full support for C++03 or C++11.

serindonnelly avatar Jan 20 '14 12:01 serindonnelly