|
|
G2 records are name-value trees in the form of a tab-indented outline. The simplest form is just a name followed by a value:
usr bob
Example 1
Here, the record name, usr, appears at the left margin and is separated from the value, bob, by a tab character. A newline terminates the record. In the streams sense, ``left margin'' refers to the position just before the first character of the stream or just after any subsequent newline. Accordingly, ``indentation'' refers to the apparent indentation when a stream is presented on a printer or display terminal.
A slightly more complex record involves a set of fields:
usr log bob id 1000 gid 1 name Bob Dobbs
Example 2
In this case usr is a group field whose members are indented under it by one extra tab. As in the previous example, the elementary names are separated from their values by a tab and the values terminated by a newline.
An even more complicated record is
usr log bob id usr 1000 grp 1 name Bob Dobbs proj 0 148020 1 148030 2 100022
Example 3
Here, usr is a group that in turn contains another group, id and an array, proj. Of course, arrays could contain other groups and arrays and so on.