Child pages
  • VoidRule

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Code Block
syntax VoidRule = RuleAttributes "void" Name "=" RuleExpression SimpleRuleBody;

Its main purpose is to describe the rules that recognize minor grammar entities, such as space characters (whitespace, tab, end-of-line) and comments.

Since Nitra automatically inserts whitespaces by default, the two void rules – s and S – are usually required. The s rule should recognize minor characters (space and comments). The S rule should be similar to s and in addition it should contain a predicate that verifies that incoming flow of characters doesn’t contain the characters identical to identifier characters of the processed language.

S is placed after a keyword described with literals locally in the grammar.

Code Block
void S = !IdentifierPartCharacters s;
void s = IgnoreToken*;

See also

RuleAttributes
Name
RuleExpression
SimpleRuleBody