Indentation is used to define structure and "double indentation" is used for
multi-line values. This results in a very clean syntax with no need to escape
special characters.
Colons and square brackets can be optionally added to aid readability.
The "#" character is used for comments.
There are two types of line, "Simple lines" and "Double-indented lines".
A simple line must start with an exact multiple of 4 spaces, followed by
the name of the element, optional space-separated attributes in the form
<name>=<value>, and finally the value for the element (which can be an empty
string).
Element and attribute names must start with a letter and thereafter contain
only letters, digits, minus sign and underscore characters.
Attribute values should be inside double-quotes if they are not in the same
format as element and attribute names.
If the value starts with a space, this space is skipped.
A simple line cannot be indented by more than 4 spaces beyond the previous
simple line.
Simple lines starting with "#" are ignored.
For example:
PropertyList
sim
view n="0"
x-offset-m type=float archive="y" 0.0
nasal
is equivalent to:
<PropertyList>
<sim>
<view n="0">
<x-offset-m type="float" archive="y">0.0</x-offset-m>
</view>
</sim>
<nasal>
</nasal>
</PropertyList>
To aid readability, attributes can optionally be inside square brackets and one
can insert a colon or colon+space before the value:
x-offset-m [type=float archive="y"]: 0.0
Colons or square brackets can be used if the initial part of the value would
otherwise be interpreted as attributes:
foo: bar=12
Lines that are indented by 8 or more spaces beyond the most recent simple
line.
Always used for the value of the current element.
Can be used to define multi-line values.
The use of indentation means that there is no need to escape any special
characters - for example angled-brackets and braces can be specified verbatim.
For example:
PropertyList
sim
# Info
description Hawker Siddeley Harrier GR3
long-description
The Hawker Siddeley Harrier, developed in the 1960s, was the
first of the Harrier Jump Jet series of aircraft. It was the first
operational close-support and reconnaissance fighter aircraft with
vertical/short takeoff and landing (V/STOL) capabilities and the only
truly successful V/STOL design of the many that arose in that era.
is equivalent to:
<PropertyList>
<sim>
<!-- Info -->
<description>Hawker Siddeley Harrier GR3</description>
<long-description>The Hawker Siddeley Harrier, developed in the 1960s, was the
first of the Harrier Jump Jet series of aircraft. It was the first
operational close-support and reconnaissance fighter aircraft with
vertical/short takeoff and landing (V/STOL) capabilities and the only
truly successful V/STOL design of the many that arose in that era.
</long-description>
</sim>
</PropertyList>
The n + 8 indentation is removed from the specified text.
iml.hxx and iml.cxx.The parser throws an exception if it finds a parse error, and the exception
text shows the location where the error occurred. For example:
Failed: Harrier-GR3-set.iml:50:11: Bad indentation of 11 spaces; current indentation=16 so expected indentation of 0, 4, 8, 12, 16, 20 or >= 24.
Uses a class derived from iml_visitor to write XML.
Run with -h or --help to see help.
On Unix, running make will build iml and run a couple of simple tests.
GPL.