You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
beautiful-racket/beautiful-racket-demo/txtadv/parser.rkt

33 lines
667 B
Racket

#lang brag
txtadv-program : verb-section everywhere-section things-section places-section start-section
verb-section : /"===VERBS===" verb-item+
9 years ago
/verb-item : verb-list s-exp
9 years ago
@verb-list : verb [/"," verb-list]
9 years ago
/verb : ID ["_"]
9 years ago
everywhere-section : /"===EVERYWHERE===" id-desc*
things-section : /"===THINGS===" thing-item+
/thing-item : DASHED-NAME id-desc+
places-section : /"===PLACES===" place-item+
/place-item : DASHED-NAME STRING place-items id-desc+
9 years ago
/place-items : /"[" [place-list] /"]"
9 years ago
@place-list : ID [/"," place-list]
start-section : /"===START===" ID
/id-desc : ID s-exp
@s-exp : ID | STRING | nested-s-exp
/nested-s-exp : /"(" s-exp* /")"