Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
PreviousResultStatement.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <ast/Statement.h>
9
10namespace cli {
11
12class PreviousResultStatement final : public Statement {
13
14public:
15 std::shared_ptr < abstraction::Value > translateAndEval ( const std::shared_ptr < abstraction::Value > & prev, Environment & ) const override {
16 if ( prev == nullptr )
17 throw std::invalid_argument ( "There is no previous result to use." );
18 return prev;
19 }
20
21};
22
23} /* namespace cli */
24
Definition: Environment.h:29
Definition: PreviousResultStatement.h:12
std::shared_ptr< abstraction::Value > translateAndEval(const std::shared_ptr< abstraction::Value > &prev, Environment &) const override
Definition: PreviousResultStatement.h:15
Definition: Statement.h:14
Definition: Arg.h:11