public static function parse($line, $statement) { $line = explode(' ', $line); if(!isset($line[1])) $line[1] = "'.'"; else $line[1] = \AIP\lib\srvr\Reflectionizer::parse_statement($line[1]); return self::_get_namespaced_self() . '::execute(' . $line[1] . ')'; }
protected static function reflection_target_to_reflection($target) { $current_reflection = S\evlr\Evaluer::reflection(); if(is_array($target)) { if($target[0] === '$this') { $method = substr($target[1], 0, -2); if(!$current_reflection instanceof \ReflectionClass) die('CONSTRUCT::44'); if(!$current_reflection->hasMethod($method)) die('CONSTRUCT::45'); return $current_reflection->getMethod($method); } elseif(substr($target[0], 0, 1) === '$') { $var_name = substr($target[0], 1); $sandbox_vars = S\evlr\Evaluer::sandbox_vars(); if(!isset($sandbox_vars[$var_name])) die('CONSTRUCT::55'); $var = $sandbox_vars[$var_name]; if(!is_object($var)) die('CONSTRUCT::58'); $reflection = new S\Reflectionizer(array($var, $target[1])); return $reflection->reflectionize(); } else { $reflection = new S\Reflectionizer($target); return $reflection->reflectionize(); } } elseif(substr($target, 0, 1) === '$') { $var_name = substr($target, 1); $sandbox_vars = S\evlr\Evaluer::sandbox_vars(); if(!isset($sandbox_vars[$var_name])) die('CONSTRUCT::67'); $reflection = new S\Reflectionizer($sandbox_vars[$var_name]); return $reflection->reflectionize(); } else { $reflection = new S\Reflectionizer($target); return $reflection->reflectionize(); } }