From 011e8e2ec2d7900d5c8d26f43f3b91999427be61 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Wed, 28 May 2025 10:08:41 +0200 Subject: add readme and licence --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 README.md (limited to 'README.md') diff --git a/README.md b/README.md new file mode 100644 index 0000000..ebed7d7 --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# MRY + +## Grammar Files + +The grammar file needs to be in the following format: + +``` +main -> expression +expression -> binary_operation | number | '(' expression ')' +binary_operation -> expression binary_operand expression +binary_operand -> '+' | '-' | '*' | '/' +number -> digit number | digit +digit -> '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' +``` + +Where all terminals are in single-quotes and the rest are non-terminals. + +> NOTE: +> The default entry point name is always `main` if you want to use +> a different one, use the `-e` or `--entry` option. + +## Running Benchmark + +To run benchmark of your grammar run: + +```sh +$ zig build run --release=fast -- benchmark -i +``` + +Where `` contains test-strings on each line. -- cgit v1.2.3-70-g09d2