coregrammars 0.1.2

Grammars containing core language features, for creating DSLs and embedded languages


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

coregrammars

A collection of basic grammars in D / pegged compiled as modules.

Tu use

import coregrammars.gen.json;

enum input = `
{
"Number": 42,
"Decimal": 123.456,
"String": "abc",
"NullString": "",
"Escape": "\uAAAA\n\\Hello",
"Array" : [0,1,2],
"Array2": [0, [0,1,2], "abc"],
"Obj"   : { "Member":0, "Member":[0,1,2] },
"True"  : true,
"False" : false,
"Null"  : null,
"Empty" : {}
}`;

enum nodes = JSONGrammar(input);

And so on for the other grammars.

Here is the list of grammars:

  • Expressions: basic expressions such as strings, numbers and arithmetic
  • INI
  • JSON
  • Markdown

To regenerate the modules, run dub run -c modgen.

Authors:
  • Mark Fisher
Dependencies:
pegged
Versions:
0.3.0 2024-Mar-04
0.2.2 2024-Feb-22
0.2.1 2023-Feb-10
0.2.0 2023-Feb-02
0.1.6 2023-Jan-14
Show all 12 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 1 downloads this month

  • 43 downloads total

Score:
0.6
Short URL:
coregrammars.dub.pm