Translators: Language Dictionary - UA-ScriptEase/scriptease GitHub Wiki

JULES: What country are you from?

BRETT: What? What? Wh - ?

JULES: "What" ain't no country I've ever heard of. They speak English in What?

-- Pulp Fiction

#Overview The Language Dictionary contains a description of the language's syntax in an XML format. Where the API dictionary is a description of what you can say, this is a description of how to say it. These are almost invariably much, much shorter than the API dictionary. It includes the following elements, each of which is described in detail further down.

  1. A name attribute
  2. A list of reserved words to never be used as a name for anything ever.
  3. The indenting string.
  4. A list of formats, where each format specifies an ordered list of pieces, some of which could be other formats. This is similar in concept to grammar formalisms like Backus-Naur Form. Languages dictionaries are required to contain a format with an id of "file" and at least one of "singleComment" or "blockComment"

#Reserved Words List The ReservedWords list contains a series of Words that contain text. Those words will never be used in code generation as a name. Words are case sensitive by default but can become insensitive by setting the attribute caseSensitive="false".

#Indenting String IndentString contains the character(s) to be using for indenting code. Usually this is filled with some number of spaces or a tab character. Leave empty to disable indenting. Be careful to not include extra whitespace characters here (like new lines) or else you'll wind up with oddly formatted code.

#Format List This is a collection of grammatical descriptions (formats) of the output language. There are an arbitrary number of formats, but there are some that are required by ScriptEase.

Each Format in the Formats list is a composition of lines, indents, format series, fragments, scope changes, and/or other formats. The contents of a line have a newline character appended to the end, while each line inside of an indent is indented by the indenting string.

Lines must contain either formats, fragments, or literals.

Formats can be referenced with FormatRef to share definitions.

Series apply the format they contain over the contents of a data list with the given separator.

#Fragments Fragments are code generator directives - terminal nodes in the code generation tree. The code generator will replace them with the required information in a code-safe way. In other words, use these to tell the code generator to look up some data from the story model. Not all data are accessible in all contexts. To change context, use a scope directive. Fragments must have a directive to use while generating code. They can also optionally include a regular expression to restrict the possible names that can be generated.

<!ATTLIST fragment
 data (type|name|parameters|value|formattedValue|condition|startItCondition|comment|code|slot|codeSymbol)#REQUIRED
 default CDATA #IMPLIED
 legalFormat CDATA #IMPLIED
>