Clownfish::Type - A variable's type.
my $type = MyType->new( specifier => 'char', # default undef indirection => undef, # default 0 const => 1, # default undef parcel => undef, # default undef c_string => undef, # default undef );
Abstract constructor.
specifier - The C name for the type, not including any indirection or array subscripts.
indirection - integer indicating level of indirection. Example: the C type "float**" has a specifier of "float" and indirection 2.
const - should be true if the type is const.
parcel - A Clownfish::Parcel or a parcel name.
c_string - The C representation of the type.
do_stuff() if $type->equals($other);
Returns true if two Clownfish::Type objects are equivalent. The default implementation merely checks that $other is a Clownfish::Type object, so it should be overridden in all subclasses.
$other
# Declare variable "foo". print $type->to_c . " foo;\n";
Return the C representation of the type.
Set the C representation of the type.
Accessors.
do_stuff() if $type->is_object;
Shorthand for various $type->isa($package) calls.
is_object: Clownfish::Type::Object
is_primitive: Clownfish::Type::Primitive
is_integer: Clownfish::Type::Integer
is_floating: Clownfish::Type::Float
is_void: Clownfish::Type::Void
is_composite: Clownfish::Type::Composite
Returns true if $type represents a Clownfish type which holds unicode strings.
Copyright 2008-2011 Marvin Humphrey
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install KSx::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm KSx::Simple
CPAN shell
perl -MCPAN -e shell install KSx::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.