Parrot::Types - Basic types for Parrot
use Parrot::Types; $opcode = pack_op($opnumber) . pack_arg("I", $ireg) . ...
Parrot::Types provides a collection of functions for packing and unpacking values of the various Parrot types.
Parrot::Types
It is used in build_tools/pbc2c.pl.
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.
Parrot::String
pack_key($value)
Returns the specified Parrot::Key value packed into a sequence of bytes.
Parrot::Key
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.
$type
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.
Parrot::PackFile
Parrot::ConstTable
Parrot::Constant
To install Ruby, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Ruby
CPAN shell
perl -MCPAN -e shell install Ruby
For more information on module installation, please visit the detailed CPAN module installation guide.