← All compilation units

Flyology_JSON.Profiles

Description

Version identifiers are values rather than suffixes in declaration names. The initial implementation supports version 1 for each family; adding behavior under an existing family/version is incompatible.

BOM_Policy

type BOM_Policy is (Reject_BOM);

Policy for a UTF-8 byte-order mark at byte zero.

Enumeration literals
Reject_BOM

Report a byte-order mark as malformed input.

Compatibility_Family

type Compatibility_Family is
  (No_Extensions, Comments, Trailing_Commas, Comments_And_Trailing_Commas);

Compatibility family that controls nonstandard JSON extensions. Each family is explicit so accepting one extension never silently enables another. Comments are validated UTF-8 trivia: // ends at CR, LF, or final input, while non-nested /* */ ends at its first closing delimiter. The parser emits no comment events. A trailing comma is admitted only after at least one array item or object member.

Enumeration literals
No_Extensions

Reject comments, trailing commas, and nonstandard token spellings.

Comments

Accept line and block comments where JSON whitespace is legal.

Trailing_Commas

Accept one trailing comma after an array item or object member.

Comments_And_Trailing_Commas

Accept both documented extensions.

Duplicate_Policy

type Duplicate_Policy is (Reject_Duplicates, Preserve_Unchecked);

Object member-name handling selected when the parser package is instantiated.

Enumeration literals
Reject_Duplicates

Reject equal decoded names without Unicode normalization.

Preserve_Unchecked

Emit every name in source order without duplicate selection.

Output_Policy

type Output_Policy is (Ordinary_Compact);

Writer formatting policy.

Enumeration literals
Ordinary_Compact

Emit no added whitespace while preserving caller order and number lexemes.

Parser_Profile

type Parser_Profile is record
   Syntax        : Versioned_Syntax;
   Unicode       : Versioned_Unicode;
   Compatibility : Versioned_Compatibility;
   BOM           : BOM_Policy;
   Duplicates    : Duplicate_Policy;
   Top_Level     : Top_Level_Policy;
end record;

Complete parser acceptance policy. Every field is explicit; no public default exists.

Record fields
Syntax

Versioned JSON grammar identity.

Unicode

Versioned Unicode validation identity.

Compatibility

Versioned extension-compatibility identity.

BOM

Handling of a UTF-8 byte-order mark at byte zero.

Duplicates

Object member-name policy; it must match the parser generic instance.

Top_Level

Admitted root JSON value kinds.

Profile_Status

type Profile_Status is (Profile_Supported, Profile_Unsupported, Profile_Incompatible);

There is deliberately no profile factory, default, capacity, or policy constant. A caller constructs every field explicitly. The trusted profiles contain no accounting capability or hook.

Enumeration literals
Profile_Supported

Every profile field and combination is implemented.

Profile_Unsupported

At least one requested family or version is not implemented.

Profile_Incompatible

The requested profile fields cannot be combined.

Profile_Version

subtype Profile_Version is Positive;

Version identifiers are values rather than suffixes in declaration names. The initial implementation supports version 1 for each family; adding behavior under an existing family/version is incompatible.

Syntax_Family

type Syntax_Family is (RFC_8259);

JSON grammar family selected by a parser or writer profile.

Enumeration literals
RFC_8259

Strict RFC 8259 JSON grammar.

Top_Level_Policy

type Top_Level_Policy is (Accept_Any_Value, Require_Object);

Root JSON value kinds admitted by a parser operation.

Enumeration literals
Accept_Any_Value

Accept objects, arrays, strings, numbers, Booleans, and null.

Require_Object

Accept only an object as the root value.

Unicode_Family

type Unicode_Family is (Unicode_Scalars);

Unicode validation family selected by a parser or writer profile.

Enumeration literals
Unicode_Scalars

UTF-8 and escapes must decode to Unicode scalar values.

Validate

function Validate (Profile : Parser_Profile) return Profile_Status

Validate accepts only the declared initial family/version combinations. Parser/writer operations separately freeze a validated profile before consuming input or beginning a destination transaction.

Parameters
Profile

Complete parser profile to validate without consuming input.

Return value

Support status for the exact parser profile.

Validate

function Validate (Profile : Writer_Profile) return Profile_Status

Validate a complete writer profile without beginning a destination transaction.

Parameters
Profile

Complete writer profile to validate.

Return value

Support status for the exact writer profile.

Versioned_Compatibility

type Versioned_Compatibility is record
   Family  : Compatibility_Family;
   Version : Profile_Version;
end record;

Versioned compatibility identity frozen for one parser operation.

Record fields
Family

Selected extension-compatibility family.

Version

Version of the selected compatibility family.

Versioned_Output

type Versioned_Output is record
   Policy  : Output_Policy;
   Version : Profile_Version;
end record;

Versioned output identity frozen for one writer operation.

Record fields
Policy

Selected output policy.

Version

Version of the selected output policy.

Versioned_Syntax

type Versioned_Syntax is record
   Family  : Syntax_Family;
   Version : Profile_Version;
end record;

Versioned syntax identity frozen for one operation.

Record fields
Family

Selected JSON grammar family.

Version

Version of the selected grammar family.

Versioned_Unicode

type Versioned_Unicode is record
   Family  : Unicode_Family;
   Version : Profile_Version;
end record;

Versioned Unicode identity frozen for one operation.

Record fields
Family

Selected Unicode validation family.

Version

Version of the selected Unicode family.

Writer_Profile

type Writer_Profile is record
   Syntax     : Versioned_Syntax;
   Unicode    : Versioned_Unicode;
   Formatting : Versioned_Output;
end record;

Complete ordinary writer policy. Every field is explicit; no public default exists.

Record fields
Syntax

Versioned JSON grammar identity.

Unicode

Versioned Unicode validation identity.

Formatting

Versioned output identity; ordinary compact output is not canonical JSON.