Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [imp-dev] API changes to TypeFactory?

Hi,

The fixes in imp.java.core were this:
 - added a new field: TypeStore javaAnalysisTypes = new TypeStore();
   This allocates a new scope for storing type declarations, the idea
is that all Java analysis-related types end up here.
   In the future, this typeStore might import other (reusable) type
stores, or other TypeStores may import this one.
 - to every call to TypeFactory.aliasType, I've added a parameter that
refers to javaTypeAnalysisTypes.
   This makes sure the declarations are stored and also checks for
inconsistencies (like circular aliases, or
   doubly defined aliases).

The code should work as before now.

Cheers,

Jurgen

On Sun, Feb 22, 2009 at 8:01 PM, Jurgen Vinju <jurgen@xxxxxxxxx> wrote:
> Hi Bob,
>
> You're right, I went to fast there. Thanks for pointing it out and sorry!
>
> The intended use of TypeStore is to act as a container for type
> declarations (like a scope).
> Instead of one global store, the API user can now explicitly manage
> type declarations.
> The direct cause of me changing the design is that the static store in
> TypeFactory hampered
> unit testing (the tests could not be made independent), and the change
> also facilitates the
> implementation of the Rascal interpreter.
>
> Most of the types that TypeFactory produces are not necessarily stored
> in a TypeStore,
> however, AbstractDataTypes, ConstructorTypes and AliasTypes have to be
> put in a TypeStore.
> TypeFactory will do this for you when you construct one of these
> types; but you have to provide
> a reference to a TypeStore.
>
> The reason for this is that these type definitions may overlap with
> each other or redefine each-other.
> A TypeStore can detect such anomalies at the earliest convenience
> (fail fast), instead of having
> problems while de-serializing values or combining facts from different
> analyses during a computation.
>
> I'll have a look at org.eclipse.java.core to fix the compiler errors.
> I didn't know - or forgot - there was
> another use of pdb.values next to lpg.analysis.
>
> AnalysisManager did not fully work yet, that's why I decided the
> change wasn't harmful.
> But I think it is good to fix it soon. Could we Skype about it this week?
>
> Jurgen
>
> On Sun, Feb 22, 2009 at 5:38 PM, Robert M. Fuhrer
> <rfuhrer@xxxxxxxxxxxxxx> wrote:
>> Oh, and not to mention that the changes also caused compile errors
>> in org.eclipse.imp.java.core ...
>>
>> Without poking around in the implementations of TypeStore,
>> TypeFactory and others, I don't even know what is the intended
>> design of the new TypeStores, so I can't tell how to fix the problems
>> the changes introduced.
>>
>> On Feb 22, 2009, at 11:33 AM, Robert M. Fuhrer wrote:
>>
>>> Hi Jurgen,
>>>
>>> The changes you made look reasonable in principle (separating out
>>> the type dictionary from the TypeFactory), but I think these kind of
>>> changes should be discussed on the mailing list first.
>>>
>>> In particular, I see that the AnalysisManager is now broken - had I
>>> not happened to look at the code while synching with the repo, I
>>> wouldn't know about the  bogus use of "new TypeStore()" (marked
>>> by a TODO), which, although it compiles, would silently fail to find
>>> types mentioned in an analysis engine's type descriptors (I think).
>>>
>>> That sort of silent breakage is confusing and could be hard to
>>> diagnose...
>>
>> Cheers,
>>  - Bob
>>
>> _______________________________________________
>> imp-dev mailing list
>> imp-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/imp-dev
>>
>


Back to the top