aboutsummaryrefslogtreecommitdiffstats
path: root/AST.h
diff options
context:
space:
mode:
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;