Child pages
  • Main rule syntax
Skip to end of metadata
Go to start of metadata

Glossary:

  • syntax - definition of some syntactical construct allowed in language
  • Sequential syntax - syntax that match sub-syntaxes one after another
  • Alternative syntax - syntax that match one of the subsyntaxes
  • Extensible syntax - syntax to which more alternatives can be added externally. Extensible sequential syntax is represented as extensible alternative syntax with exactly one alternative defined.
  • Sealed syntax - syntax that cannot be extended (default)
  • Nested syntax - syntax nested into some other syntax. It is purely name resolution and scoping construct, it doesn't influence formal grammar/parsing. Useful for defining subsyntax used in a number of alternatives, decomposing complex rules, etc.
  • QSN - Qualified Syntax Name, full name of the syntax including namespace, module name, and all outer syntax names down to parent, and own short name.
  • FQN - Fully Qualified Name, full name for CLR type, e.g. AST node type, includes namespace, outer type names, and own short name.
    See Node type generation for more information on QSN and FQN.

Examples of nested rule extensions

Short version of the same syntax

Object declaration in short form above can be inlined:

But it is hardly more readable... Or like this one-liner which is all the same except pretty-printing?

  • No labels