-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstmt.cpp
More file actions
57 lines (46 loc) · 842 Bytes
/
stmt.cpp
File metadata and controls
57 lines (46 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "stmt.hpp"
#include "token.hpp"
expr_stmt::expr_stmt( expr* expression )
:expression( expression )
{
}
decl_stmt::decl_stmt( decl* entity )
:entity( entity )
{
}
decl* decl_stmt::get_entity() const
{
return entity;
}
block_stmt::block_stmt( std::initializer_list<stmt*> inner_stmts )
:stmts( inner_stmts )
{
}
block_stmt::block_stmt( std::vector<stmt*> inner_stmts )
:stmts( inner_stmts )
{
}
while_stmt::while_stmt( expr* condition, stmt* block )
:condition( condition ), block( block )
{
}
expr* while_stmt::get_condition() const
{
return condition;
}
stmt* while_stmt::get_block() const
{
return block;
}
if_stmt::if_stmt( expr* condition, stmt* block )
:condition( condition ), block( block )
{
}
expr* if_stmt::get_condition() const
{
return condition;
}
stmt* if_stmt::get_block() const
{
return block;
}