File

This page describes the structure of Wyrd files. This structure is the same in XML (not currently available) and JSON.

At its root, the file has three elements: structure_types, sequences, and code.

Name of primary types

  • "int" is <IntType>.
  • "bool" is <BoolType>.
  • "string" is <StringType>.
  • "text" is <TextType>.
  • "float" is <FloatType>.
  • "list" is <ListType>.
  • "ptr" is <PointerType>.

<StructureType> has no such string representation, since it will simply list the name of the user-defined structure type instead. See structure_types.

The structure_types

structure_types is a list of user-defined structures. This is necessary to be able to provide default values for these types.

The sequences

The sequences element contains a list of {{name: String}, {value: Integer}} values indicating the starting point of each sequence. This information is not used by the interpreter by default, but you might want to make use of it and so it is provided.

The code

The code is a list of {{category: String}, [...]} instructions. The category field indicates the type of <Instruction>. See the <Instruction> type definition page for the name of the other parameters and their types. Computations use a similar system: they are encoded as {{category: String}, [...]} structures with category indicating the type of <Computation> and the other parameters having the name and types of

Example:

{
   category = "set_pc",
   value =
      {
         category = "operation",
         operator = "times",
         x = {category = "constant", type = "int", value = "2"},
         y = {category = "constant", type = "int", value = "91"}
      }
}