Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.339.417 Times

Regexp::Parser::Handlers 0.20

  Date Added: November 06, 2010  |  Visits: 636

Regexp::Parser::Handlers

Report Broken Link
Printer Friendly Version


Product Homepage
Download (86 downloads)



Regexp::Parser::Handlers is a Perl module with handlers for Perl 5 regexes. This module holds the init() method for the Regexp::Parser class, which installs all the handlers for standard Perl 5 regexes. This documentation contains a sub-classing tutorial. SUB-CLASSING I will present two example sub-classes, Regexp::NoCode, and Regexp::AndBranch. Parser Internals The parser object is a hash reference with the following keys: regex A reference to the original string representation of the regex. len The length of the original string representation of the regex. tree During the first pass, tree is undef, which instructs the object() method not to actually create any objects. Afterwards, it is an array reference of (node) objects. stack Initially an array reference, used to store the tree as a new scope is entered and then exited. The general concept is: if (into_scope) { push STACK, TREE; TREE = CURRENT->DATA; } if (outof_scope) { TREE = pop STACK; } After the tree has been created, this key is deleted; this gives the code a way to be sure compilation was successful. maxpar The highest number of parentheses. It will end up being identical to nparen, but it is incremented during the initial pass, so that on the second pass (the tree-building), it can distinguish back-references from octal escapes. (The source code to Perls regex compiler does the same thing.) nparen The number of OPENs (capturing groups) in the regex. captures An array reference to the open nodes. flags An array reference of flag values. When a scope is entered, the top value is copied and pushed onto the stack. When a scope is left, the top value is popped and discarded. It is important to do this copy-and-push before you do any flag-parsing, if youre adding a handle that might parse flags, because you do not want to accidentally affect the previous scopes flag values. Here is example code from the handler for (?ismx) and (?ismx:...): # (?i:...) <-- the i is only inside the (?:...) # (?i) <-- the i affects the rest of this scope # so if were a (?:...), copy-and-push if ($type eq group) { push @{ $S->{flags} }, &Rf; push @{ $S->{next} }, qw< c) atom >; } for (split //, $on) { if (my $h = $S->can("FLAG_$_")) { my $v = $h->(1); # 1 means this is on if ($v) { &Rf |= $v } # turn the flag on else { ... } # the flags value is 0 next; } # throw an error if the flag isnt supported } for (map "FLAG_$_", split //, $off) { if (my $h = $S->can("FLAG_$_")) { my $v = $h->(0); # 0 means this is off if ($v) { &Rf &= ~$v } # turn the flag off else { ... } # the flags value is 0 next; } # throw an error if the flag isnt supported } Youll probably not be adding handlers that have to parse flags, but if you do, remember to follow this model correctly. next An array reference of what handles (or "rules") to try to match next..

Requirements: No special requirements
Platforms: Linux
Keyword: Flag Handlers Libraries Perl Perl Module Programming Reference Regex Regexpparserhandlers Scope Tree
Users rating: 0/10

License: Freeware Size: 40.96 KB
USER REVIEWS
More Reviews or Write Review


REGEXP::PARSER::HANDLERS RELATED
Libraries  -  Alien Perl module 0.91
Alien Perl module package contains external libraries wrapped up for your viewing pleasure! SYNOPSIS perldoc Alien; Alien is a package that exists just to hold together an idea, the idea of Alien:: packages, so there is no code here, just...
10.24 KB  
Libraries  -  OpenGeoDB Perl module 0.4
OpenGeDB Perl module is a module to access the OpenGeoDB database and calculate all ZIP codes in a certain radius..
3.07 KB  
Network & Internet  -  MyCMS perl module 1.0
MyCMS perl module provides the MN::CMS Perl module used by the MyCMS. MyCMS perl module contains Perl object classes to manage the data of MyCMS (such as articles, links, and images). MN::CMS is a perl module that allows you to manage an...
16.38 KB  
Programming  -  Perl Module Manager 1.2.0.18
Perl Module Manager helps you to install, un-install and manage Perl modules from a CPAN site and other sources in an easy and intuitive way. Allows you to search through thousands of useful modules and libraries on a CPAN site and its mirrors....
1.44 MB  
Libraries  -  perlfaq3 5.8.8
perlfaq3 Perl module contains programming tools. How do I do (anything)? Have you looked at CPAN (see perlfaq2)? The chances are that someone has already written a module that can solve your problem. Have you read the appropriate manpages?...
12.2 MB  
Libraries  -  Scrape::USPS::ZipLookup Perl Module 2.4
The United States Postal Service (USPS) has on its web site an HTML form at http://www.usps.com/zip4/ for standardizing an address. Given a firm, urbanization, street address, city, state, and zip, it will put the address into standard form...
11.26 KB  
Science  -  Bio::Parse::SwissProt - perl module 0.5
A Perl module that provides methods for retrieving each and every field from a standard SwissProt file.
9.61 KB  
Benchmark Tools  -  Stopwatch Perl Module 0.10.3
Perf::Stopwatch is a Perl Module that can be quickly added and removed from any existing code to debug/optimize portions of code. Example of use are: database calls, loop efficiency, total script time, and webpage timeouts.
5.98 KB  
Libraries  -  Bio::Tree::Compatible 1.5.2_102
Bio::Tree::Compatible is a Perl module for testing compatibility of phylogenetic trees with nested taxa. SYNOPSIS use Bio::Tree::Compatible; use Bio::TreeIO; my $input = new Bio::TreeIO(-format => newick, -file => input.tre); my $t1 =...
5.6 MB  
Libraries  -  Sub::Regex 0.02
Sub::Regex is a Perl module to create synonymous subroutines. SYNOPSIS use Sub::Regex; sub /look(s|ing)?_for/ ($){ foobar blah blah } look_for(Amanda); looks_for(Amanda); looking_for(Amanda); lOoKiNg_fOr(Amanda); Sub::Regex is a...
2.05 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB