| 1 |
16
|
mapi |
<?php |
|
| 2 |
53
|
mapi |
/** |
|
| 3 |
↓
|
mapi |
* This file is part of PHP_Depend. |
|
| 4 |
71
|
kore |
* |
|
| 5 |
53
|
mapi |
* PHP Version 5 |
|
| 6 |
↓
|
mapi |
* |
|
| 7 |
1030
|
mapi |
* Copyright (c) 2008-2010, Manuel Pichler <mapi@pdepend.org>. |
|
| 8 |
53
|
mapi |
* All rights reserved. |
|
| 9 |
↓
|
mapi |
* |
|
| 10 |
↓
|
mapi |
* Redistribution and use in source and binary forms, with or without |
|
| 11 |
↓
|
mapi |
* modification, are permitted provided that the following conditions |
|
| 12 |
↓
|
mapi |
* are met: |
|
| 13 |
↓
|
mapi |
* |
|
| 14 |
↓
|
mapi |
* * Redistributions of source code must retain the above copyright |
|
| 15 |
↓
|
mapi |
* notice, this list of conditions and the following disclaimer. |
|
| 16 |
↓
|
mapi |
* |
|
| 17 |
↓
|
mapi |
* * Redistributions in binary form must reproduce the above copyright |
|
| 18 |
↓
|
mapi |
* notice, this list of conditions and the following disclaimer in |
|
| 19 |
↓
|
mapi |
* the documentation and/or other materials provided with the |
|
| 20 |
↓
|
mapi |
* distribution. |
|
| 21 |
↓
|
mapi |
* |
|
| 22 |
↓
|
mapi |
* * Neither the name of Manuel Pichler nor the names of his |
|
| 23 |
↓
|
mapi |
* contributors may be used to endorse or promote products derived |
|
| 24 |
↓
|
mapi |
* from this software without specific prior written permission. |
|
| 25 |
↓
|
mapi |
* |
|
| 26 |
↓
|
mapi |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|
| 27 |
↓
|
mapi |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|
| 28 |
↓
|
mapi |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
|
| 29 |
↓
|
mapi |
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
|
| 30 |
↓
|
mapi |
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
|
| 31 |
↓
|
mapi |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
|
| 32 |
↓
|
mapi |
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
|
| 33 |
↓
|
mapi |
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
|
| 34 |
↓
|
mapi |
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
|
| 35 |
↓
|
mapi |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
|
| 36 |
↓
|
mapi |
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
| 37 |
↓
|
mapi |
* POSSIBILITY OF SUCH DAMAGE. |
|
| 38 |
↓
|
mapi |
* |
|
| 39 |
1115
|
mapi |
* @category PHP |
|
| 40 |
↓
|
mapi |
* @package PHP_Depend |
|
| 41 |
↓
|
mapi |
* @subpackage Code |
|
| 42 |
↓
|
mapi |
* @author Manuel Pichler <mapi@pdepend.org> |
|
| 43 |
↓
|
mapi |
* @copyright 2008-2010 Manuel Pichler. All rights reserved. |
|
| 44 |
↓
|
mapi |
* @license http://www.opensource.org/licenses/bsd-license.php BSD License |
|
| 45 |
↓
|
mapi |
* @version SVN: $Id: ASTUnaryExpression.php 1282 2010-06-06 19:53:09Z mapi $ |
|
| 46 |
↓
|
mapi |
* @link http://www.pdepend.org/ |
|
| 47 |
↓
|
mapi |
* @since 0.9.11 |
|
| 48 |
53
|
mapi |
*/ |
|
| 49 |
18
|
mapi |
|
|
| 50 |
1282
|
mapi |
require_once 'PHP/Depend/Code/ASTExpression.php'; |
|
| 51 |
↓
|
mapi |
|
|
| 52 |
1115
|
mapi |
/** |
|
| 53 |
↓
|
mapi |
* This class represents an unary expression node. |
|
| 54 |
↓
|
mapi |
* |
|
| 55 |
↓
|
mapi |
* <code> |
|
| 56 |
↓
|
mapi |
* // - |
|
| 57 |
↓
|
mapi |
* -$foo |
|
| 58 |
↓
|
mapi |
* // - |
|
| 59 |
↓
|
mapi |
* |
|
| 60 |
↓
|
mapi |
* // - |
|
| 61 |
↓
|
mapi |
* +$foo |
|
| 62 |
↓
|
mapi |
* // - |
|
| 63 |
↓
|
mapi |
* |
|
| 64 |
↓
|
mapi |
* // - |
|
| 65 |
↓
|
mapi |
* &$foo |
|
| 66 |
↓
|
mapi |
* // - |
|
| 67 |
↓
|
mapi |
* </code> |
|
| 68 |
↓
|
mapi |
* |
|
| 69 |
↓
|
mapi |
* @category PHP |
|
| 70 |
↓
|
mapi |
* @package PHP_Depend |
|
| 71 |
↓
|
mapi |
* @subpackage Code |
|
| 72 |
↓
|
mapi |
* @author Manuel Pichler <mapi@pdepend.org> |
|
| 73 |
↓
|
mapi |
* @copyright 2008-2010 Manuel Pichler. All rights reserved. |
|
| 74 |
↓
|
mapi |
* @license http://www.opensource.org/licenses/bsd-license.php BSD License |
|
| 75 |
↓
|
mapi |
* @version Release: @package_version@ |
|
| 76 |
↓
|
mapi |
* @link http://www.pdepend.org/ |
|
| 77 |
↓
|
mapi |
* @since 0.9.11 |
|
| 78 |
↓
|
mapi |
*/ |
|
| 79 |
1282
|
mapi |
class PHP_Depend_Code_ASTUnaryExpression extends PHP_Depend_Code_ASTExpression |
|
| 80 |
1115
|
mapi |
{ |
|
| 81 |
↓
|
mapi |
/** |
|
| 82 |
↓
|
mapi |
* Type of this node class. |
|
| 83 |
↓
|
mapi |
*/ |
|
| 84 |
↓
|
mapi |
const CLAZZ = __CLASS__; |
|
| 85 |
1218
|
mapi |
|
|
| 86 |
↓
|
mapi |
/** |
|
| 87 |
↓
|
mapi |
* Accept method of the visitor design pattern. This method will be called |
|
| 88 |
↓
|
mapi |
* by a visitor during tree traversal. |
|
| 89 |
↓
|
mapi |
* |
|
| 90 |
↓
|
mapi |
* @param PHP_Depend_Code_ASTVisitorI $visitor The calling visitor instance. |
|
| 91 |
↓
|
mapi |
* @param mixed $data Optional previous calculated data. |
|
| 92 |
↓
|
mapi |
* |
|
| 93 |
↓
|
mapi |
* @return mixed |
|
| 94 |
↓
|
mapi |
* @since 0.9.12 |
|
| 95 |
↓
|
mapi |
*/ |
|
| 96 |
↓
|
mapi |
public function accept(PHP_Depend_Code_ASTVisitorI $visitor, $data = null) |
|
| 97 |
↓
|
mapi |
{ |
|
| 98 |
1248
|
mapi |
return $visitor->visitUnaryExpression($this, $data); |
|
| 99 |
1218
|
mapi |
} |
|
| 100 |
1115
|
mapi |
} |
|