Reputation: 133
I had a question while I was studying for my university project. I found out about the grammar of BNF and EBNF by searching the internet.
(1) I need to convert this phrase to EBNF.
<id> ::= <letter> | <id><letter> | <id><digit>
So I did this conversion.
<id>::= <letter>( <letter> | <digit> )*
Is this grammar is correct, but also how can I express it with a syntax diagram?
(2) Conversely, how can I change this EBNF to BNF?
<complex sentence> ::= ‘{’ <sentence> { <sentence> } ‘}’
There were many ways to convert from BNF to EBNF on the Internet, but I felt that I lacked information on how to convert EBNF to BNF. I also want to know how this is represented by a syntax diagram.
Upvotes: 0
Views: 395
Reputation: 257085
I don't believe that EBNF uses angle brackets (<
, >
).
id ::= letter ( letter | digit )*
And with Railroad Diagram Generator:
Upvotes: 1