NAME ^

Parrot::Types - Basic types for Parrot

SYNOPSIS ^

  use Parrot::Types;

  $opcode = pack_op($opnumber) . pack_arg("I", $ireg) . ...

DESCRIPTION ^

Parrot::Types provides a collection of functions for packing and unpacking values of the various Parrot types.

It is used in build_tools/pbc2c.pl.

Functions ^

The following functions are exported:

sizeof($type)

Returns the size of the specified type.

pack_byte($value)

Returns the specified bit-string value packed into a sequence of bytes.

pack_intval($int)

Returns the specified integer value packed into a sequence of bytes.

pack_floatval($value)

Returns the specified float value packed into a sequence of bytes.

pack_sv($value)

Returns the specified Parrot::String value packed into a sequence of bytes.

pack_key($value)

Returns the specified Parrot::Key value packed into a sequence of bytes.

pack_op($value)

Returns the specified op value packed into a sequence of bytes.

unpack_byte($value)

Unpacks and returns the specified packed bit-string value.

unpack_intval($value)

Unpacks and returns the specified packed integer value.

unpack_floatval($value)

Unpacks and returns the specified packed float value.

unpack_op($value)

Unpacks and returns the specified packed op value.

unpack_ops($value)

Unpacks and returns the specified packed op values.

shift_byte($string)

Removes a packed bit-string value from the specified string, unpacks and returns it.

shift_intval($value)

Removes a packed integer value from the specified string, unpacks and returns it.

shift_floatval($value)

Removes a packed float value from the specified string, unpacks and returns it.

shift_sv($value)

Removes a packed Parrot::String value from the specified string, unpacks and returns it.

shift_key($value)

Removes a packed Parrot::Key value from the specified string, unpacks and returns it.

shift_op($value)

Removes a packed op value from the specified string, unpacks and returns it.

pack_arg($type, $value)

Returns the specified value of type $type packed into a sequence of bytes.

unpack_arg($type, $value)

Unpacks and returns the specified packed value of type $type.

shift_arg($type, $string)

Removes a packed value of the specified type from the string, unpacks and returns it.

SEE ALSO ^

Parrot::Key

Parrot::String

Parrot::PackFile

Parrot::ConstTable

Parrot::Constant

build_tools/pbc2c.pl


parrot