1

I'm trying to learn the language Inform 7 and its very odd programming model.

Unfortunately I'm finding it hard to get my head around it because the language reads so much like natural English. I can't seem to intuitively understand what natural English statements are and aren't valid statements within the grammar.

Has anyone presented the Inform 7 grammar in EBNF form? I think that might make it a lot easier for me to understand.

2
  • Interesting. I wonder if this is a common problem. If so, it seems like the whole driving principle behind inform 7 was counterproductive Aug 25, 2016 at 12:25
  • 1
    @BenAaronson it's entirely possible I've just done too much study of language design and read ENBF more easily than english. I can't imagine the target audience of "writers" have this problem.
    – Racheet
    Aug 25, 2016 at 13:46

1 Answer 1

3

There is a BNF grammar in Chapter 19 of the manual, presented by the authors of Inform with the qualification that it’s “doubtful that BNF is such a good tool for a natural-language system”.

This is what it looks like:

<rule> ::= 
  Definition : A/an <kind> is <new adjectival name> if/unless <definition> 
  | <preamble> : <phrases> 
  | <preamble> , <phrase> (* only allowed for a few cases: see below)

<definition> ::= 
  <condition> 
  | its/his/her/their <value property name> is/are <value> or less/more 
  | : <phrases>

<preamble> ::= 
  To <phrase template> 
  | To decide if/whether <phrase template> 
  | To decide which/what <kind of value> is <phrase template> 
  | This is the <rule name> 
  | [[A] Rule for] <circumstances> [(this is the <rule name>)]

<circumstances> ::= 
  At <time> 
  | When <event name> 
  | [<placement>] <rulebook reference> [while/when <condition>] [during <scene name>]
  <rulebook reference> ::= 
  <rulebook name> [about/for/of/on/rule] [<action pattern>] 
  | <object-based-rulebook name> [about/for/of/on/rule] [<description>]

<placement> ::= 
  a/an 
  | [the] first 
  | [the] last

<phrases> ::= 
  <phrase> 
  | <phrases> ; <phrase>
1
  • Do you have a link for the manual? I can only find Writing with Inform, Recipe Book and I7 Handbook, none of which contain that.
    – Karol S
    Aug 22, 2023 at 23:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.