Replies: 7 comments 2 replies
-
|
Quick shot, but please try this grammar: This should make parol able to left factor it into a LL(1) grammar. |
Beta Was this translation helpful? Give feedback.
-
|
It does indeed seem to output another expanded grammar, but it also exceeds the maximum lookahead of 5. |
Beta Was this translation helpful? Give feedback.
-
|
Ok, I will try it 😉 |
Beta Was this translation helpful? Give feedback.
-
|
The problem is the recursion in You have to formulate your grammar like this: |
Beta Was this translation helpful? Give feedback.
-
will work this way too. |
Beta Was this translation helpful? Give feedback.
-
Somehow I think this example would work, but at least it's not an LL(1) grammar. Still, LL(1) parsing seems feasible, but I don't understand how PDA actually works, so I don't know if it is feasible. In the meantime, I'd like to start by taking a peek at the source code. |
Beta Was this translation helpful? Give feedback.
-
|
Yeah, you have basically a recursion at |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to make a LL(1) language, and I've written the following grammar:
parolemits this exceeds the maximum lookahead of 1.Yes, it's not LL(1) because we should look ahead for
->after theExpr, and theExprcan be the infinite size.It's clear in an expanded grammar:
But the production for
! abc -> abcis the following struct:and not something like this:
Given this, it seems to me that LL(1) parsing can actually be done if we defer the lookahead of
->because!already tells us this is aBangExprArrowExpr.Beta Was this translation helpful? Give feedback.
All reactions