Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [imp-dev] Connecting PDB to IMP discussion

My responses below...

On Nov 25, 2009, at 4:01 AM, Jurgen Vinju wrote:
Hi,

On Tue, Nov 24, 2009 at 3:08 PM, Robert M. Fuhrer
<rfuhrer@xxxxxxxxxxxxxx> wrote:
Ok, for reference resolution, silly me, of course you're right - and the
schema "map[loc, loc]" could be considered a composition of the
IReferenceResolver API with the ISourcePositionLocator API.

yup.

That said, the schema "map[loc, loc]" is still so generic that it could mean
many things, so if the hyperlink controller simply looked for a fact of the
schema "map[loc, loc]" for the given language, it could pick up relations
that aren't really ref => def. Another example is "rel[loc, loc]", which is
basically the signature of "mark occurrences", which by design permits
multiple interpretations.

It's a matter of adding more naming. Either we add a 'String
getName()' method  to IFactGenerator, such
that we can lookup by name, or we use a type alias to document which
interpretation
for map[loc,loc] we intended. E.g.

type SourceReferenceMap = map[loc, loc];  (In Java:
typeFactory.aliasType("SourceReferenceMap",
typeFactory.mapType(typeFactory.locationType(),
typeFactory.locationType()))

Now we can look up the corrrect IFactGenerator by searching for
SourceReferenceMap, which is just a map[loc,loc].

Ok, great; I wasn't sure whether named aliases were still supported and had the same shape as in earlier drafts of the PDB.

Of course, I'd also like to have a SourceReferenceRelation as soon as
the IMP reference resolving feature can deal with multiple targets.

I'm not sure the reference resolver should support multiple targets - it's intended to go from ref to declaration, and hopefully there's only one declaration of any given entity. I can't think offhand of a language that has multiple *declaration* sites for a given entity. Though if there really are such languages, we could certainly change the IReferenceResolver API to handle that. The UI would presumably pop up a menu allowing the user to select the appropriate destination, if there's a choice.

But perhaps we could define an extension point in pdb2imp that identifies
the specific fact ID to use for, e.g., hyperlinking (or perhaps reference
resolution?), for a given language. Then the developer only writes a tiny
bit of XML to hook things up.

Lovely!

--
Cheers,
  - Bob
-------------------------------------------------
Robert M. Fuhrer
Research Staff Member
Programming Technologies Dept.
IBM T.J. Watson Research Center

IMP Project Lead (http://www.eclipse.org/imp)
X10: Productivity for High-Performance Parallel Programming (http://x10-lang.org)


Back to the top