Skip to content

Commit e7fdbf9

Browse files
authored
Update README.md
1 parent 42ea6fa commit e7fdbf9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ val booleanGrammar = object : Grammar<BooleanExpression>() {
2020
(-lpar * parser(this::rootParser) * -rpar)
2121

2222
val andChain = leftAssociative(term, and) { l, _, r -> And(l, r) }
23-
val rootParser = leftAssociative(andChain, or) { l, _, r -> Or(l, r) }
23+
override val rootParser = leftAssociative(andChain, or) { l, _, r -> Or(l, r) }
2424
}
2525

2626
val ast = booleanGrammar.parseToEnd("a & !b | b & (!a | c)")
@@ -246,4 +246,5 @@ val term =
246246
247247
* A boolean expressions parser that constructs a simple AST: [`BooleanExpression.kt`](https://github.com/h0tk3y/better-parse/blob/master/demo/src/main/kotlin/com/example/BooleanExpression.kt)
248248
* An integer arithmetic expressions evaluator: [`ArithmeticsEvaluator.kt`](https://github.com/h0tk3y/better-parse/blob/master/demo/src/main/kotlin/com/example/ArithmeticsEvaluator.kt)
249+
* A toy programming language parser: [(link)](https://github.com/h0tk3y/compilers-course/blob/master/src/main/kotlin/com/github/h0tk3y/compilersCourse/parsing/Parser.kt)
249250

0 commit comments

Comments
 (0)