The language machine is a toolkit for language and grammar that is published by PeriHankey under the Gnu GPL at http://languagemachine.sourceforge.net. As can be seen from http://languagemachine.sourceforge.net/lambda.html, the language machine is in effect an engine for functional and grammatical evaluation which contains the capabilities of the LambdaCalculus and adds the ability to apply unrestricted rules for recognising and substituting grammatical sequences. The key components are *a grammatical engine *a MetaLanguage called lmn (LmnLanguage) *a MetaLanguage compiler The grammatical engine is written in DeeLanguage, and the lmn MetaLanguage is written in LmnLanguage. There are descriptions and examples at the website. The key features of the system are *the grammatical engine applies rules to analyse and respond to a stream of input symbols *each rule has a left-side and a right-side *the left-side of a rule describes a pattern to be recognised *the right-side of a rule describes a substitution for what was recognised *both left- and right-sides of a rule can include any number of symbols and side-effect actions *either side of a rule can usefully be empty The symbols that can occur in the left- and right-sides of rules are *terminal symbols that can occur in the external input stream *lexical symbols which represent sets of terminal symbols *nonterminal symbols which can occur only within rules Applying a rule involves *a triggering event - a mismatch between a goal symbol and an input symbol *a recognition phase in which the left-side is matched *a substitution phase in which the right-side is substituted as if it had appeared in the input Because mismatch events typically occur during the recognition phase of a rule application, the recognition phases of rules tend to be nested within each other. Substitution phases tend also to be nested. You can tell a great deal about the workings of an analysis by looking at the way nested recognition phases overlap with nested substitution phases, and this can be displayed in a diagram which is explained at http://languagemachine.sourceforge.net. The lmn language allows rules to be written so that they can be related to specific classes of mismatch event. When a mismatch event occurs there is a limited number of alternative rules available for resolving the mismatch, and these are tried in turn and in a predictable order. So the language machine has a systematic way of dealing with partial ambiguity, and can be made reasonably efficient. The side-effect actions in rule left- and right-sides can include assignments, conditionals, loops, and calls on external procedures, and they can also construct and transmit transformed representations of material that has been analysed. The value of a variable can itself be a deferred sequence of symbols and actions, and variable references can produce material to be matched as part of the left-side of a rule, or material to be substituted as part of the right-side of a rule. In effect, the language machine directly implements a parser which applies unrestricted grammatical rules. But it turns out that there is a strong relationship between this difficult concept and the much better understood concept of a macro processor - one that happens to recognise and substitute grammatical patterns. And it also turns out that perfectly ordinary rules which directly represent and evaluate the LambdaCalculus are a subset of the rules that can usefully be applied by the language machine. ---- CategoryProgrammingLanguage