Home

Awesome

Uranium


Uranium is a semantic analysis framework. It is used to implement the semantic analysis stage of a compiler or interpreter: typing, building lexical and dynamic scopes, verifying and deriving other properties of interest at compile time.

Uranium works in a manner reminiscent of attribute grammars: it provides support for the computation of attributes on the nodes of an AST (Abstract Syntax Tree) - or really any set of objects, for that matter. These attributes may be interdependent, and a large part of Uranium's value-added is that it lets you specify these dependencies and how to compute attribute values from the value of dependencies, then automatically manages the propagation of dependencies.

Uranium is the perfect complement to Autumn, my parsing library.

You can see an example of Uranium in action in the demo language Sigh (SemanticAnalysis.java, SemanticAnalysisTests.java), and here is a code review of that code.

Key Concepts

(Rough draft for now.)

Be sure to check out the javadoc pages for Rule and Reactor which contains crucial information on how to use the framework.

Your implementation of semantic analysis can be unit-tested using the UraniumTestFixture class.