Assignment 6: A Special-Purpose Language Implementing Programming Languages, 2012 Aarne Ranta (aarne (at) chalmers.se) %!target:html %!postproc(html): #NEW =Summary= The objective of this assignment is to design and implement a query language. The language should cover an adequate set of queries in some domain. The implementation should parse queries and return answers. The solution should include complete source code and documentation, which includes a human-readable grammar, a user manual, and a ``Makefile`` for compiling the system. The syntax can resemble a formal or a natural language, e.g. SQL or English. The implementation can use BNFC or GF. Also an embedded language is allowed, but the host language tools (such as a Haskell interpreter) must be hidden from the user. The expected size of the language is 50--100 abstract syntax rules, thus about three times the size of the language in the book, Section 8.10. It should cover infinitely many different queries. The answering engine can be a database, a web service, or a program such as a mathematical problem solver. ==Functionality== The language should be usable as a shell program, with the following syntax of interaction: ``` $ query "" ``` You are also welcome to deliver it as a web application. But the shell program is needed for testing purposes, because it can easily be scripted. ==Reporting== Your solution must contain the following parts: - the complete source code for compiling and running your program - a ``Makefile``, which enables the compilation of your system by typing ``make`` - a language and system document, which includes - language grammar - examples of queries and their answers You can assume the availability of all the tools called by BNFC, such as parser generators and compilers; these tools should not be included in the submission.