A simple scripting language in C++
Ferenc Szontágh
2025-04-14 d7cd4947b37a168034e9fca2501d98553fdcc137
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// FunctionSymbol.hpp
#ifndef FUNCTION_SYMBOL_HPP
#define FUNCTION_SYMBOL_HPP
 
#include <vector>
 
#include "BaseSymbol.hpp"
 
namespace Symbols {
using ValueContainer = std::vector<Symbols::Value>;
 
class FunctionSymbol : public Symbol {
    std::vector<Symbols::Value> parameters_;
    Symbols::Value              returnType_;
    std::string                 plainBody_;
 
  public:
    FunctionSymbol(const std::string & name, const std::string & context, const ValueContainer & parameters,
                   const std::string & plainbody = "") :
        Symbol(name, {}, context, Symbols::Kind::Function),
        parameters_(parameters),
        plainBody_(plainbody) {}
 
    Symbols::Kind kind() const override { return Symbols::Kind::Function; }
 
    const ValueContainer & parameters() const { return parameters_; }
};
 
}  // namespace Symbols
 
#endif