Hi Santeri,
I like the use of tag-value syntax, but for the 'default' and 'studlogos' values the syntax breaks - we have tags without values.
Ideally I would like to be able to extend this syntax in the future (adding new keywords) without breaking existing clients, which implies that a parser can parse the data without knowing all of the tags.
This syntax might be sort of stupid looking, but what if we do something like:
The default and studlogos tags would then have a value of 0 or 1, their default (if omitted) is 0, and clients assume that every pair of words (with quotes forming a single big word) is a key-value pair.
If people think parsing quoted words is annoying we could also do this:
I don't have strong aesthetic opinions on the file format (particularly if Allen writes the parser ;-) but I would like to be able to add keywords later without having to worry about existing clients.
cheers
Ben
I like the use of tag-value syntax, but for the 'default' and 'studlogos' values the syntax breaks - we have tags without values.
Ideally I would like to be able to extend this syntax in the future (adding new keywords) without breaking existing clients, which implies that a parser can parse the data without knowing all of the tags.
This syntax might be sort of stupid looking, but what if we do something like:
Code:
0 !PRIMITIVE-DETAIL FOLDER p/8 SEGMENTS 8 DESCRIPTION "Low resolution"
0 !PRIMITIVE-DETAIL FOLDER p SEGMENTS 16 DEFAULT 1 DESCRIPTION "Standard"
0 !PRIMITIVE-DETAIL FOLDER p/logostuds SEGMENTS 16 STUDLOGOS 1 DESCRIPTION "Logoed studs"
The default and studlogos tags would then have a value of 0 or 1, their default (if omitted) is 0, and clients assume that every pair of words (with quotes forming a single big word) is a key-value pair.
If people think parsing quoted words is annoying we could also do this:
Code:
0 !PRIMITIVE-DETAIL "Low resolution"
0 !PRIMITIVE-DETAIL-INFO FOLDER p/8
0 !PRIMITIVE-DETAIL-INFO SEGMENTS 8
0 !PRIMITIVE-DETAIL "Standard"
0 !PRIMITIVE-DETAIL-INFO FOLDER p
0 !PRIMITIVE-DETAIL-INFO SEGMENTS 16
0 !PRIMITIVE-DETAIL-INFO DEFAULT
0 !PRIMITIVE-DETAIL "Logoed studs"
0 !PRIMITIVE-DETAIL-INFO FOLDER p/logostuds
0 !PRIMITIVE-DETAIL-INFO SEGMENTS 16
0 !PRIMITIVE-DETAIL-INFO STUDLOGOS
I don't have strong aesthetic opinions on the file format (particularly if Allen writes the parser ;-) but I would like to be able to add keywords later without having to worry about existing clients.
cheers
Ben