How to represent {} in EBNF syntax parse tree

16 views Asked by At

id := < letter > { < letter > | < digit > } is this id valid a1bb2 I think it is but I am unsure does the {} means repetition of either letter or digit or it can be both also how would the representation look like for the parse tree?

                          <id>
                       /        \
                 <letter>  {<letter> | <digit> }
                    |        /       |       |     \
                    a    <digit> <letter> <letter>  <digit> 
                            |        |        |        |
                            1        b        b        2
0

There are 0 answers