Skip to content

Instantly share code, notes, and snippets.

@scott2b
Created June 26, 2012 14:48
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 scott2b/2996216 to your computer and use it in GitHub Desktop.
Save scott2b/2996216 to your computer and use it in GitHub Desktop.
Super rough draft pass at a grammar for Fountain, for discussion purposes only
<GT> :: = '>'
<capchar> ::= 'A' | 'B' | .... | 'Z'
<lowerchar> ::= 'a' | 'b' | .... | 'z'
<punc> ::= '.' | ',' | ....
<WS> ::= ' ' | <TAB>
<TO> ::= 'TO:'
<DOT> ::= '.'
<LP> ::= '('
<RP> ::= ')'
<intext> ::= 'INT' | 'EXT' | 'INT/EXT'
<daynight> ::= 'DAY' | 'NIGHT'
<stringchar> ::= <capchar> | <lowerchar> | <WS> | <punc>
<capstringchar> ::= <capchar> | <WS> | <punc>
<string> ::= <stringchar>+
<capstring> ::= <capstringchar>+
<line> ::= <string> <EOL>
<blank-line> ::= [<WS>] <EOL>
<document> ::= [<title-page>] <scene>+
<scene> ::= <scene-heading> <block>+
<scene-heading> ::= <DOT> <capstring> | <intext> <DOT> <capstring> <daynight>
<block> ::= (<transition> | <dialogue-block> | <action>) <blank-line>
<transition> ::= ( <GT> <text> | <text> <TO> ) <EOL>
<dialogue-group> ::= <dialogue-part>+
<dialogue-part> ::= <character> | <parenthetical> | <dialogue>
<character> ::= <capstring> <EOL>
<parenthetical> ::= <LP> <string> <RP> <EOL>
<dialogue> ::= <string> <EOL>
<action> ::= <line>+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment