Let's focus on the following parts with the following assumptions,
- any identifier having an Uppercase initial character is a Terminal (
Misc,CharData,Reference,CDSect,PI,Comment) - otherwise (lowercase initial character), a nonterminal (
document,prolog,element)
[1] document ::= prolog element Misc*
[39] element ::= STag content ETag
[43] content ::= CharData? ((element | Reference | CDSect | PI | Comment) CharData?)*
I want to write it into an operator precedence grammar. But I failed to complete the rule content. How can I define it?
document : prolog element
| prolog element misc
;
misc : misc Misc
| Misc
;
element : STag ETag
| STag content ETage
;