コード例 #1
0
ファイル: VariableExpression.php プロジェクト: timetoogo/pinq
 protected function compileCode(&$code)
 {
     if ($this->name instanceof ValueExpression && self::isNormalSyntaxName($this->name->getValue())) {
         $code .= '$' . $this->name->getValue();
     } else {
         $code .= '${';
         $this->name->compileCode($code);
         $code .= '}';
     }
 }
コード例 #2
0
 protected function compileCode(&$code)
 {
     if ($this->name instanceof ValueExpression) {
         $code .= $this->name->getValue();
     } else {
         $this->name->compileCode($code);
     }
     $code .= '(';
     $code .= implode(',', self::compileAll($this->arguments));
     $code .= ')';
 }
コード例 #3
0
 protected function compileCode(&$code)
 {
     $code .= '(';
     $this->leftOperand->compileCode($code);
     $code .= ' ' . $this->operator . ' ';
     if ($this->operator === Operators\Binary::IS_INSTANCE_OF && $this->rightOperand instanceof ValueExpression) {
         $code .= $this->rightOperand->getValue();
     } else {
         $this->rightOperand->compileCode($code);
     }
     $code .= ')';
 }
コード例 #4
0
 protected function compileCode(&$code)
 {
     $this->value->compileCode($code);
     $code .= '->';
     if ($this->name instanceof ValueExpression && self::isNormalSyntaxName($this->name->getValue())) {
         $code .= $this->name->getValue();
     } else {
         $code .= '{';
         $this->name->compileCode($code);
         $code .= '}';
     }
     $code .= '(';
     $code .= implode(',', self::compileAll($this->arguments));
     $code .= ')';
 }
コード例 #5
0
 protected function compileType(&$code, Expression $typeExpression)
 {
     if ($typeExpression instanceof ValueExpression) {
         $code .= $typeExpression->getValue();
     } else {
         $typeExpression->compileCode($code);
     }
 }
コード例 #6
0
ファイル: BaseGrammar.php プロジェクト: yb199478/framework
 /**
  * 获取表达式的值
  *
  * @param Expression $expression 表达式
  * @return string
  */
 public function getValue($expression)
 {
     return $expression->getValue();
 }