From a8bd5e9d85ac9928bd29add82e887f82642af893 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Mon, 31 Jan 2022 09:23:20 +0800 Subject: test/check_cnp: working algorithm I now have a working algorithm in test/check_cnp. It can correctly parse the grammar for an esoteric language called "Brainfuck". This language does not matter. What matters is that it contains parentheses. So this shows that at least for grammars as complex as parentheses, this parser works well. Haha. --- src/brainfuck.bnf | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/brainfuck.bnf (limited to 'src/brainfuck.bnf') diff --git a/src/brainfuck.bnf b/src/brainfuck.bnf new file mode 100644 index 0000000..d714a05 --- /dev/null +++ b/src/brainfuck.bnf @@ -0,0 +1,10 @@ +brainfuck: unit brainfuck +brainfuck: + +unit: '>' +unit: '<' +unit: '+' +unit: '-' +unit: ',' +unit: '.' +unit: '[' brainfuck ']' -- cgit v1.2.3-18-g5258