
Page generated from: SET_File_Core_AI_v4_3.md
(AI-Learning Doc)
Version: 4.3
Purpose: Parse and generate SET (.set) and Q-Set (.qset) files with full Core specification support
Spec Reference: SET\_File\_Core\_Spec\_v4\_3.md
SET files are a human-readable data format for configuration files, tables, and structured text. Files use .set extension (full features) or .qset extension (defaults-only).
Key Principle: Line-based parsing, flexible delimiters, minimal escaping, mixed content types (tables + key-value + text blocks).
This skill covers: Core specification (Sections 1-3) including Q-Set defaults plus optional advanced features.
Group markers: [ ]
Text group: [{ }]
Field delimiter: |
Escape character: \
Secondary delim: ! (for nested arrays)
Empty fields: … (or ...)
Preamble delim: : (for config and special features)
End of group: [EOG] or empty line
filename.set ← Filename (optional but strongly recommended)
Comments outside groups ← Ignored by parser
Can span multiple lines
[THIS-FILE] ← Optional configuration group (Core feature)
Version|4.3
Delimiters|:[]:{}:|:\:…:!
Encode|UTF-8
[EOG]
[GROUPNAME] ← Group start
Key|Value ← Key-value pairs
AnotherKey|AnotherValue
← Empty line = end of group
[TABLE_GROUP] ← Another group
{field1|field2|field3} ← Field definition
row1val1|row1val2|row1val3 ← Data rows
row2val1|row2val2|row2val3
[{TEXT_GROUP}] ← Text group (no escaping)
Raw text content here
Pipes | and backslashes \ are literal
No delimiter processing
[EOG] ← Explicit end (text groups don't end on empty lines)
[GROUPNAME] = Regular group start[{GROUPNAME}] = Text group start[EOG] = Explicit group end[A-Za-z0-9_-]+ (no spaces/special chars)\| → |)| delimiter{field|names} = field definition* When present: group becomes a table, subsequent lines are data rows
* Data rows should match field count (trailing empty fields may be omitted)
[EOG], new group, or EOF[EOG], new group marker, or EOFEmbed SET content in other file formats using comment syntax.
Pattern: Comment syntax + space + {SETTAG:name} ... {/SETTAG/}
Examples:
html
<!-- {SETTAG:ConfigInfo}
[SETTINGS]
Theme|dark
{/SETTAG/} -->
javascript
// {SETTAG:AppConfig}
// [DATABASE]
// Host|localhost
// {/SETTAG/}
Languages:
// {SETTAG:name} ... {/SETTAG/}# {SETTAG:name} ... {/SETTAG/}/ {SETTAG:name} ... {/SETTAG/} /Optional group for parser configuration and metadata. If used, should be first group in file.
Common keys:
[THIS-FILE]
Version|4.3
Created|2026-01-07
Author|Name
Delimiters|:[]:{}:|:\:…:!
Encode|UTF-8
Localize|NFC|en-US|LTR
[EOG]
Format: Delimiters|:[]:{}:|:\:…:!
Reading the delimiter string:
:) = preamble delimiter (parses this line only)* `[]` = Group brackets
* `{}` = Text block brackets
* `|` = Field delimiter
* `\` = Escape character
* `…` = Empty fields marker (can be `...`)
* `!` = Nested field delimiter
Custom example (comma-separated):
Delimiters|;[];{};,;\;...;!
Changes field delimiter from | to , for entire file.
Format: Encode|UTF-8
Common values: UTF-8 (default), UTF-16, ASCII, ISO-8859-1
Format: Localize|NORMALIZATION|LOCALE|DIRECTION
Examples:
Localize|NFC|en-US|LTR # English, left-to-right
Localize|NFC|ar-SA|RTL # Arabic, right-to-left
Localize|NFC|multi|AUTO # Multiple languages
config.set
[DATABASE]
Host|localhost
Port|5432
User|admin
[APP_SETTINGS]
Theme|dark
Debug|true
data.set
[USERS]
{id|username|email|active}
1|alice|alice@example.com|true
2|bob|bob@example.com|false
3|charlie|charlie@example.com|true
config.set
[SERIAL_PORT]
protocol|rs232
9600|8|n|1|none
flow_control|rts/cts
No field validation - each line parsed independently.
content.set
[{README}]
# Project Title
This content is **preserved exactly**.
Pipes | and backslashes \ are literal.
No escape processing happens here.
[EOG]
[CONFIG]
AppName|MyApp
myapp.set
[THIS-FILE]
Version|4.3
Author|Kirk Siqveland
Delimiters|:[]:{}:|:\:…:!
[EOG]
[METADATA]
Name|MyApplication
Version|2.1.0
[{LICENSE}]
MIT License
Copyright (c) 2026 Your Name
[EOG]
[FEATURES]
{id|name|enabled}
1|Authentication|true
2|Logging|true
3|Analytics|false
When to escape:
\|\ |Data is trimmed:
[PATHS]
WindowsPath|C:\Program Files\App
Expression|value > 10 \| value < 5
BackslashPipe|\mypath\ |data
Spaced| value with spaces |trimmed
Result after parsing:
WindowsPath → "C:\Program Files\App"
Expression → "value > 10 | value < 5"
BackslashPipe → "\mypath\ |data"
Spaced → "value with spaces" (outer spaces trimmed)
Text groups need NO escaping:
[{CODE}]
if (x | y) {
path = C:\Windows\System32
}
[EOG]
Some implementations use quotes to preserve exact string content.
Pattern:
[DATA]
Field|" value with spaces "
Field|normal value
Field|"value with | pipe inside"
Implementation:
": strip quotes, preserve content exactlyNote: Implementation convention, not spec requirement. Document if used.
[MENU]
{id|label|subitems}
1|File|New!Open!Save!Exit
2|Edit|Cut!Copy!Paste
Parse: Split on |, then split subitems field on !
[CONTACTS]
{id|name|email|phone}
1|Alice|alice@example.com|
2|Bob||555-1234
Empty string between delimiters = empty field.
[TAGS]
production
staging
development
Each line = one value (no field delimiter).
[APP_INFO]
Name|My Application
License|[{LICENSE_TEXT}]
[{LICENSE_TEXT}]
MIT License
Copyright (c) 2026...
[EOG]
Value [{LICENSE_TEXT}] references the text block content.
CONFIG, app-settings, Users_2024My Config, [NESTED], settings!{field1|field2|field3}Groups without field definitions:
[SERIAL_CONFIG]
protocol|rs232
9600|8|n|1|none
Each line is independently valid. No field count validation needed.
[EMPTY_GROUP]
[NEXT_GROUP]
Key|Value
Valid. Empty group contains no data.
[CONFIG]
Key1|Value1
This is NOT a comment - it's data without delimiter
Key2|Value2
Lines without | in regular groups = single values.
[{DOCUMENTATION}]
Configuration groups use [GROUPNAME] syntax.
The [EOG] marker ends groups.
[EOG]
Content preserved literally until [EOG] at start of line.
Important: Only [EOG] at the start of a line ends the group. Mid-line [EOG] is literal text.
[{CODE_SAMPLE}]
To end a group, use [EOG] at the start of a line.
[EOG] with leading spaces is treated as content.
Not this [EOG] either - it's mid-line.
[EOG]
Only the final [EOG] (at column 0) terminates the group. The previous two are literal text content.
[CONFIG]
Key1|Value1
[CONFIG]
Key2|Value2
INVALID: Each group MUST have a unique name within the file. Duplicate group names violate the spec.
These features extend the minimum specification. Implementations may choose to support some, all, or none.
Add extra fields to specific rows without redefining table structure.
Syntax: :::value or :::fieldname:value
[USERS]
{id|username|email}
1|alice|alice@example.com
2|bob|bob@example.com:::temp_note:Pending verification
3|charlie|charlie@example.com
Row 2 has an extra temp_note field. Other rows don't need empty placeholders.
Common uses:
Multiple single-use fields:
[CONTACTS]
{id|name|email}
1|Alice|alice@example.com
2|Bob|bob@example.com:::phone:555-1234:::department:Engineering
3|Carol|carol@example.com
With custom preamble delimiter:
If Delimiters|;[];{};,;\;...;!, then single-use fields use ;:
[DATA]
{id|value}
1|100
2|200;;;note;Special case
Indicates "remaining fields are empty" - reduces file size for sparse data.
Syntax: … (ellipsis) or ... (three periods) as last value on line
[CONTACTS]
{id|name|phone|email|address|city|state|zip}
1|Alice|555-1234|alice@example.com|…
2|Bob|555-5678|…
Equivalent to trailing empty fields: ||||
Parser rule: Must be last value on line. All fields after are treated as empty.
Override delimiter for a single line when data contains many instances of standard delimiter.
Syntax: Line starts with preamble delimiter (: default) + replacement delimiter + data using new delimiter
[SETTINGS]
AppName|My Application
:!URL!https://example.com/api?param1=value|param2=value|param3=value
:!Expression!(a | b) & (c | d) | (e | f)
Database|localhost
How it works:
: (preamble delimiter)!! instead of |Use cases:
Element Syntax Example Regular group [NAME] [CONFIG] Text group [{NAME}] [{LICENSE}] Config group [THIS-FILE] See above Field definition {f1|f2|f3} {id|name|email} Key-value key|value Host|localhost End group [EOG] or empty line [EOG] Escape pipe | expr|a > 5 | b < 3 Backslash+pipe \ | path|\ |data Nested array ! items|a!b!c Comment Outside groups # Any text Trim fields Auto after split | value | → "value" SET Tag {SETTAG:name} See above Single-use field :::field:value Row-specific data Empty fields … or ... Trailing empties Line delimiter override :!data!data Override for one line
Parser features:
[EOG] explicit terminationGenerator features:
| in regular group data (use \|)\ |)[EOG] for text groupsAll Q-Set features PLUS:
Parser features:
[THIS-FILE] configuration parsing:::)…):!)Generator features:
[THIS-FILE] group
1. Initialize: groups = {}, current_group = null, in_text_group = false, config = default_delimiters
2. For each line:
a. If line starts with `[THIS-FILE]` (at column 0):
- Parse configuration, update delimiters/encoding
b. If line starts with `[{NAME}]` (at column 0):
- Set current_group = NAME, in_text_group = true
- Create groups[NAME] = {type: 'text', content: ''}
c. Else if line starts with `[NAME]` (at column 0):
- Set current_group = NAME, in_text_group = false
- Create groups[NAME] = {type: 'regular', rows: []}
d. Else if line starts with `[EOG]` (at column 0):
- Set current_group = null, in_text_group = false
e. Else if line is empty:
- If not in_text_group: set current_group = null
- If in_text_group: append '\n' to content
f. Else if current_group exists:
- If in_text_group: append line to content
- Else if line starts with preamble+delimiter (e.g., ':!'):
- Parse with override delimiter
- Else: split on delimiter, process escapes, check for ':::' or '…', trim() each field, add to rows
g. Else: ignore (comment)
3. Return groups and config
For advanced usage patterns including:
Visit: https://setfiles.org/advanced
Spec Copyright (c) 2026 Kirk Siqveland
Licensed under CC BY 4.0