orangeduck/BuildYourOwnLisp

Reverse Polish notation expressions

Opened this issue · 1 comments

How could I have reverse polish notation expressions in my language?
expr : <number> | <expr>+ <operator> ;
Results in error: Maximum recursion depth exceeded!

You forget ‘(‘ and ‘)’ at the beginning and the end of expr, don’t you?
Since your regex contains left-recursion (https://en.m.wikipedia.org/wiki/Left_recursion), the parser goes into infinite-loop! :(