Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
CalcCommand.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <ast/Command.h>
10#include <ast/Expression.h>
11
12namespace cli {
13
14class CalcCommand : public Command {
15 std::unique_ptr < cli::Expression > m_expr;
16
17public:
18 CalcCommand ( std::unique_ptr < cli::Expression > expr ) : m_expr ( std::move ( expr ) ) {
19 }
20
21 CommandResult run ( Environment & environment ) const override {
22 m_expr->translateAndEval ( environment );
23
25 }
26};
27
28} /* namespace cli */
29
Definition: CalcCommand.h:14
CommandResult run(Environment &environment) const override
Definition: CalcCommand.h:21
CalcCommand(std::unique_ptr< cli::Expression > expr)
Definition: CalcCommand.h:18
Definition: Command.h:14
Definition: Environment.h:29
Definition: Arg.h:11
CommandResult
Definition: CommandResult.h:10
Definition: FordFulkerson.hpp:16