Indirect Left Recursion #8

yfeldblum opened this Issue Nov 16, 2010 · 1 comment


None yet

2 participants


Very cool.

Does this implementation support indirect left recursion? There is a paper on implementing indirect left recursion in a packrat parser at:

mjackson commented Jan 1, 2011

Citrus doesn't currently support left recursion, but there's no reason it couldn't given the research that you linked to. In fact, I recently refactored both of Citrus' scanner classes (Citrus::Input and Citrus::MemoizedInput) to use an apply_rule method that looks very similar to the Apply-Rule procedure mentioned in the paper. Should just be a matter of detecting when rules are left recurring and reacting appropriately. This could be added into MemoizedInput to prevent those who don't need support for left recursion from experiencing a decrease in performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment