orange
orange copied to clipboard
Create libanalysis for Orange Mini
libanalysis needs to be populated with code that does the following: given a set of Orange Modules, it should check each module for type errors. If the program is well typed, type info should be generated for each module.
Type info has a set of contexts, which contain the types of nodes inside that context. Aside from the global context, a new context is generated for each construct that is generic. Contexts are stored in a hierarchy, since generic functions/classes/etc can be nested.
A context has:
- an id
- the list of types that would resolve the generic class/interface/etc
- the parent id
- the type table for this context
A row in the type table has:
- a node id
- the type of the node
Referencing functions, classes, etc outside of the current Orange Module (e.g., in another file or library) are not added to the type info for the current module, but the types that are returned by those nodes are still used. If those nodes outside of the current module haven't had their types generated yet, they will determined at this point.