-
-
16 Apr 2012 21:20:13 UTC
- Distribution: KinoSearch
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (5)
- Testers (536 / 133 / 8)
- Kwalitee
Bus factor: 0- 85.27% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (852.87KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors- Marvin Humphrey <marvin at rectangular dot com>
- Dependencies
- JSON::XS
- Lingua::Stem::Snowball
- Lingua::StopWords
- Parse::RecDescent
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Clownfish::Variable - A Clownfish variable.
DESCRIPTION
A variable, having a Type, a micro_sym (i.e. name), an exposure, and optionally, a location in the global namespace hierarchy.
Variable objects which exist only within a local scope, e.g. those within parameter lists, do not need to know about class. In contrast, inert class vars, for example, need to know class information so that they can declare themselves properly.
METHODS
new
my $var = Clownfish::Variable->new( parcel => 'Crustacean', type => $int32_t_type, # required micro_sym => 'average_lifespan', # required exposure => 'parcel', # default: 'local' class_name => "Crustacean::Lobster", # default: undef class_cnick => "Lobster", # default: undef );
type - A Clownfish::Type.
micro_sym - The variable's name, without any namespacing prefixes.
exposure - See Clownfish::Symbol.
class_name - See Clownfish::Symbol.
class_cnick - See Clownfish::Symbol.
local_c
# e.g. "int32_t average_lifespan" print $variable->local_c;
Returns a string with the Variable's C type and its
micro_sym
.global_c
# e.g. "int32_t crust_Lobster_average_lifespan" print $variable->global_c;
Returns a string with the Variable's C type and its fully qualified name within the global namespace.
local_declaration
# e.g. "int32_t average_lifespan;" print $variable->local_declaration;
Returns C code appropriate for declaring the variable in a local scope, such as within a struct definition, or as an automatic variable within a C function.
COPYRIGHT AND LICENSE
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.
Module Install Instructions
To install KSx::Simple, copy and paste the appropriate command in to your terminal.
cpanm KSx::Simple
perl -MCPAN -e shell install KSx::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.