This is an interpreter for Context-Free Grammars, which are essentially basic procedural text generation rules. A few things to note, all of which are demonstrated in the demo below:
*X instantiates new symbol X if used at start of line, but references existing symbol X if used mid-line.
All possibilities for X come after the "-"
X will choose with uniform randomness between its possibilities, the entries divided by |, when it's written.
A given "possibility" for a symbol can be
A reference to another symbol directly, in which case that symbol will be written as defined.
or
A "terminal", or a fully defined string.
Terminals can contain further symbol references inside angle brackets. If a given terminal does this, it will write out those symbols as per their definition at the point where said symbol was referenced.
Symbol references can be "modified" by adding a period and modifier after the reference inside the angle brackets. There currently exist only a limited set of modifiers, as they each have to be extensively coded by hand to cover edge cases in English grammar.
Current modifiers: .a will correctly prepend a/an depending on reference, .cap will capitalize the first letter, .s will pluralize nouns, .ff will give the symbol a fifty-fifty chance of being included at all, .uncap uncapitalizes the first letter (for some weird cases).
Modifiers can be chained together and will operate as expected: X.a.cap will write symbol X with a/an prepended and capitalized.
DONT CREATE INFINITE LOOPS OF SYMBOLS. You can. Don't do it.
There must be a symbol with the name "S". This will serve as the start symbol for processing, and writing starts at symbol S.
All used characters (|"-*<) are forbidden from symbol names, though only " is forbidden from terminals for the obvious reason.
Starting a line with a forward slash (/) makes that line a comment, i.e. anything can be written there and it won't be processed. Such lines do still have to end with a semicolon though, and thus semicolons are unfortunately a banned character for comments.