2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010- Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
17 #ifndef incl_HPHP_PHP7_LVALUE_H
18 #define incl_HPHP_PHP7_LVALUE_H
20 #include "hphp/runtime/vm/hhbc.h"
21 #include "hphp/php7/zend/zend.h"
22 #include "hphp/php7/bytecode.h"
23 #include "hphp/php7/cfg.h"
25 namespace HPHP
{ namespace php7
{
27 /* This is a value that we can take a base pointer to--different from Lvalue
28 * since PHP has values that can be indexed but not assigned to: namely, array
32 virtual ~BaseValue() = default;
35 virtual CFG
getB(MinstrSeq
& seq
) = 0;
38 /* This is a PHP value that acts like an lvalue--that is, it can be both read
39 * from or assigned to. Mostly this corresponds to locals, but other lvalues
40 * are object properties or elements of an array
42 struct Lvalue
: BaseValue
{
43 /* Get an lvalue for an expression--if the expression is not an lvalue,
45 static std::unique_ptr
<Lvalue
> getLvalue(const zend_ast
* ast
);
47 virtual CFG
getC() = 0;
48 virtual CFG
getV() = 0;
49 virtual CFG
getF(uint32_t slot
) = 0;
50 virtual CFG
assign(const zend_ast
* rhs
) = 0;
51 virtual CFG
bind(const zend_ast
* rhs
) = 0;
52 virtual CFG
assignOp(SetOpOp op
, const zend_ast
* rhs
) = 0;
53 virtual CFG
incDec(IncDecOp op
) = 0;
58 #endif // incl_HPHP_PHP7_LVALUE_H