-The metadata can be parsed by reading through the metadata strings, skipping
-newlines and null-characters. Type names are made of a single identifier, and
-can be surrounded by prefix/postfix. Text contained within "/*" and "*/", as
-well as within "//" and end of line, are treated as comments. Boolean values can
-be represented as true, TRUE, or 1 for true, and false, FALSE, or 0 for false.
+
+7.1 Metadata
+
+The trace stream layout description is located in the trace meta-data.
+The meta-data is itself located in a stream identified by its name:
+"metadata".
+
+It is made of "event packets", which each start with an event packet
+header. The event type within the metadata stream have no event header
+nor event context. Each event only contains a "string" payload without
+any null-character. The events are packed one next to another. Each
+event packet start with an event packet header, which contains, amongst
+other fields, the magic number, trace UUID and packet length. In the
+event packet header, the trace UUID is represented as an array of bytes.
+Within the string-based metadata description, the trace UUID is
+represented as a string of hexadecimal digits and dashes "-".
+
+The metadata can be parsed by reading characters within the metadata
+stream, for each packet starting after the packet header, for the length
+of the packet payload specified in the header. Text contained within
+"/*" and "*/", as well as within "//" and end of line, are treated as
+comments. Boolean values can be represented as true, TRUE, or 1 for
+true, and false, FALSE, or 0 for false.
+
+
+7.2 Declaration vs Definition
+
+A declaration associates a layout to a type, without specifying where
+this type is located in the event structure hierarchy (see Section 6).
+This therefore includes typedef, typealias, as well as all type
+specifiers. In certain circumstances (typedef, structure field and
+variant field), a declaration is followed by a declarator, which specify
+the newly defined type name (for typedef), or the field name (for
+declarations located within structure and variants). Array and sequence,
+declared with square brackets ("[" "]"), are part of the declarator,
+similarly to C99. The enumeration base type is specified by
+": enum_base", which is part of the type specifier. The variant tag
+name, specified between "<" ">", is also part of the type specifier.
+
+A definition associates a type to a location in the event structure
+hierarchy (see Section 6). This association is denoted by ":=", as shown
+in Section 7.3.
+
+
+7.3 TSDL Scopes
+
+TSDL uses two different types of scoping: a lexical scope is used for
+declarations and type definitions, and a dynamic scope is used for
+variants references to tag fields.
+
+7.3.1 Lexical Scope