Parse::RandGen::Condition

Parse::RandGen::Condition is a base class for condition elements that contain an element and a match quantifier.
Download

Parse::RandGen::Condition Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Jeff Dutton
  • Publisher web site:
  • http://search.cpan.org/~jdutton/Parse-RandGen-0.202/RandGen/Condition.pm

Parse::RandGen::Condition Tags


Parse::RandGen::Condition Description

Parse::RandGen::Condition is a base class for condition elements that contain an element and a match quantifier. Parse::RandGen::Condition is a base class for condition elements that contain an element (regex, subrule, literal) and a match quantifier.METHODSnewThis method cannot be called directly from the Condition class (it must be called on a specific derived Condition class). The first argument (required) is the condition element. The required element type depends on the specific Condition class being constructed.All other arguments are named pairs.Some classes (Subrule and CharClass) support the optional arguments "min" and "max", which represent the number of times that the subrule must match for the condition to match.The "quant" quantifier argument can also be used in place of "min" and "max". The values are the familiar '+', '?', or '*' (also can be 's', '?', or 's?', respectively).Any unknown named arguments are treated as user-defined fields. They are stored in the Condition hash ($cond->{}). Parse::RandGen::Literal->new("Don't mess with Texas!"); Parse::RandGen::Regexp->new(qr/Hello( World)?/, userDefinedField => $example ); Parse::RandGen::Subrule->new("match_rule", quant=>'+' ); # This indirect reference to the "match_rule" rule requires a Grammar for lookup. Parse::RandGen::Subrule->new($myRuleObjRef, min=>2, max=>3 );pickReturns random data for the Condition. Takes an optional named pair argument "match" that specifies whether the data chosen should match the Condition element or not. $conditionObject->pick( match=>1 );element, min, maxReturns the Condition's attribute of the same name.isSubruleReturns true if the given Condition is a Subrule.isTerminalReturns true if the given Condition is a terminal (CharClass or Literal).subruleReturns a reference to the Condition's Rule object (or undef if !isSubrule()).productionReturns the Parse::RandGen::Production object that this Condition belongs to.ruleReturns the Parse::RandGen::Rule object that this Condition's Production belongs to (returns production()->rule()).grammarReturns the Parse::RandGen::Grammar object that this production belongs to (returns production()->rule()->grammar()).Requirements:· Perl Requirements: · Perl


Parse::RandGen::Condition Related Software