Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
FunctionCallExpression.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <ext/foreach>
9
10#include <ast/Expression.h>
12
13namespace cli {
14
16 std::string m_name;
17 std::vector < std::unique_ptr < Expression > > m_params;
18
19public:
20 FunctionCallExpression ( std::string name, std::vector < std::unique_ptr < Expression > > params ) : m_name ( std::move ( name ) ), m_params ( std::move ( params ) ) {
21 }
22
23 std::shared_ptr < abstraction::Value > translateAndEval ( Environment & environment ) const override {
24 std::shared_ptr < abstraction::Value > result;
25
27 for ( const std::unique_ptr < Expression > & param : m_params ) {
28 std::shared_ptr < abstraction::Value > value = param->translateAndEval ( environment );
29 environment.holdTemporary ( value );
30 params.push_back ( value );
31 }
32
33 std::string name = m_name;
34
35 ext::vector < std::string > templateParams;
36/* for ( const std::unique_ptr < cli::Arg > & templateParam : m_templateParams )
37 templateParams.push_back ( templateParam->eval ( environment ) );*/
38
40/* if ( m_category )
41 category = m_category->getCategory ( );*/
42
43 return abstraction::EvalHelper::evalAlgorithm ( environment, name, templateParams, params, category );
44 }
45};
46
47} /* namespace cli */
48
AlgorithmCategory
Definition: AlgorithmCategories.hpp:14
static std::shared_ptr< abstraction::Value > evalAlgorithm(abstraction::TemporariesHolder &environment, const std::string &name, const ext::vector< std::string > &templateParams, const ext::vector< std::shared_ptr< abstraction::Value > > &params, abstraction::AlgorithmCategories::AlgorithmCategory category)
Definition: EvalHelper.cpp:14
void holdTemporary(std::shared_ptr< abstraction::Value > temporary)
Definition: TemporariesHolder.cpp:10
Definition: Environment.h:29
Definition: Expression.h:14
Definition: FunctionCallExpression.h:15
FunctionCallExpression(std::string name, std::vector< std::unique_ptr< Expression > > params)
Definition: FunctionCallExpression.h:20
std::shared_ptr< abstraction::Value > translateAndEval(Environment &environment) const override
Definition: FunctionCallExpression.h:23
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
for(const StateType &state :fsm.getStates()) renamingData.insert(std Rename::RenamedAutomaton< T > result(renamingData.at(fsm.getInitialState()))
Definition: Rename.h:253
Definition: Arg.h:11
Definition: FordFulkerson.hpp:16