Spicy
hilti
toolchain
include
ast
expressions
pending-coerced.h
1
// Copyright (c) 2020-now by the Zeek Project. See LICENSE for details.
2
3
#pragma once
4
5
#include <memory>
6
#include <utility>
7
8
#include <hilti/ast/expression.h>
9
#include <hilti/ast/type.h>
10
11
namespace
hilti::expression {
12
17
class
PendingCoerced
:
public
Expression
{
18
public
:
19
auto
expression()
const
{
return
child<Expression>(0); }
20
21
QualifiedType
*
type
() const final {
return
child<QualifiedType>(1); }
22
23
static
auto
create(
ASTContext
* ctx,
Expression
* expr,
QualifiedType
*
type
,
Meta
meta
= {}) {
24
return
ctx->
make
<PendingCoerced>(ctx, {expr,
type
}, std::move(
meta
));
25
}
26
27
protected
:
28
PendingCoerced(ASTContext* ctx, Nodes
children
, Meta
meta
)
29
: Expression(ctx, NodeTags, std::move(
children
), std::move(
meta
)) {}
30
31
HILTI_NODE_1(expression::PendingCoerced, Expression,
final
);
32
};
33
34
}
// namespace hilti::expression
hilti::ASTContext
Definition:
ast-context.h:121
hilti::ASTContext::make
T * make(Args &&... args)
Definition:
ast-context.h:366
hilti::Expression
Definition:
expression.h:15
hilti::Meta
Definition:
meta.h:30
hilti::Node::children
const auto & children() const
Definition:
node.h:364
hilti::Node::meta
const auto & meta() const
Definition:
node.h:306
hilti::QualifiedType
Definition:
type.h:362
hilti::expression::PendingCoerced
Definition:
pending-coerced.h:17
hilti::expression::PendingCoerced::type
QualifiedType * type() const final
Definition:
pending-coerced.h:21
Generated by
1.9.1