Kiama Language Processing Library
The Kiama project is developing a language processing library in the Scala programming language. Typical application domains for Kiama are compilers and interpreters for programming languages, code refactoring in integrated development environments, static code analysis, program transformation and natural language processing.
Language processing applications have often been approached using using automatic generation tools. For example, lexing and parsing components are often generated from regular expressions or context-free grammars by tools such as Flex, YACC, Bison, ANTLR and JavaCC. Using generators means that a correct implementation can be obtained easily from a problem description that is relatively close to the problem itself. Unfortunately, generators imply a learning curve, don't solve the whole problem, and integrating them with the rest of the development process can be hard (e.g., for debugging). Therefore, many developers resort to a hand-coding approach and thereby give up the benefits that higher-level approaches and tools can give.
The Kiama approach to this situation is to embed language processing facilities in a high-level language library. By providing appropriate abstractions suitable for language processing, including grammars, rewriting rules and tree attribution, Kiama allows developers to concentrate on their problem, but still integrate easily with hand-written code. Scala is a powerful language with a combination of object-oriented and functional features that are ideal for developing this kind of library.
Sloane, A. M., Roberts, M., and Hamey, L. G. C. 2014. Respect Your Parents: How Attribution and Rewriting Can Get Along. International Conference on Software Language Engineering (SLE). 191-210. PDF
Sloane, A. M. and Roberts, M. 2014. Domain-specific program profiling and its application to attribute grammars and term rewriting. Science of Computer Programming. 96, 488-510. PDF
Premaratne, S., Sloane, A. M., and Hamey, L. G. C. 2013. An Evaluation of a Pure Embedded Domain-Specific Language for Strategic Term Rewriting. In Formal and Practical Aspects of Domain-Specific Languages, IGI Global. PDF
Kats, L. C. L., Sloane, A. M., and Visser, E. 2009. Decorated Attribute Grammars: Attribute Evaluation Meets Strategic Programming. International Conference on Compiler Construction. 142-157. PDF
The Kiama software is released under the open source Mozilla public license. More information including documentation and source downloads can be found at the Kiama project site. Binary distributions of Kiama are available on Maven Central.