19 Aug 2009 01:10:20 UTC
- Development release
- Distribution: KinoSearch
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (5)
- Testers (34 / 6 / 10)
- KwaliteeBus factor: 0
- License: perl_5
- Activity24 month
- Download (642.75KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionCREAMYG Marvin Humphreyand 1 contributors
- Marvin Humphrey <marvin at rectangular dot com>
Boilerplater::Variable - A Boilerplater variable.
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.
my $var = Boilerplater::Variable->new( parcel => 'Boil', type => $type, # required micro_sym => 'foo', # required exposure => undef, # default: 'local' class_name => "Foo", # default: undef class_cnick => "Foo", # default: undef );
type - A Boilerplater::Type.
micro_sym - The variable's name, without any namespacing prefixes.
exposure - See Boilerplater::Symbol.
class_name - See Boilerplater::Symbol.
class_cnick - See Boilerplater::Symbol.
# e.g. "boil_Foo *foo" print $variable->local_c;
Returns a string with the Variable's C type and its
# e.g. "boil_Foo *boil_Foo_foo" print $variable->global_c;
Returns a string with the Variable's C type and its fully qualified name within the global namespace.
# e.g. "boil_Foo *foo;" print $variable->local_declaration;
Returns C code appropriate for declaring the variable in a local scope, such as within a C parameter list or struct definition, or as an automatic variable within a C function.
Copyright 2008-2009 Marvin Humphrey
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.