1
2
3
4
5
6 #ifndef CMAJOR_SYMBOLS_META_INCLUDED
7 #define CMAJOR_SYMBOLS_META_INCLUDED
8 #include <cmajor/symbols/Value.hpp>
9
10 namespace cmajor { namespace symbols {
11
12 class Module;
13
14 class IntrinsicFunction
15 {
16 public:
17 IntrinsicFunction();
18 virtual ~IntrinsicFunction();
19 virtual int Arity() const = 0;
20 virtual const char* GroupName() const = 0;
21 virtual int NumberOfTypeParameters() const = 0;
22 virtual TypeSymbol* ReturnType(SymbolTable& symbolTable) const = 0;
23 virtual std::unique_ptr<Value> DoEvaluate(const std::std::vector<std::std::unique_ptr<Value>>&arguments, conststd::std::vector<TypeSymbol*>&templateArguments, constSpan&span, constboost::uuids::uuid&moduleId) = 0;
24 std::unique_ptr<Value> Evaluate(const std::std::vector<std::std::unique_ptr<Value>>&arguments, conststd::std::vector<TypeSymbol*>&templateArguments, constSpan&span, constboost::uuids::uuid&moduleId);
25 };
26
27 void MetaInit(SymbolTable& symbolTable);
28
29 } }
30
31 #endif // CMAJOR_SYMBOLS_META_INCLUDED