Re[1]: [cedet-semantic] added "mutable" for C++
Brought to you by:
zappo
From: Eric M. L. <er...@si...> - 2002-06-04 12:25:12
|
>>> Thomas Maier <T....@ep...> seems to think that: >Hello everybody, > >just found another bug in semantic's c++ part. When I type > >class Foo >{ > mutable int _i; >} > >then semantic doesn't recognize "mutable" as a typemodifier. So I added >%token MUTABLE "mutable" >%put MUTABLE summary "Member Declaration Modifier: mutable <type> <name> >..." > >right below the volatile token and changed the rule for DECLMOD to > >DECLMOD : EXTERN > | STATIC > | CONST > | VOLATILE > | MUTABLE # added > | SIGNED > | UNSIGNED > | INLINE > | REGISTER > | FRIEND > | METADECLMOD > ; > >which is of course a lousy hack. This will accept a mutable declaration >outside a class, which is bogus. But as that is the case for "virtual", >too (although via a different way in the grammar), I thought fixing this >may be part of a larger fix like splitting var-or-fun into parts for >top-level-stuff and inside-class-stuff having some class-DECLMODS and >the like. But maybe overall-strategy is only parse correct code >correctly? And leave everything else to the compiler? Sounds sensible >to me. So what I added would be reasonable, then. [ ... ] That's great. Thanks. You are right that the C/C++ parser does allow errors. It lets the compiler worry about real syntax, and does it's best to be simple (Hah) yet cover most stuff for tagging purposes. Eric -- Eric Ludlam: za...@gn..., er...@si... Home: www.ultranet.com/~zappo Siege: www.siege-engine.com Emacs: http://cedet.sourceforge.net GNU: www.gnu.org |