Interface Ucrx

Charge receiver interface.

Implementations of this interface typically generated by compiler.

More methods could be added to this interface to reflect custom charges. It is expected that custom method names to be at least four characters long.

Hierarchy

Implemented by

Accessors

Methods

Accessors

  • get types(): readonly string[]
  • Array of expected value types.

    Used for error messages.

    Returns readonly string[]

Methods

  • Starts charging of list.

    Always called before the first item charge. In case of map item, always called before map charge, but not necessarily before entries charged.

    Parameters

    Returns 0 | 1

    1 if charge succeed, or 0 for unexpected list.

  • Charges metadata attribute.

    Parameters

    • attr: string

      Metadata attribute name.

    • cx: UcrxContext

      Charge processing context.

    Returns undefined | Ucrx

    Either metadata receiver, or undefined if metadata attribute is not recognized.

  • Charges big integer value.

    Typically called from raw when the raw value interpreted as bigint, i.e. when it starts with 0n or -0n prefix.

    Parameters

    • value: bigint

      Charged value.

    • cx: UcrxContext

      Charge processing context.

    Returns 0 | 1

    Either 1 if charge succeed, or 0 for unexpected big integer.

  • Charges boolean value.

    Called directly for true value (!), or from raw when the raw value interpreted as false, i.e. it is -.

    Parameters

    • value: boolean

      Charged value.

    • cx: UcrxContext

      Charge processing context.

    Returns 0 | 1

    Either 1 if charge succeed, or 0 for unexpected boolean.

  • Finishes list charge.

    Always called after and call(s).

    May also be called for single values. I.e. without preceding call to and. This is not guaranteed though.

    Parameters

    Returns void

  • Charges opaque (unrecognized) entity.

    Called for unhandled entities.

    Parameters

    • name: string

      Charged entity name.

    • cx: UcrxContext

      Charge processing context.

    Returns 0 | 1

    Either 1 if charge succeed, or 0 for unexpected entity.

  • Charges opaque (unrecognized) formatted data.

    Parameters

    • format: string

      Charged data format name.

    • data: readonly UcToken[]

      Charged data tokens.

    • cx: UcrxContext

      Charge processing context.

    Returns 0 | 1

    Either 1 if charge succeed, or 0 for unexpected data.

  • Starts charging of map entry.

    Parameters

    • key: PropertyKey

      Target entry key.

    • cx: UcrxContext

      Charge processing context.

    Returns undefined | 0 | Ucrx

    Either entry receiver, 0 for unexpected map, or undefined for unexpected entry.

  • Called to start inset tokenization.

    Parameters

    • id: string | number

      Inset format identifier.

    • emit: ((token) => void)

      Emitter function called each time a token is found.

        • (token): void
        • Parameters

          Returns void

    • cx: UcrxContext

      Charge processing context.

    Returns undefined | UcLexer

    Either input lexer, or undefined if inset is not expected..

  • Finishes map charge.

    Called after all map entries charged, unless the map is empty.

    The returned 0 makes sense for empty maps only. Otherwise, a preceding call to for has to return 0, which prevents the map charge.

    Parameters

    Returns 0 | 1

    1 if charge succeed, or 0 for unexpected map.

  • Charges nested list.

    Parameters

    Returns undefined | Ucrx

    Either nested list charge receiver, or undefined for unexpected nested list.

  • Charges null value.

    Typically called from raw when the raw value interpreted as null, i.e. when it is --.

    Parameters

    Returns 0 | 1

    Either 1 if charge succeed, or ``0for unexpectednull`.

  • Charges number value.

    Typically called from raw when the raw value interpreted as number, i.e. when it starts with digit.

    Parameters

    • value: number

      Charged value.

    • cx: UcrxContext

      Charge processing context.

    Returns 0 | 1

    Either 1 if charge succeed, or 0 for unexpected number.

  • Charges raw value.

    In contrast to str method, this one is called for strings that look like numbers or start with hyphen ("-" (U+002D)).

    By default, calls big, bol, nul, num, or str depending on value prefix.

    Parameters

    • value: string

      Charged value.

    • cx: UcrxContext

      Charge processing context.

    Returns 0 | 1

    Either 1 if charge succeed, or 0 for unexpected number.

  • Charges string value.

    Always called directly for quoted strings. May be called from raw, unless the raw value interpreted otherwise.

    Parameters

    • value: string

      Charged value.

    • cx: UcrxContext

      Charge processing context.

    Returns 0 | 1

    Either 1 if charge succeed, or 0 for unexpected number.

Generated using TypeDoc