Quantcast
Channel: What are some non-CS concepts that can be defined using BNF notation? - Computer Science Educators Stack Exchange
Viewing all articles
Browse latest Browse all 5

Answer by Peter Taylor for What are some non-CS concepts that can be defined using BNF notation?

$
0
0

The literary arts are full of structured strings. The main problem there is finding ones which have sufficiently interesting structure. E.g.

play ::= act+
act ::= scene+
scene ::= (stage-direction | line)+
stage-direction ::= "Enter" actor+ | "Exit" actor+
...

Gypsy Spellweaver helpfully points out that this can be elaborated to incorporate even more structure as

play ::= act ( act* [intermission act+] )*

although you may want to distinguish between play (the text) and play-performance (which may have intermissions) and use that as an illustration of sharing rules between grammars.


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images