mpah
Joined: 18 Jul 2005 Posts: 29 Location: UK
|
Posted: Thu Jul 21, 2005 3:42 am Post subject: welcome to the language machine |
|
|
The Language Machine is a toolkit for language and grammar - software that:
- gives you the ability to play directly with unrestricted grammars, using a single notation to create rules, variables and actions that analyse, transform and respond to streams of incoming symbols
- is radically different from the traditional toolsets in which a patchwork of different components with different notations only do part of the job
- can be used on its own and as an extension for other free software to create powerful tools for every kind of textual and linguistic analysis
- is written in the D language, with an easy interface for calling external procedures in C and D
- is licensed under the Gnu GPL
The Language Machine consists of:
- a shared library written in D
- an absolutely minimal main program
- a metalanguage called lmn
- metalanguage compilers that compile lmn in different ways
- an interface to tcc, the tiny C compiler
- several examples that include a d-to-d translator
- the ruleset that creates the project's web
As a project, the Language Machine
This is grammar for all:
Some possible projects and directions:
- talk nicely to the whole xml world
- create an interface with Gnu gcc4 code generators
- get into the loop with servers and browsers
- ...
The basic idea: the language machine uses rules that
- recognise sequences of symbols
- substitute sequences of symbols
- build translations as sequences of symbols
- reanalyse the translations as needed
- include actions and side-effects
- are triggered in hope of resolving a mismatch
where a symbol is
- either a unique value that comes from 'out there'
- or a unique value that represents an idea in the grammar
and a rule has
- a left-side - the pattern it recognises
- a right-side - the pattern it subsitutes
- a priority value
- properties that determine when it is used
How does it work?
- A mismatch occurs when the current symbol on the left-side is not the same as the current symbol in the actual or substituted input stream.
- Rules that are relevant to the mismatch are tried, in the hope that one of them may help to resolve the mismatch by recognising and consuming some input, or by enabling some other rule to resolve it.
- The left-side recognition phase of one rule may be nested in the recognition phase of another.
- The right-side substitution phase of one rule may be nested in the substitution phase of another.
- The symbols that belong in the grammar can only be encountered after some rules have succeeded.
- Grammatical structure and logic is produced by the nesting of rules and by rules that can only succeed if some other rules have produced the symbols they need.
- The whole thing can be understood by looking at this lm-diagram, which shows what happens when rules of this kind are applied.
Have fun.
Peri _________________ The Language Machine - a toolkit for language and grammar |
|