Spicy
hilti
toolchain
include
ast
statements
set_location.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/statement.h>
10
11
namespace
hilti::statement {
12
13
class
SetLocation
:
public
Statement
{
14
public
:
15
auto
expression()
const
{
return
child<::hilti::Expression>(0); }
16
17
static
auto
create(
ASTContext
* ctx,
hilti::Expression
* expr,
Meta
meta
= {}) {
18
return
ctx->
make
<
SetLocation
>(ctx, {expr}, std::move(
meta
));
19
}
20
21
protected
:
22
SetLocation
(
ASTContext
* ctx,
Nodes
children
,
Meta
meta
)
23
:
Statement
(ctx, NodeTags, std::move(
children
), std::move(
meta
)) {}
24
25
HILTI_NODE_1(
statement::SetLocation
,
Statement
,
final
);
26
};
27
28
}
// namespace hilti::statement
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::Nodes
Definition:
forward.h:758
hilti::Statement
Definition:
statement.h:15
hilti::statement::SetLocation
Definition:
set_location.h:13
Generated by
1.9.1