

x + y * zIt would be useful to be able to write a language module that abstracts the key properties of expression languages so that the module can be reused in different contexts. One of the challenges is to abstract the precedence and associativity rules in order to reflect the following two parse outcomes:
x + (y * z) and (x + y) * zTraditional approaches to parsing often use two approaches: (1) encode the precedence rules into the grammar rules; (2) write the parser so that it knows about certain types of operator. Both approaches have disadvantages: (1) complex grammar rules; (2) complex parsing machinery. The XPL parser, in conjunction with the language module approach, allows this to be achieved fairly painlessly without having to (1) encode the precedence in the rules; or (2) requiring the parser to know about operators.
calculations seek to characterize the concept of what a program does without being prescriptive about how the desired behaviour is achieved. By providing a way of abstractly capturing program behaviour, calculations offer: an approach to program analysis, an approach to designing programs based on the desired behaviour, and a new approach to teaching about programming, [...] calculations are a missing concept in the study and teaching of Computing.A calculation is a historical record of what went on when a program executed with respect to some specific data items. An example calculation showing mutually dependent processing of integer streams is shown on the right. Peter's notes on calculations have been typed up and recently published in the Journal of Higher-Order and Symbolic Computation.
A superlanguage offers the following features: