Regexp::Parser::Objects

Objects for Perl 5 regexes
Download

Regexp::Parser::Objects Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Jeff Pinyan
  • Publisher web site:
  • http://search.cpan.org/~pinyan/YAPE-Regex-3.03/Regex/Element.pm

Regexp::Parser::Objects Tags


Regexp::Parser::Objects Description

Objects for Perl 5 regexes Regexp::Parser::Objects is a Perl module that contains the object definitions for Regexp::Parser.InheritanceAll Regexp::Parser::* objects inherit from Regexp::Parser::__object__, the global object base class. All user-defined MyRx::* objects inherit from MyRx::__object__ first, then from the Regexp::Parser::* object of the same name, and finally from Regexp::Parser::__object__. Don't worry -- if you don't define a base class for your module's objects, or the object you create isn't a modification of a standard object, no warnings will be issued.The __object__ Base ClassAll nodes inherit from Regexp::Parser::__object__ the following methods:my $d = $obj->data() The object's data. This might be an array reference (for a 'branch' node), another object (for a 'quant' node), or it might not exist at all (for an 'anchor' node).my $e = $obj->ender() The arguments to object() to create the ending node for this object. This is used by the walk() method. Typically, a capturing group's ender is a close node, any other assertion's ender is a tail node, and a character class's ender is an anyof_close node.my $c = $obj->family() The general family of this object. These are any of: alnum, anchor, anyof, anyof_char, anyof_class, anyof_range, assertion, branch, close, clump, digit, exact, flags, group, groupp, minmod, prop, open, quant, ref, reg_any.my $f = $obj->flags() The flag value for this object. This value is a number created by OR'ing together the flags that are enabled at the time.$obj->insert() Inserts this object into the tree. It returns a value that says whether or not it ended up being merged with the previous object in the tree.my $m = $obj->merge() Merges this node with the previous one, if they are of the same type. If it is called after $obj has been added to the tree, $obj will be removed from the tree. Most node types don't merge. Returns true if the node was merged with the previous one.my $o = $obj->omit()my $o = $obj->omit(VALUE) Whether this node is omitted from the parse tree. Certain objects do not need to appear in the tree, but are needed when inspecting the parsing, or walking the tree. You can also set this attribute by passing a value.my $q = $obj->qr() The regex representation of this object. It includes the regex representation of any children of the object.my $r = $obj->raw() The raw representation of this object. It does not look at the children of the object, just itself. This is used primarily when inspecting the parsing of the regex.my $t = $obj->type() The specific type of this object. See the object's documentation for possible values for its type.my $v = $obj->visual() The visual representation of this object. It includes the visual representation of any children of the object.$obj->walk() "Walks" the object. This is used to dive into the node's children when using a walker (see "Walking the Tree" in Regexp::Parser).Objects may override these methods (as objects often do). Requirements: · Perl


Regexp::Parser::Objects Related Software