sdpc 0.1.1

Stupid D parser combinator


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:

sdpc

build statuscodecov

sdpc is a set of very simple, deterministic parser combinators. You can using these combinators to build deterministic parsers for unambiguous grammar without left-recursion.

Because of the determinism, each parser should return a single ParseResult, and indicate the next input position via modifing the input Stream variable.

Example

import sdpc;

@safe ParseResult!(string, void, ParseError!string) parse_parentheses(string i) {
	return many!(between!(token!"(", parse_parentheses, token!")"), true)(i);
}
void main() {
	auto i = "(())()(()())";
	assert(parse_parentheses(i).ok);
}
Authors:
  • Yuxuan Shui
Dependencies:
none
Versions:
0.1.1 2017-Mar-24
0.1.0 2017-Mar-23
~master 2019-May-23
~mite 2018-Mar-15
~allocator 2017-May-15
Show all 5 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 233 downloads total

Score:
0.9
Short URL:
sdpc.dub.pm