Revision 430770b0fb499a65fbdd0371c281303647db9bd9 authored by dependabot[bot] on 11 April 2022, 20:06:33 UTC, committed by GitHub on 11 April 2022, 20:06:33 UTC
Bumps `antlr.version` from 4.9.3 to 4.10.

Updates `antlr4-runtime` from 4.9.3 to 4.10
- [Release notes](https://github.com/antlr/antlr4/releases)
- [Changelog](https://github.com/antlr/antlr4/blob/master/CHANGES.txt)
- [Commits](https://github.com/antlr/antlr4/compare/4.9.3...4.10)

Updates `antlr4-maven-plugin` from 4.9.3 to 4.10
- [Release notes](https://github.com/antlr/antlr4/releases)
- [Changelog](https://github.com/antlr/antlr4/blob/master/CHANGES.txt)
- [Commits](https://github.com/antlr/antlr4/compare/4.9.3...4.10)

Updates `antlr4` from 4.9.3 to 4.10
- [Release notes](https://github.com/antlr/antlr4/releases)
- [Changelog](https://github.com/antlr/antlr4/blob/master/CHANGES.txt)
- [Commits](https://github.com/antlr/antlr4/compare/4.9.3...4.10)

---
updated-dependencies:
- dependency-name: org.antlr:antlr4-runtime
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.antlr:antlr4-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.antlr:antlr4
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
1 parent 06a69f6
Raw File
McKeemanForm.g4
// https://www.crockford.com/mckeeman.html

grammar McKeemanForm;

grammar_
    : rule_ (Newline rule_)* EOF
    ;

Space
    : ' '
    ;

Newline
    : '\r'
    | '\n'
    | '\r\n'
    ;

Name
    : [a-zA-Z_]+
    ;

Indentation
    : '    '
    ;

rule_
    : Name Newline nothing? alternative+
    ;

nothing
    : Indentation '"' '"' Newline
    ;

alternative
    : Indentation item (Space item)* Newline
    ;

item
    : Name
    | Singleton
    | range_ exclude?
    | String
    ;

Singleton
    : '\'' . '\''
    | '\'' HexCode '\''
    ;

fragment HexCode
    : '1' '0' Hex Hex Hex Hex
    | Hex? Hex Hex Hex Hex
    ;

fragment Hex
    : [0-9a-fA-F]
    ;

range_
    : Singleton Space '.' Space Singleton
    ;

exclude
    : Space '-' Space (Singleton | range_) exclude?
    ;

String
    : '"' .*? '"'
    ;
back to top