See this page.đź•— It contains instructions for each production that needs to be converted:
From EBNF to BNF
For building parsers (especially bottom-up) a BNF grammar is often better, than EBNF. But it’s easy to convert an EBNF Grammar to BNF:
- Convert every repetition
{ E }
to a fresh non-terminalX
and addX = ε | X E.
- Convert every option
[ E ]
to a fresh non-terminalX
and addX = ε | E.
(We can convertX = A [ E ] B.
toX = A E B | A B.
) - Convert every group
( E )
to a fresh non-terminalX
and addX = E.
- We can even do away with alternatives by having several productions with the same non-terminal.
X = E | E'.
becomesX = E. X = E'.
whoah this blog is wonderful i really like reading your articles. Keep up the great paintings! You realize, a lot of people are hunting round for this info, you could help them greatly.
I have read so many posts about the blogger lovers however this post is really a good piece of writing, keep it up