Skip to content

DSL ~ DSL Grammar

adinilfeld edited this page May 13, 2021 · 7 revisions

Current Rules

Declaring a Thing (Game, Room, or Item)

For a GAME (one per file), where \n represents a newline character:

GAME START [room id 0] END [room id 1] \n

For example:

GAME FROM reg TO mansueto

For a ROOM:

ROOM [room id] \n

For example:

ROOM reg

For an ITEM in a ROOM:

ITEM [item id] IN [room id] \n

For example:

ITEM doing honest work in college IN reg

Giving a Thing Properties

All things should have properties, which can be declared thusly:

[property]: "[value]"\n

For example:

ITEM doing honest work in college IN reg
             short: "A book."
long: "This is Doing Honest Work in College, baybee! It's the best book — nay, the only book — ever written!"

The parser should support both whitespace treatments, and any statement of [property]: "[value]" on one line.

Ending a Thing

Things should be terminated... somehow. We'd prefer that be done automatically by the parser, but if that's not working out we could throw a little ; or something (dealer's choice) after a thing's last property/value pairing. Please no HTML-style /ITEM tags; people will inevitably forget to use them.

Future Features

Future builds of the DSL should feature:

  • Actions
  • Synonyms
  • Newline-agnosticism
  • Declaring an item without specifying its room
  • Variables
  • Default parameters

Clone this wiki locally