Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 933 Bytes

README.md

File metadata and controls

25 lines (17 loc) · 933 Bytes

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.

Documentation

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);
}

More examples