diff options
author | Christian <c@ethdev.com> | 2014-10-25 22:52:22 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2014-10-29 21:33:25 +0800 |
commit | b5a4d12fa328f69d4dfba9bf57ac289935877649 (patch) | |
tree | dfa92c635af822197b7bb25a7b23870d1d26a179 /AST.h | |
parent | 01224287f5e24f7074f398ac9b064b27b2c3877e (diff) | |
download | dexon-solidity-b5a4d12fa328f69d4dfba9bf57ac289935877649.tar dexon-solidity-b5a4d12fa328f69d4dfba9bf57ac289935877649.tar.gz dexon-solidity-b5a4d12fa328f69d4dfba9bf57ac289935877649.tar.bz2 dexon-solidity-b5a4d12fa328f69d4dfba9bf57ac289935877649.tar.lz dexon-solidity-b5a4d12fa328f69d4dfba9bf57ac289935877649.tar.xz dexon-solidity-b5a4d12fa328f69d4dfba9bf57ac289935877649.tar.zst dexon-solidity-b5a4d12fa328f69d4dfba9bf57ac289935877649.zip |
Compiler for assignments.
Diffstat (limited to 'AST.h')
-rw-r--r-- | AST.h | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -402,13 +402,17 @@ private: class Expression: public Statement { public: - Expression(Location const& _location): Statement(_location) {} + Expression(Location const& _location): Statement(_location), m_isLvalue(false) {} std::shared_ptr<Type const> const& getType() const { return m_type; } + bool isLvalue() const { return m_isLvalue; } protected: //! Inferred type of the expression, only filled after a call to checkTypeRequirements(). std::shared_ptr<Type const> m_type; + //! Whether or not this expression is an lvalue, i.e. something that can be assigned to. + //! This is set during calls to @a checkTypeRequirements() + bool m_isLvalue; }; /// @} @@ -492,6 +496,9 @@ public: virtual void accept(ASTVisitor& _visitor) override; virtual void checkTypeRequirements() override; + Expression& getExpression() const { return *m_expression; } + std::vector<ASTPointer<Expression>> const& getArguments() const { return m_arguments; } + /// Returns true if this is not an actual function call, but an explicit type conversion /// or constructor call. bool isTypeConversion() const; |