コード例 #1
0
ファイル: ArrayItemNode.php プロジェクト: comos/tage
 public function compile()
 {
     if ($this->keyNode !== null) {
         return sprintf('%s=>%s', $this->keyNode->compile(), $this->valueNode->compile());
     } else {
         return $this->valueNode->compile();
     }
 }
コード例 #2
0
ファイル: MethodNode.php プロジェクト: comos/tage
 public function __construct(array $tokens, array $childNodes = [])
 {
     parent::__construct($tokens, $childNodes);
 }
コード例 #3
0
ファイル: VarNode.php プロジェクト: comos/tage
 public function __construct(Token $varToken)
 {
     parent::__construct(['var' => $varToken]);
 }
コード例 #4
0
ファイル: ConstantNode.php プロジェクト: comos/tage
 public function __construct(Token $constantToken)
 {
     parent::__construct(['constant' => $constantToken]);
 }
コード例 #5
0
ファイル: BinaryNode.php プロジェクト: comos/tage
 public function compile()
 {
     return sprintf('(%s%s%s)', $this->leftNode->compile(), $this->opToken->getValue(), $this->rightNode->compile());
 }
コード例 #6
0
ファイル: TernaryNode.php プロジェクト: comos/tage
 public function compile()
 {
     return sprintf('(%s?%s:%s)', $this->ifNode->compile(), $this->ifBodyNode->compile(), $this->elseBodyNode->compile());
 }
コード例 #7
0
ファイル: PHPCodeNode.php プロジェクト: comos/tage
 public function __construct(Token $phpToken)
 {
     parent::__construct(['php' => $phpToken]);
 }
コード例 #8
0
ファイル: PrintNode.php プロジェクト: comos/tage
 public function __construct(AbstractNode $expressionNode = null, Token $textToken = null)
 {
     parent::__construct(['text' => $textToken], ['expression' => $expressionNode]);
 }
コード例 #9
0
ファイル: CommonTagNode.php プロジェクト: comos/tage
 public function __construct($tagParser)
 {
     parent::__construct(['tag' => $tagParser->getTagToken()], $tagParser->getAttributes());
     $this->tagParser = $tagParser;
 }