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

Characteristics of AVS:
  • 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.
Here is an example of a simple AVS object containing two attribute/value pairs:
{  name = "triangle", sides = 3 }
AVS objects are often nested. Here's an example of an AVS object containing an array of polygon objects, showing a valid AVS comment line:
{ 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
An attribute is a valid AVS name, which is an unquoted string containing any of the following characters:
  • Upper or lower case letters or an underscore "_" (required for initial character)
  • Digits 0-9
A value may be any of the following types:
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.