Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Concepts
ValueStatement.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <ast/Statement.h>
10
11namespace cli {
12
13class ValueStatement final : public Statement {
14 std::unique_ptr < cli::Arg > m_arg;
15
16public:
17 ValueStatement ( std::unique_ptr < cli::Arg > arg ) : m_arg ( std::move ( arg ) ) {
18 }
19
20 std::shared_ptr < abstraction::Value > translateAndEval ( const std::shared_ptr < abstraction::Value > &, Environment & environment ) const override {
21 return std::make_shared < abstraction::ValueHolder < std::string > > ( m_arg->eval ( environment ), true );
22 }
23
24};
25
26} /* namespace cli */
27
Definition: Environment.h:29
Definition: Statement.h:14
Definition: ValueStatement.h:13
ValueStatement(std::unique_ptr< cli::Arg > arg)
Definition: ValueStatement.h:17
std::shared_ptr< abstraction::Value > translateAndEval(const std::shared_ptr< abstraction::Value > &, Environment &environment) const override
Definition: ValueStatement.h:20
Definition: Arg.h:11
Definition: FordFulkerson.hpp:16