Alexandria
2.31.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
Pyston
Pyston
Graph
Constant.h
Go to the documentation of this file.
1
19
#ifndef PYSTON_CONSTANT_H
20
#define PYSTON_CONSTANT_H
21
22
#include "
Node.h
"
23
24
namespace
Pyston
{
25
31
template
<
typename
T>
32
class
Constant
:
public
Node
<T> {
33
public
:
39
explicit
Constant
(T value) :
m_value
{value} {}
40
44
std::string
repr
() const final {
45
return
std::to_string
(
m_value
);
46
}
47
53
T
eval
(
const
Context
&,
const
Arguments
&)
const
final
{
54
return
m_value
;
55
}
56
60
void
visit
(
Visitor
& visitor)
const
final
{
61
visitor.enter(
this
);
62
visitor.exit(
this
);
63
}
64
65
private
:
66
T
m_value
;
67
};
68
69
}
// end of namespace Pyston
70
71
#endif
// PYSTON_CONSTANT_H
Node.h
std::string
Pyston::Constant
Definition
Constant.h:32
Pyston::Constant::Constant
Constant(T value)
Definition
Constant.h:39
Pyston::Constant::m_value
T m_value
Definition
Constant.h:66
Pyston::Constant::visit
void visit(Visitor &visitor) const final
Definition
Constant.h:60
Pyston::Constant::eval
T eval(const Context &, const Arguments &) const final
Definition
Constant.h:53
Pyston::Constant::repr
std::string repr() const final
Definition
Constant.h:44
Pyston::Node
Definition
Node.h:105
Pyston::Visitor
Definition
Node.h:160
std::map
Pyston
Definition
ExceptionRaiser.h:28
std::to_string
T to_string(T... args)
std::vector
Generated by
1.9.8