Skip to content

Is there any tool to desugar G4 format to a normal LL(*) format. #3594

Answered by kaby76
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

I learn about that antlr4 is also a variant of LL() parser generator and the LL() grammar cannot deal with left-recursion, even direct left-recursion. The G4 format can express the left-recursive grammar, so there must be some sugar right?

If so, is there any tool to convert G4 format to a non-left-recursive grammar, e.g. LL(*) format.

At one point, I had a tool that removed direct-left recursion using the usual procedure outlined in the Dragon Book. It also converted recursions into kleene closures, which is different than removing direct-left recursion. I can't tell which you are looking for. Unfortunately, I haven't updated the tool when I rewrote the use of Antlr parse trees into so…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
1 reply
@ghost
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant