Ejemplo n.º 1
0
 protected function splitExpressionString()
 {
     $tokenizer = new ExpressionTokenizer('{', '}');
     $tokens = $tokenizer->tokenize($this->expressionString);
     if ($tokens != null) {
         foreach ($tokens as $token) {
             if (is_array($token)) {
                 $this->expressionParts[] = new ExpressionContent($token);
             } else {
                 $this->expressionParts[] = $token;
             }
         }
     }
 }
Ejemplo n.º 2
0
 private function parseBrackets()
 {
     $tokenizer = new ExpressionTokenizer('(', ')');
     $tokens = $tokenizer->tokenize($this->contentString);
     if ($tokens != null) {
         for ($i = 0; $i < count($tokens); $i++) {
             if (is_array($tokens[$i])) {
                 $this->bracketParts[] = new ExpressionBracket($tokens[$i], $this->contentParts);
                 //, $this->operationParts);
                 $this->bracketString .= '(' . $i . ')';
             } else {
                 $this->bracketParts[] = $tokens[$i];
                 $this->bracketString .= $tokens[$i];
             }
         }
     }
 }