zpl_toolchain_spec_tables
Defines shared data structures for generated tables consumed by parser/validator.
Part of the zpl-toolchain project.
Key types
ParserTables { schema_version, format_version, commands, opcode_trie }CommandEntry { codes, arity, field_data, raw_payload, opens_field, closes_field, hex_escape_modifier, field_number, serialization, requires_field, signature, args, constraints, effects, plane, scope, ... }Signature { params, joiner, spacing_policy, allow_empty_trailing }Arg { name, key, type, unit, range, optional, presence, default, default_from, profile_constraint, range_when, rounding_policy, rounding_policy_when, resource, enum, min_length, max_length }Constraint { kind: ConstraintKind, expr, message, severity: Option<ConstraintSeverity> }Effects { sets: Vec<String> }ProfileConstraint { field, op: ComparisonOp }
Enums
ConstraintKind: Order, Requires, Incompatible, EmptyData, Range, Note, CustomConstraintKind::ALLis the single source of truth for the set of valid kinds; the JSONC schema mirrors this list and a spec-compiler test validates they stay in sync.
ConstraintSeverity: Error, Warn, InfoComparisonOp: Lte, Gte, Lt, Gt, EqRoundingMode: ToMultiplePlane: Format, Device, Host, ConfigCommandScope: Label, Session, GlobalCommandCategory: Format, Control, Status, ConfigStability: Stable, Deprecated, Undocumented
Additional Types
FieldDataRules { charset, length, parity }— barcode field data validation rulesSplitRule { font_len, orientation_len }— spec-driven^Afont+orientation splittingComposite { prefix, args }— composite command expansion (e.g.,^XG)
Notes
TABLE_FORMAT_VERSIONis currently0.4.0.- Legacy
args_specwas removed in format0.3.0; useargs(andArgUnion). - Signature spacing now uses
spacing_policy(forbid/require/allow) in format0.4.0. - Structural role flags (
opens_field,closes_field, etc.) drive the validator's field-tracking state machine. - Conditional rules are evaluated by the validator using simple predicates.