Issues with recursion #202
-
I'm currently working on a grammar to parse expressions, which include function calls, and expressions are necessarily recursive. I differentiate beween function names and variable names, function names are identifiers while variable names are one or moreidentifiers seperated by '.' I've got a cut down grammar below which replicates my problem, which is that I'm getting a runtime assert when it is fed
I've looked at the header, scratched my head and I've no idea what I'm doing wrong as I thought Any help is appreciated. The grammar is...
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Fixed it! Changing the condition in
|
Beta Was this translation helpful? Give feedback.
-
You want to use a |
Beta Was this translation helpful? Give feedback.
You want to use a
lexy::expression_production
for that, with a postfix operator:https://lexy.foonathan.net/playground/?id=bTWo1o9jW&mode=tree