Commit 79444fc9 authored by Anya Helene Bagge's avatar Anya Helene Bagge 🦆
Browse files

Update README.md

parent 28ed6cac
......@@ -167,4 +167,4 @@ str: "Say hello to world!"
## Expresssions
For a more interesting example, have a look at `inf225/grammars/Expr.rsc` and `inf225/examples/ExprExample.rsc`, which define a very simple language for prefix expressions with a single operator (`+`). The recursive `eval` function is used to evaluate the expressions: literal numbers are translated to integers, and the plus operator recursive evaluates its arguments and adds them together. Try improving it by adding more operators!
*(This implementation has some issues with missing restrictions on the `NUM` tokens, which you might notice if you try `eval(parseExpr("+ 12"))` or try to parse `+ 1234`. To fix this, we have to add precede/follow restrictions (`… !<< … >>! …`, similar to the case for `Id`).
*(This implementation has some issues with missing restrictions on the `NUM` tokens, which you might notice if you try `eval(parseExpr("+ 12"))` or try to parse `+ 1234`. To fix this, we have to add precede/follow restrictions (`… !<< … >>! …`, similar to the case for `Id`). )*
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment