Hoa central
Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Hoa\Realdom\Regex Class Reference
Inheritance diagram for Hoa\Realdom\Regex:

Public Attributes

const NAME = 'regex'
 
- Public Attributes inherited from Hoa\Realdom\Realdom
const NAME = '(null)'
 

Protected Member Functions

 construct ()
 
 _predicate ($q)
 
 _sample (Math\Sampler $sampler)
 
- Protected Member Functions inherited from Hoa\Realdom\Realdom
 construct ()
 
 setValue ($sampled)
 
 resetArguments ()
 
 _predicate ($q)
 
 _sample (Math\Sampler $sampler)
 
getConstraints ()
 
 _propagateConstraints ($type, $index, Array &$constraints)
 

Protected Attributes

 $_arguments
 
 $_ast = null
 
- Protected Attributes inherited from Hoa\Realdom\Realdom
 $_arguments = null
 
 $arguments = null
 
 $__sampler = null
 
 $_value = null
 
 $_constraints = null
 
 $_holder = null
 
 $_constructed = false
 
 $_praspelVisitor = null
 

Static Protected Attributes

static $_compiler = null
 
static $_visitor = null
 
- Static Protected Attributes inherited from Hoa\Realdom\Realdom
static $_sampler = null
 
static $_maxtry = 64
 
static $_defaultPraspelVisitor = null
 

Additional Inherited Members

- Public Member Functions inherited from Hoa\Realdom\Realdom
 __construct ()
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 getArguments ()
 
 count ()
 
 getName ()
 
 setSampler (Math\Sampler $sampler)
 
 getSampler ()
 
 getValue ()
 
 reset ()
 
 predicate ($q)
 
 sample (Math\Sampler $sampler=null)
 
 intersectWith (Realdom $realdom)
 
 setConstraints (Array &$constraints)
 
 propagateConstraints ($type, $index)
 
 is ($qualifier)
 
 setHolder (IRealdom\Holder $holder)
 
 getHolder ()
 
 setPraspelVisitor (Visitor\Visit $visitor)
 
 getPraspelVisitor ()
 
 accept (Visitor\Visit $visitor, &$handle=null, $eldnah=null)
 
- Public Member Functions inherited from Hoa\Visitor\Element
 accept (Visit $visitor, &$handle=null, $eldnah=null)
 
- Static Public Member Functions inherited from Hoa\Realdom\Realdom
static autoBoxing (Array &$arguments, Realdom $self=null)
 
static setDefaultSampler (Math\Sampler $sampler)
 
static getDefaultSampler ()
 
static setMaxTry ($maxtry)
 
static getMaxTry ()
 
static setDefaultPraspelVisitor (Visitor\Visit $visitor)
 
static getDefaultPraspelVisitor ()
 

Detailed Description

Class .

Realistic domain: regex.

Definition at line 52 of file Regex.php.

Member Function Documentation

Hoa\Realdom\Regex::_predicate (   $q)
protected

Predicate whether the sampled value belongs to the realistic domains.

Parameters
mixed$qSampled value.
Returns
boolean

Definition at line 127 of file Regex.php.

128  {
129  return 0 !== preg_match($this['regex']->getConstantValue(), $q);
130  }
Hoa\Realdom\Regex::_sample ( Math\Sampler  $sampler)
protected

Sample one new value.

Parameters
\Hoa\Math\Sampler$samplerSampler.
Returns
mixed

Definition at line 138 of file Regex.php.

139  {
140  if (null === self::$_visitor) {
141  self::$_visitor = new HoaRegex\Visitor\Isotropic($sampler);
142  }
143 
144  return self::$_visitor->visit($this->_ast);
145  }
Hoa\Realdom\Regex::construct ( )
protected

Construct a realistic domain.

Returns
void

Definition at line 98 of file Regex.php.

99  {
100  if (null === self::$_compiler) {
101  self::$_compiler = Compiler\Llk::load(
102  new File\Read('hoa://Library/Regex/Grammar.pp')
103  );
104  }
105 
106  if (!isset($this['regex'])) {
107  $this['regex'] = new Conststring('');
108  }
109 
110  $this->_ast = self::$_compiler->parse(
111  mb_substr(
112  $regex = $this['regex']->getConstantValue(),
113  1,
114  mb_strrpos($regex, mb_substr($regex, 0, 1), 1) - 1
115  )
116  );
117 
118  return;
119  }

Member Data Documentation

Hoa\Realdom\Regex::$_arguments
protected
Initial value:
= [
'Conststring regex'
]

Definition at line 66 of file Regex.php.

Hoa\Realdom\Regex::$_ast = null
protected

Definition at line 89 of file Regex.php.

Hoa\Realdom\Regex::$_compiler = null
staticprotected

Definition at line 75 of file Regex.php.

Hoa\Realdom\Regex::$_visitor = null
staticprotected

Definition at line 82 of file Regex.php.

const Hoa\Realdom\Regex::NAME = 'regex'

Realistic domain name.

string

Definition at line 59 of file Regex.php.


The documentation for this class was generated from the following file: