Re: cp-name-parser.y

Daniel Jacobowitz
2008-02-29T19:32:52Z

On Fri, Feb 29, 2008 at 02:09:13PM -0500, Aleksandar Ristovski wrote:
> I am looking at that since right now something like this:
>
> -var-create - * "(anonymous namespace)::foobar"
>
> will not work since c_parse doesn't know anything about '(anonymous
> namespace)'. I guess it wouldn't be too hard to hack around this
> particular case, but a proper solution would be preferable.

I wonder what the right thing to do on a statement like that is. The
problem with anonymous namespaces is that we call them all "(anonymous
namespace)", but they're many different namespaces, one for each file
with anonymous namespaces. In that file, you would access the type
as just "foobar". Maybe we should give each anonymous namespace
a different name.

Anyway, cp-name-parser.y isn't a replacement for c-exp.y. It's a name
parser; it accepts both names and types in cases where we don't know
which are which, and it does not support any expressions except when
they can appear inside a template argument. Once you've identified
something as a symbol name then you might hand it off to this parser
to find the canonical form of the name, before searching the symbol
table.

> The issue is evident when using IDE (CDT). IDE will call
> ptype foobar
> which prints type (correctly) something like this: '(anonymous
> namespace)::FooBar' and then IDE uses this string as argument to
> -var-create, but unfortunately, this doesn't work.

(Why are you creating a varobj for a type, anyway?)