Decl::Semantics::Code - implements some code (perl or otherwise) in a declarative framework.
Version 0.01
This class serves two purposes: first, it's an example of what a semantic node class should look like, and second, it will probably end up being the class that builds most of the code references in a declarative program.
Called by Decl::Semantics during import, to find out what tags this plugin claims to implement and the parsers used to build its content.
The build_payload function is then called when this object's payload is built (i.e. in the stage when we're adding semantics to our parsed syntax). The payload of a code object is its callable code result.
build_payload
The make_code function builds code in an event context; it actually calls make_macro_code, which does the same in an arbitrary node context that you supply (but that defaults to the event context of the code node).
make_code
make_macro_code
The parent's payload will always have been created by the time this function is called.
The make_select function is by far the most complex of our code generators, as it has to find an iterator source and build a while loop, or a DBI database and build a query and select loop. The parsing is split out into parse_select in order to make it usable from elsewhere.
make_select
parse_select
The make_dml function handles the non-select DBI keywords (just 'insert', 'update', and 'delete').
make_dml
The fix* functions munge various things around in our code generation scheme.
fix*
The make_output function handles text blocks for output delineated with "<<".
make_output
The make_ifnew is probably going overboard with specific select tweaks; I really need to start thinking harder about real macros in the code.
make_ifnew
Michael Roberts, <michael at vivtek.com>
<michael at vivtek.com>
Please report any bugs or feature requests to bug-decl at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Decl. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-decl at rt.cpan.org
Copyright 2010 Michael Roberts.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Decl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Decl
CPAN shell
perl -MCPAN -e shell install Decl
For more information on module installation, please visit the detailed CPAN module installation guide.