in reply to Re: Parse::RecDescent grammar that winds its way all the way back to start
in thread Parse::RecDescent grammar that winds its way all the way back to start

But I really hate to recurse like that. If I’ve got a list of two or three hundred job_statements, as I well might, then I’ve obliged the computer to recurse two or three hundred levels deep!
Well, you made the choice of using a recursive descent parser.

They aren't known for making the fastests parses. Considering the number of <commit>s you have in your grammer, can't you use a limited look-ahead parser? (LL(N), LR(N), ...) No recursion nor backtracking is than needed; syntax errors are more quickly discovered, and you may have an easier time resyncing after a parsing error.

  • Comment on Re^2: Parse::RecDescent grammar that winds its way all the way back to start