Update PEG

This commit is contained in:
Dane Johnson 2022-01-24 13:57:22 -06:00
parent 369f90a68d
commit 34f2436999

View File

@ -17,9 +17,11 @@ Requirements:
3. Both story-writing and story-interaction tools need to be cross platform and relatively straightforwards for
a non technical user to operate.
Story language PEG: (with apologies, this is my first PEG)
Story language PEG:
Story <- BlankLine* Page+ EndOfFile
Story <- BlankLine* Title Attribution Page+ EndOfFile
Title <- (!Attribution .)+
Attribution <- (!Newline .)+ Newline
Page <- Header Body BlankLine*
Header <- Identifier Newline BlankLine*
Identifier <- [A-Z][A-Z0-9_]*
@ -38,18 +40,6 @@ BlankLine <- Spacing Newline
Spacing <- (' ' / '\t')*
Newline <- '\r\n' / '\r' / '\n'
Story language CFG:
story : pages <<EOF>>
pages : pages page | <<EPSILON>>
page : ID FREETEXT footer
footer : "THE END" | "GOTO" ID | choices
choices : choices choice | choice
choice : INT ')' FREETEXT maybe-skillcheck redirect maybe-skillchange
redirect : '[' ID ']'
maybe-skillcheck : '<' SKILL INT op '>' | <<EPSILON>>
maybe-skillchange: '(' op INT SKILL ') | <<EPSILON>>
Work log:
12/13/21