Syntax in Maude
About syntax in Maude: from the parsing section (se below) in the Maude manual can be had many insights about Maude's syntax and the reasoning behind it. It notably references some work done on ASF+SDF in this area.The constraints in mind for the language based on the semantics:
- Interpreted parsing: languages are user-definable.
- Full Context-Free Grammars (CFG), and not only LALR models.
- With precedence/gathering patterns that modify the grammatical power of nonterminal symbols.
- Grammars are extended to incorporate bubbles. Bubbles are the key notion to implement syntactic reflection. Furthermore, bubble sorts are user-definable.
- Techniques for error detection and error recovery must be supported.
- Efficiency is a main goal, as the parser is the surface of the rest of the system, especially in META-LEVEL computations.
Essentially, the Maude grammar (the meta-parsing system) allows the definition of terms in a mixfix fashion with precedence-ordering hints.
This allows infix, prefix, postfix, and generalized context-free grammar templates (even IF _ THEN _ ELSE _ END
is supported), which allows you to adapt the maude syntax to someone else's notion of natural syntax much more easily.
Maude's very strong module system also means that these syntaxes can be very location-specific, and only imported on demand, so the conflict frequency of differing syntaxes for similar operations is minimized naturally.
All of these combine to make an effective modelling and execution framework for domain-specific languages, with specification modules supporting the desired object/semantics model.
- The parsing section in the Maude manual.