LibCpp: Parse C++ cast expressions

parse static_cast, reinterpret_cast, dynamic_cast & const_cast
This commit is contained in:
Itamar 2021-03-31 22:21:31 +03:00 committed by Andreas Kling
commit 8962581c9c
Notes: sideshowbarker 2024-07-18 20:41:45 +09:00
4 changed files with 74 additions and 1 deletions

View file

@ -696,4 +696,20 @@ public:
NonnullRefPtrVector<Declaration> m_declarations;
};
class CppCastExpression : public Expression {
public:
CppCastExpression(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
: Expression(parent, start, end, filename)
{
}
virtual ~CppCastExpression() override = default;
virtual const char* class_name() const override { return "CppCastExpression"; }
virtual void dump(size_t indent) const override;
StringView m_cast_type;
RefPtr<Type> m_type;
RefPtr<Expression> m_expression;
};
}