Skip to content

Instantly share code, notes, and snippets.

@shnewto
Last active November 8, 2017 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shnewto/30dc836aa09420565dcbeef2ecbef4dd to your computer and use it in GitHub Desktop.
Save shnewto/30dc836aa09420565dcbeef2ecbef4dd to your computer and use it in GitHub Desktop.
eerie poem grammar
<poem> ::= <rule1> "\n" <rule2> "\n" <rule3>
<qual> ::= "while" | "as" | "momentarily" | "frozen"
<noun> ::= "he" | "she" | "the shadowy figure" | "the boy" | "a child"
<tverb> ::= "outlines" | "casts toward" | "stares at" | "captures" | "damns"
<iverb> ::= "lingers" | "pauses" | "reflects" | "alights" | "hesitates"
| "turns away" | "returns" | "kneels" | "stares"
<article> ::= "a" | "the"
<adj> ::= "slowly" | "silently" | "darkly" | "with fear"
| "expectantly" | "fearfully"
<ger> ::= "waiting" | "pointing" | "breathing"
<onoun> ::= "sky" | "void" | "abyss" | "star" | "darkness"
| "lake" | "moon" | "cloud"
<clause> ::= "and" " " <iverb> | "but" " " <iverb> | "and" " " <iverb>
| "while" " " <ger> " " <adj>
<object> ::= <article> " " <onoun>
<rule1> ::= <qual> " " <noun> " " <tverb> " " <object>
<rule2> ::= <noun> " " <iverb> " " <clause>
<rule3> ::= <qual> " " <noun> " " <iverb>
@shnewto
Copy link
Author

shnewto commented Nov 8, 2017

Grammar used as an "rsg" benchmark for the Icon programming language. From the brain of Ralph Griswold.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment