Open jnicho02 opened 6 years ago
Can you be more specific? I'm afraid we don't have the time to write a grammar for you! 😊
I thought that might be the case :) ...pls believe me when I say i'm not just a noob asking you to do my homework. Just some first steps at structure that I can build on. My grammar so far is https://github.com/jnicho02/nearley-harlowe/blob/master/harlowe.ne
A Twine text adventure is written in a wiki-like language (perhaps you know of a good example grammar for Wiki that you could point me at?) with extended language that represents variables etc., e.g.
"You have started (set: $status to "started") in a dark room you can [[go north|north]] or [[go south|south]]"
So, I have defined rules to match narrative "You have started", code (set: $status...) and link [[go north...
What is the simplest way to specify that narrative, code, and links can appear in any combination, zero-or-many times?
Something like this perhaps?
A rule is one or more thing
s; a thing
is either a narrative, code, or a link.
rule -> rule thing {% ([xl, x]) => xl.concat([x]) %}
| thing {% id %}
thing -> narrative {% id %} | code {% id %} | link {% id %}
Hi,
i'm working on a parser for the Harlowe language which is used in Twine text adventures. Rules are coming on fairly well, but my overall structure is lacking. Could anyone get me to the next step please?
https://github.com/jnicho02/nearley-harlowe