instruction.hpp 606 Bytes
Newer Older
Paul's avatar
Paul committed
1
2
3
#ifndef GUARD_RTGLIB_INSTRUCTION_HPP
#define GUARD_RTGLIB_INSTRUCTION_HPP

Paul's avatar
Paul committed
4
#include <rtg/literal.hpp>
Paul's avatar
Paul committed
5
#include <rtg/shape.hpp>
Paul's avatar
Paul committed
6
#include <rtg/builtin.hpp>
Paul's avatar
Paul committed
7
#include <string>
Paul's avatar
Paul committed
8
9
10
11
12

namespace rtg {

struct instruction
{
Paul's avatar
Paul committed
13
14
15
16
17
18
19
    instruction() {}

    instruction(std::string n, shape r, std::vector<instruction*> args)
    : name(std::move(n)), result(std::move(r)), arguments(std::move(args))
    {}

    instruction(literal l)
Paul's avatar
Paul committed
20
    : name(builtin::literal), result(l.get_shape()), lit(std::move(l))
Paul's avatar
Paul committed
21
22
    {}

Paul's avatar
Paul committed
23
24
25
    std::string name;
    shape result;
    std::vector<instruction*> arguments;
Paul's avatar
Paul committed
26
    literal lit;
Paul's avatar
Paul committed
27
28
29
30
31
};

}

#endif