32 return $this->error =
$error;
38 $this->firstParenthesis = strpos(
$funcCall,
'(');
39 $this->lastParenthesis = strrpos(
$funcCall,
')');
40 $this->lastSemiColumn = strrpos(
$funcCall,
':');
41 $this->inputs = array();
42 $this->outputs = array();
43 $this->outputString =
'';
44 $this->inputString =
'';
49 if (($this->firstParenthesis ===
false) || ($this->lastParenthesis ===
false) || ($this->firstParenthesis >= $this->lastParenthesis)) {
54 if ($this->lastSemiColumn > $this->lastParenthesis) {
57 $spaceUntil = strlen($this->funcCall);
60 for ($i = $this->lastParenthesis + 1; $i < $spaceUntil; $i++) {
61 $c = $this->funcCall[$i];
75 public function parse($methCall, $noOut =
false)
79 $funcName = trim(substr($methCall, 0, $this->firstParenthesis));
80 if (strpos($funcName,
':')) {
81 list(
$appName, $funcName) = explode(
':', $funcName, 2);
85 if ((!$noOut) && ($this->lastSemiColumn < $this->lastParenthesis)) {
91 } elseif (!preg_match(
'/^[a-z0-9_]*$/i',
$appName)) {
94 $this->functionName = $funcName;
96 $inputString = substr($methCall, $this->firstParenthesis + 1, ($this->lastParenthesis - $this->firstParenthesis - 1));
114 for ($i = 0; $i < strlen($this->inputString); $i++) {
115 $c = $this->inputString[$i];
119 } elseif (
$c ==
"'") {
121 } elseif (
$c ==
',') {
122 } elseif (
$c ==
' ') {
133 if ($this->lastSemiColumn > $this->lastParenthesis) {
134 $this->outputString = trim(substr($this->funcCall, $this->lastSemiColumn + 1));
136 if ($this->outputString) {
137 $this->outputs = explode(
',', $this->outputString);
138 foreach ($this->outputs as & $output) {
139 $output = trim($output);
149 return preg_match(
'/^[a-z_][a-z0-9_]*$/i',
$s);
154 return preg_match(
'/^[a-z_\?][a-z0-9_\[\]]*$/i',
$s);
158 return preg_match(
'/^[a-z_][a-z0-9_]*$/i',
$s);
162 return preg_match(
'/^([a-z_][a-z0-9_]*\\\\)*[a-z_][a-z0-9_]*$/i',
$s);
165 private function gotoNextArgument(&$index)
167 for ($i = $index; $i < strlen($this->inputString); $i++) {
169 $c = $this->inputString[$i];
173 } elseif (
$c ==
" ") {
190 for ($i = $index; $i < strlen($this->inputString); $i++) {
192 $c = $this->inputString[$i];
203 if (preg_match(
'/^[a-z_][a-z0-9_]*$/i',
$arg)) {
219 $doubleQuoteDetected =
false;
220 $c = $this->inputString[$index];
224 for ($i = $index + 1; $i < strlen($this->inputString); $i++) {
226 $c = $this->inputString[$i];
233 $doubleQuoteDetected =
true;
245 $this->gotoNextArgument($index);
258 $c = $this->inputString[$index];
263 for ($i = $index + 1; $i < strlen($this->inputString); $i++) {
265 $c = $this->inputString[$i];
274 } elseif (
$c ==
',') {
282 while (
$c ==
' ' &&
$r > 0) {
if(substr($wsh, 0, 1)!= '/') $args
print $fam getTitle() $fam name
parseDoubleQuote(&$index)
static getError($code, $args=null)
parseSimpleQuote(&$index)
isAlphaNumOutAttribute($s)
parse($methCall, $noOut=false)