Resolver status?

Mar 5, 2009 at 11:24 PM
As I said in a previous post, I am working on an academic project using this parser.  One of my outstanding issues is that I need to resolve types to a fully qualified type name (e.g. "StringCollection" -> "System.Collections.Specialized.StringCollection").  It appears that the Resolver is designed to do that.  Is that right?  It looks like Resolver.cs is a partial implementation.  What is the current status of the Resolver?  Is anyone working on it, or is it currently stalled?  I'd rather not reinvent the wheel, so I'd like to pick up where that work left off if possible.  Please let me know, thanks.

David Thuson

Coordinator
Mar 6, 2009 at 4:26 PM
For basic things I think you can use the QualifiedIdentifier in the type. Not sure how far that will get with generics, but it should work I think.

I'm not sure of the resolver status, sorry.
Mar 10, 2009 at 6:54 PM
Thanks for the reply.  I looked at the TypeNode's "Identifier.QualifiedIdentifer" field (is that the one?), but it doesn't seem to be any different than the "GenericIdentifier" field.  I had thought that if my source contained "Test.Foo" the "GenericIdentifier" would just be "Foo" while the QualifiedIdentifier would be "Test.Foo", but that doesn't seem to be right.  It seems like those two fields are always the same.  I tested that with both a "foreach(Foo f in ...)" and a local declaration like "Foo f = ...;".  Is that unexpected?  How should those differ?

As I'm thinking about it, maybe the Resolver isn't what I need...  I need to know within the context of a particular variable/field declaration, how to turn a type name into a fully qualified type name.  The resolver doesn't seem to make use of the particular location in the tree or a particular unit's using info, etc.  So I seem to be confused about what the resolver does.  How is the resolver intended to be used?

On kind of a related topic, nodes all have a Parent field which seems like it could be really useful to me.  However, the parent is not set until the Resolver runs and unfortunately the resolver bails when it encounters attributes (which I am using at the moment).  Why isn't the Parent field just set during the original parsing?  I haven't quite gotten my head around what the "Resolve" methods are doing, so is the Resolver doing something more complicated with the Parent field than just setting it to let you traverse "up" the AST?  Thanks again for the help, I appreciate it.

David Thulson