Attribute Value Stream (AVS) File Syntax
Attribute Value Stream (AVS) is a file format and data interchange format that uses human-readable text to describe nested objects and arrays of objects. This file format is similar to JSON (Javascript Object Notation).
AVS Syntax
- Data is in attribute/value pairs separated by "=".
- Data is separated by commas.
- Curly braces hold objects.
- Square brackets hold arrays.
- Attribute names are not quoted and are case-sensitive.
- Comments start with the "#" character and extend to the end of the line.
{ name = "triangle", sides = 3 }
{ polygon_array = [
# the following are array elements
{ name = "triangle", sides = 3},
{ name = "rectangle", sides = 4,},
{ name = "pentagon", sides = 5},
] }
The preceding example illustrates that AVS allows an optional comma after the last attribute/value pair in an object or after the last object in an array.
Object Definition
An AVS object is defined as a list of 0 or more attribute/value pairs separated by commas and wrapped by curly braces.
A properly formatted AVS configuration file contains one top-level object. Comments can precede, follow, or be embedded in the top-level AVS object. The values can contain nested objects and arrays.
Attribute/Value Pairs
An attribute / value pair specification is formatted as follows. When no "= value" is specified, the attribute is given a null value. Null valued attributes formatted in this way are typically used for "flags" which impart meaning by their presence/absence in the object.
attribute = value
or
attribute
- Upper or lower case letters or an underscore "_" (required for initial character)
- Digits 0-9
- Number
- Positive or negative 64 bit integers or floating point numbers.
- String
- Any characters surrounded by double quotes. If the string contains a double quote it is preceded by a "\" character.
- Name
- An unquoted string conforming to the attribute name rules mentioned above.
- Object
- An AVS object (that is encased by curly braces).
- Array
- An AVS array of objects, which is a list of AVS objects, surrounded by square brackets and separated by commas.