Harmonia

Harmonia Language Kernel

Harmonia's language kernel is a shared library that consists of an incremental lexer (built on top of Flex), an incremental parser (both LALR(1) and GLR grammars are supported), and a framework for supporting semantic analyses. In addition to analysis, the language kernel contains a class hierarchy for syntax tree nodes, as a set of tree node filters, used to customize views of the parse tree for particular applications. Syntax trees may be serialized to disk using XML (as well as read back in with all their version information). Finally, to support presentation by a program editor, a language-independent, incremental, interactive pretty printer is included that reads its specifications in XML.

Program Analyses

(John Nguyen, Ryan Stejskal)

While Harmonia provides support for building language-based tools and services, it does not currently support any program analyses that are usually performed for optimization purposes, such as computing control flow, dominators, strongly-connected components, and data flow, reaching definitions, available expressions, live variables, copy propagation, constant propagation, partial redundancy, def-use, dependence analysis (could be used to show program slicing), alias analysis, and dead-code identification (to name a few).

We think that some of these analyses could be made useful not only for compilation, but also for providing interesting services to the programmers. (Program slicing is well-known example, but there are others.)

We have built a control flow analyis for C, and are currently building a control flow analysis generator for Blender to apply to all languages.


XML Serialization of Syntax Tree Data Structures

(Dmitriy Ayrapetov, Jim Leek)

The Harmonia framework uses fairly sophisticated internal data structures to represent program syntax trees. We would like to enhance the framework with the ability to serialize these data structures to XML file for the purposes of saving them across Harmonia sessions.

We have completed serialization routines for our primitive data structure library and are now working on the XML serialization code for the rest of the framework.