KRunner: Linking Rascal with K
Mark Hills, Paul Klint, Jurgen J. Vinju · Data Archiving and Networked Services (DANS) · 2011
Using the K framework [6,15], it is possible to define the semantics of programming languages and language calculii. This includes the semantics of a number of “real-world ” or paradigmatic languages and language subsets, such as Verilog [12], KOOL [8], SILF [6,9], and KERNELC [14], a core of the C language. These definitions have been used for a number of purposes, including to provide semantics-based interpreters, program analysis tools, and verification environments such as matching logic [13]. Like most semantics frameworks, K focuses on assigning semantics to the abstract syntax of a program, not to its concrete syntax. Because of this, the current K tool suite [5,1] provides very little support for language front-ends, instead assuming that programs will be given in (or transformed into) a format easily consumed by Maude [4]. Front-ends are then created on an ad-hoc basis, using a number of different lexers, parsers, and pretty-printers. Graphical front-ends are also not directly supported, meaning that the typical user of a definition either uses Maude directly, uses some other console-based tool (such as an execution script), or uses a custom graphical front-end. This leads to a potentially poor user experience where, for instance, the user needs to work backwards from the given error messages, potentially through the generated version of the program, back to her original program, in order to find the actual source of an error message. This also leads to difficulties in distributing language definitions, which may require a number of tools to be