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-demo/parser.rkt

33 lines
675 B
Racket

#lang brag
6 years ago
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* /")"