Harmonia Infrastructure

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

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 have built a control flow analysis generator for Blender that applies to all languages.

XML Serialization of Syntax Tree Data Structures

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.

Harmonia Version Library

Harmonia's version library provides complete history information for a variety of C++ data types. By overloading the assignment operator, the library maintains a log of all values ever assigned to the variable. The version library is transaction-based, like a database, to enable coherent updates to several instances of versioned data types at a time.

Harmonia uses versioned data types to store the syntax tree and semantic information related to the program source code that a user is editing. The editor can use this information for parser error recovery, as well as to support both temporal (the traditional form) and structural undo.

Harmonia Language Bindings

Harmonia's language kernel is a shared library written in C++. In order to enable programmers writing in various programming languages to connect to Harmonia, we have created a set of language bindings. These bindings export the Harmonia API to programmers of the following languages:


When we release the source code to Harmonia, documentation for the Java API will go here.


When we release the source code to Harmonia, documentation for the Tcl API will go here.

XEmacs Lisp

When we release the source code to Harmonia, documentation for the XEmacs Lisp API will go here.