From: Jason Self Date: Thu, 30 Jul 2015 21:24:36 +0000 (-0700) Subject: More doc updates X-Git-Url: https://jxself.org/git/?p=substrate.git;a=commitdiff_plain;h=1191252886e1524ae8aa30160d30e69e7b6621cc;ds=sidebyside More doc updates --- diff --git a/documentation/zil.md b/documentation/zil.md index 4d30b87..6b1e885 100644 --- a/documentation/zil.md +++ b/documentation/zil.md @@ -23,17 +23,34 @@ License along with this document. If not see A "definition" is used to describe a room, object, routine, etc. in or used by the game. Each definition consists of a number of properties, flags, and/or instructions. A program written in ZIL can be thought of -as consisting of one or more of these definitions. Definitions, -properties, flags, and instructions include brackets which must be -correctly paired and nested. +as consisting of two or more of these definitions. At a minimum, a +program must define which version it is to be compiled for and contain +at least one routine named GO from which execution begins. +Definitions, properties, flags, and instructions include brackets +which must be correctly paired and nested. + +## Z-machine versions +Infocom made 6 versions of the Z-machine. The community made 2 more, +for a total of 8, mostly to support larger story files. To define +which version of the Z-machine a program is to be compiled for, it +must contain a VERSION definition at the top level, outside any other +definitions, in the following format, using this BNF-style syntax: + + ::= "<" "VERSION" ">" + + ::= "ZIP" | "EZIP" | "XZIP" | "YZIP" | "1" | "2" + | "3" | "4" | "5" | "6" | "7" | "8" + +ZIP is equivalent to version 3, EZIP to version 4, XZIP to version 5, +and YZIP to version 6. ## Comments Comments are ignored by the compiler. A comment begins with a semicolon (;) and continues until the end of the line. A multiline -comment also begins with a semicolon but is enclosed in double -quotes. However, single line comments may also be enclosed in double -quotes. While comments may be placed anywhere in a source code file, a -comment may not be placed inside an atom. +comment also begins with a semicolon but is enclosed in double quotes. +However, single line comments may also be enclosed in double quotes. +While comments may be placed anywhere in a source code file, a comment +may not be placed inside an atom. ## Parser The purpose of the parser is to receive and process the player's