Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adopt extended backus-naur form #7

Open
4 tasks
tanner0101 opened this issue Mar 21, 2019 · 0 comments
Open
4 tasks

adopt extended backus-naur form #7

tanner0101 opened this issue Mar 21, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@tanner0101
Copy link
Member

tanner0101 commented Mar 21, 2019

LeafKit should consider officially adopting an EBNF describing its syntax. This could help new users understand the language and help contributors write tooling.

I've taken a first stab at writing the EBNF, but it's not perfect yet.

template     = { text | tag };
tag          = tag start, [ identifier ], [ params ], has body;
has body     = ":";
func         = identifier, params;
number       = { digit };
string       = '"', { text - '"' }, '"';
identifier   = character, { character | digit | "_" };
params       = params start, [ param, { param delim, [ space ], param } ], params end;
param        = identifier | func | string | number;
param delim  = ",";
params end   = ")";
params start = "(";
text         = { ascii | tag escape } - tag start;
tag escape   = "\#";
tag start    = "#";
character    = ? a...z | A...Z ?;
digit        = ? 0...9 ?;
ascii        = ? any byte ?;
space        = " "

A couple of things left to nail down:

  • String escaping
  • Supported identifier syntax
  • White space
  • Declarations of basic types like character, digit, ascii, etc
@tanner0101 tanner0101 added the enhancement New feature or request label Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant