mixin

XetoIO

@Js
const mixin XetoIO

XetoIO is used to read/write various Xeto formats via Namespace.io.

methods writeAstToStr

Convenience for writeAst to an in-memory string

readAst

Parse the Xeto source representation into its dict AST representation

writeXeto

Write instance data to Xeto source code

readAxon

Parse the Axon source representation into its dict AST representation

readXetoDicts

Convenience for readXeto but always returns data as list of dicts

writeJson

Write xeto instance data as JSON The stream is left open and returned

writeAxon

Print the Axon source representation from its dict AST representation

readXeto

Read xeto instance data from Xeto source code

writeAst

Print the Xeto source representation from its dict AST representation

writeAxonToStr

Convenience for writeAxon to an in-memory string

writeXetoToStr

Convenience for writeXeto to an in-memory string

readJson

Read xeto instance data from JSON

writeJsonToStr

Convenience for writeJson to an in-memory string

readAst abstract Dict readAst(Str in, Dict? opts)

Parse the Xeto source representation into its dict AST representation.

Options:

  • libName: for internal qnames (default to proj)
  • rtInclude: marker to make it a Haxall rt rec

readAxon abstract Dict readAxon(Str in, Dict? opts)

Parse the Axon source representation into its dict AST representation. Return dict with following tags that are extracted from axon source:

  • doc: str for leading comment
  • slots: grid for parameters and return type
  • axon: source code for everything after "=>"

Options:

  • libName: for internal qnames (default to proj)

readJson abstract Obj? readJson(InStream in, Spec? spec, Dict? opts)

Read xeto instance data from JSON. The given spec is used to infer the JSON object if no spec tag is defined. The stream guaranteed to be closed upon return.

readXeto abstract Obj? readXeto(Str in, Dict? opts)

Read xeto instance data from Xeto source code. Raise exception if there are any syntax or semantic errors. If the input contains a scalar value or one dict, then it is returned as the value. Or if the input contains two or more dicts then return a Dict[] of the instances.

Options

  • externRefs: marker to allow unresolved refs to compile

readXetoDicts abstract Dict[] readXetoDicts(Str in, Dict? opts)

Convenience for readXeto but always returns data as list of dicts. If the data is not a Dict nor list of Dicts, then raise an exception.

writeAst abstract OutStream writeAst(OutStream out, Dict ast, Dict? opts)

Print the Xeto source representation from its dict AST representation. The stream is left open and returned.

Options

  • qnameForce: for all types to be qualified

writeAstToStr abstract Str writeAstToStr(Dict ast, Dict? opts)

Convenience for writeAst to an in-memory string

writeAxon abstract OutStream writeAxon(OutStream out, Dict ast, Dict? opts)

Print the Axon source representation from its dict AST representation. The stream is left open and returned.

Options

  • qnameForce: for all types to be qualified

writeAxonToStr abstract Str writeAxonToStr(Dict ast, Dict? opts)

Convenience for writeAxon to an in-memory string

writeJson abstract OutStream writeJson(OutStream out, Obj? val, Dict? opts)

Write xeto instance data as JSON The stream is left open and returned.

Options:

  • pretty: add indentation to pretty print
  • escUnicode: use escape sequences for values greater than 0x7f

writeJsonToStr abstract Str writeJsonToStr(Obj? val, Dict? opts)

Convenience for writeJson to an in-memory string

writeXeto abstract OutStream writeXeto(OutStream out, Obj? val, Dict? opts)

Write instance data to Xeto source code. If the val is a Dict[], then it is flattened in the output. The stream is left open and returned.

writeXetoToStr abstract Str writeXetoToStr(Obj? val, Dict? opts)

Convenience for writeXeto to an in-memory string

Haxall 4.0.5 ∙ 24-Feb-2026 14:33 EST