Skip navigation.
Home
l'art pour l'art

The Attribute-Type-Value Object Language 1.0

Introduction

ATV was created to store and read machine data in human readable files

  • to ease debugging and
  • to ease management with version management systems like CVS.

First implementations of the parser and object serialization API in C++ are available for download under BSD license:
atvparser-2002-12-14.tar.bz2 (8KB compressed, 50KB uncompressed).
atvparser-2003-09-06.tar.bz2 (11KB compressed, 70KB uncompressed).

Design Goals

In contrast to XML or YAML, two languages also being popular for object serialization, ATV's design goals were:

  • To provide a minimal and simple grammar.
  • Avoid the drawbacks of XML that resulted in SML (see SML: Simplifying XML):

    • XML requires to handle different character encodings.
      This may be fine for documents but is pure overkill in most other cases. UTF-8 encoding, which includes ASCII, should be enough.
    • Too many possible notations.
      In XML data can be specified as attribute of a tag or as an element between tags.
      Ie. with attributes:

      <attribute type="rgb" value="#0080FF"/>

      or with elements as suggested by SML:

      <attribute><rgb>#0080FF</rgb></attribute>

      But the later contains to much redundancy. Since XML requires to close every tag, one could also write:

      <attribute><rgb>#0080FF</></>

  • No formating restrictions as in YAML.
    (see http://www.yaml.org/)
  • Must be usable for configuration files.
  • Must be usable for object serialization.

Idea

To achieve these goals ATV is based on three notions:

  • Attribute
    Defines where to store a value. When none is specified, the value is considered to be part of a set.
  • Type
    Defines how to interpret the value. When not specified, the type is implied by a previously specified attribute.
  • Value
    A textual representation of the data.

The grammar goes like this:

  attribute := string '=';
  type := string '{' value '}';
  value := [attribute] (type | string | '{' value '}' );

(Brackets may be skipped, when no type or set was specified.)

  /*
   * an ATV example:
   */
  // type { ...
  picture {
    // attribute = value 
    width = 160 height = 200
    // attribute = type { value ... }
    background = image { "waves.png" }
    foreground = rgb { 0 0 0 }
    // type { attribute = value ... }
    rect { x=5 y=5 w=10 h=10 }
    text { x=40 y=60 "Hi there" }
  }

Other Links