Template::Alloy::Parse 1.006
Sponsored Links
Template::Alloy::Parse 1.006 Ranking & Summary
File size:
0.14 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
832
Date added:
2007-07-14
Publisher:
Paul Seamons
Template::Alloy::Parse 1.006 description
Template::Alloy::Parse is a Perl module with common parsing role for creating AST from templates.
The Template::Alloy::Parse role is reponsible for storing the majority of directive parsing code, as well as for delegating to the TT, HTE, Tmpl, and Velocity roles for finding variables and directives.
ROLE METHODS
parse_tree
Used by load_tree. This is the main grammar engine of the program. It delegates to the syntax found in $self->{SYNTAX} (defaults to alloy) and calls the function found in the $SYNTAX hashref. The majority of these syntaxes use methods found in the $DIRECTIVES hashref to parse different DIRECTIVE types for each particular syntax.
A template that looked like the following:
Foo
[%- GET foo -%]
[%- GET bar -%]
Bar
would parse to the following AST:
[
Foo,
[GET, 6, 15, [foo, 0]],
[GET, 22, 31, [bar, 0]],
Bar,
]
The "GET" words represent the directive used. The 6, 15 represent the beginning and ending characters of the directive in the document. The remaining items are the variables necessary for running the particular directive.
parse_expr
Used to parse a variable, an expression, a literal string, or a number. It returns a parsed variable tree. Samples of parsed variables can be found in the VARIABLE PARSE TREE section.
my $str = "1 + 2 * 3";
my $ast = $self->parse_expr($str);
# $ast looks like [[undef, +, 1, [[undef, *, 2, 3], 0]], 0]
parse_args
Allow for the multitudinous ways that TT parses arguments. This allows for positional as well as named arguments. Named arguments can be separated with a "=" or "=>", and positional arguments should be separated by " " or ",". This only returns an array of parsed variables. To get the actual values, you must call play_expr on each value.
dump_parse_tree
This method allows for returning a string of perl code representing the AST of the parsed tree.
It is mainly used for testing.
dump_parse_expr
This method allows for returning a Data::Dumper dump of a parsed variable. It is mainly used for testing.
parse_*
Methods by these names are used by parse_tree to parse the template. These are the grammar. They are used by all of the various template syntaxes Unless otherwise mentioned, these methods are not exposed via the role.
The Template::Alloy::Parse role is reponsible for storing the majority of directive parsing code, as well as for delegating to the TT, HTE, Tmpl, and Velocity roles for finding variables and directives.
ROLE METHODS
parse_tree
Used by load_tree. This is the main grammar engine of the program. It delegates to the syntax found in $self->{SYNTAX} (defaults to alloy) and calls the function found in the $SYNTAX hashref. The majority of these syntaxes use methods found in the $DIRECTIVES hashref to parse different DIRECTIVE types for each particular syntax.
A template that looked like the following:
Foo
[%- GET foo -%]
[%- GET bar -%]
Bar
would parse to the following AST:
[
Foo,
[GET, 6, 15, [foo, 0]],
[GET, 22, 31, [bar, 0]],
Bar,
]
The "GET" words represent the directive used. The 6, 15 represent the beginning and ending characters of the directive in the document. The remaining items are the variables necessary for running the particular directive.
parse_expr
Used to parse a variable, an expression, a literal string, or a number. It returns a parsed variable tree. Samples of parsed variables can be found in the VARIABLE PARSE TREE section.
my $str = "1 + 2 * 3";
my $ast = $self->parse_expr($str);
# $ast looks like [[undef, +, 1, [[undef, *, 2, 3], 0]], 0]
parse_args
Allow for the multitudinous ways that TT parses arguments. This allows for positional as well as named arguments. Named arguments can be separated with a "=" or "=>", and positional arguments should be separated by " " or ",". This only returns an array of parsed variables. To get the actual values, you must call play_expr on each value.
dump_parse_tree
This method allows for returning a string of perl code representing the AST of the parsed tree.
It is mainly used for testing.
dump_parse_expr
This method allows for returning a Data::Dumper dump of a parsed variable. It is mainly used for testing.
parse_*
Methods by these names are used by parse_tree to parse the template. These are the grammar. They are used by all of the various template syntaxes Unless otherwise mentioned, these methods are not exposed via the role.
Template::Alloy::Parse 1.006 Screenshot
Advertisements
Template::Alloy::Parse 1.006 Keywords
AST
Parse 1.006
Perl module
Found In
parse
tree
used
role
Perl
parsing
Template::Alloy::Parse
TemplateAlloyParse
Template::Alloy::Parse 1.006
Libraries
Programming
Bookmark Template::Alloy::Parse 1.006
Template::Alloy::Parse 1.006 Copyright
WareSeeker periodically updates pricing and software information of Template::Alloy::Parse 1.006 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Template::Alloy::Parse 1.006 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
Related Software
Template::Alloy is a TT2/3, HT, HTE, Tmpl, and Velocity Engine. Free Download
Template::Alloy::Operator is a Perl module that provides the regexes necessary for Template::Alloy::Parse to parse operators. Free Download
Template::Alloy::VMethod is a Perl module with VMethod role. Free Download
Template::Alloy::TT Perl module contains a Template::Toolkit role. Free Download
Template::Parser::CET is a Template::Alloy based parser for the TT2 engine. Free Download
Template::Ast is a Perl module to process ASTs for Perl Template Toolkit. Free Download
Mail::Box::Parser::C is a Perl module that can parse folders for MailBox with C routines. Free Download
Template::Plugins is a Perl module with plugin provider module. Free Download
Latest Software
Popular Software
Favourite Software