aboutsummaryrefslogtreecommitdiffstats
path: root/AST.h
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-10-25 22:52:22 +0800
committerChristian <c@ethdev.com>2014-10-29 21:33:25 +0800
commitb5a4d12fa328f69d4dfba9bf57ac289935877649 (patch)
treedfa92c635af822197b7bb25a7b23870d1d26a179 /AST.h
parent01224287f5e24f7074f398ac9b064b27b2c3877e (diff)
downloaddexon-solidity-b5a4d12fa328f69d4dfba9bf57ac289935877649.tar.gz
dexon-solidity-b5a4d12fa328f69d4dfba9bf57ac289935877649.tar.zst
dexon-solidity-b5a4d12fa328f69d4dfba9bf57ac289935877649.zip
Compiler for assignments.
Diffstat (limited to 'AST.h')
-rw-r--r--AST.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/AST.h b/AST.h
index db6637ae..856c222e 100644
--- a/AST.h
+++ b/AST.h
@@ -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;