VizzyXmlConverter.cs

VizzyXmlConverter.cs is the main conversion engine script. It contains the importer from Vizzy XML to .vizzy.cs, the exporter from .vizzy.cs to XML, expression conversion, instruction conversion, preservation anchors, raw fragment decoding, and layout metadata handling. converter xml

Deep reference

The high-level guide is 02 - Conversion Engine (VizzyXmlConverter). This page focuses on the script as a maintainable source file.

Major Areas

AreaExamples
Public entry pointsConvertCraftToCode, ConvertProgramToCode, ConvertCodeToXml, ConvertExpression.
XML import emittersVariables, custom instructions, events, instruction blocks, expressions.
Code export parserTop-level blocks, variables, calls, expressions, raw preservation.
Preservation metadataVZTOPBLOCK, VZBLOCK, VZEL, RawXml*, Raw*.
Layout metadataVZPOS and generated positions.
Expression supportMath, craft properties, planet ops, strings, lists, vectors, custom expressions.

Internal Flow

flowchart TD
    A[XML import path] --> B[Emit exact code]
    B --> C[Clean view sidecar]
    D[Code export path] --> E[Restore metadata]
    E --> F[Parse code]
    F --> G[Build Program XML]
    G --> H[[VizzyExportValidator.cs]]

Maintenance Rules

Converter changes affect every surface

Desktop app, CLI, and VS Code exports all depend on this script. Test both imported fidelity and fresh authoring paths.

Preferred verification

Related notes: Component Map, 02 - Conversion Engine (VizzyXmlConverter), 04 - Export Validation, 05 - Raw Preservation.