Loading...
Searching...
No Matches
genericOrigin.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include "core/ast/origin.hpp"
5
6namespace by {
7
8 class visitor;
9 class verifier;
10
23 typedef std::map<std::string, tstr<obj>> orgCache;
24
25 class _nout genericOrigin: public baseObj {
27 friend class coreInternal;
28
29 public:
30 typedef std::vector<std::string> strings;
31
32 public:
33 genericOrigin(const origin& org, const strings& paramNames);
34
35 public:
36 const baseObj& getOrigin() const override;
37 const strings& getParamNames() const;
38
39 using super::prioritize;
40 priorType prioritize(const args& a) const override;
41
42 str eval(const args& a) override;
43
44 str infer() const override;
45
46 scope& subs() override;
47
48 const std::map<std::string, tstr<obj>>& getCache() const;
49
50 using super::inFrame;
51 void inFrame(const bicontainable* args) const override;
52
53 using super::outFrame;
54 void outFrame() const override;
55
56 protected:
57 str _onEvalSub(node& sub, const args& a) override;
58
59 private:
60 std::string _makeKey(const args& a) const;
61
65 tstr<obj> _makeGeneric(const std::string& argName, const params& ps);
66 nbool _isSelfMaking(const std::string& key) const;
67
68 private:
69 orgCache _cache;
70 tstr<obj> _org;
71 strings _paramNames;
72 };
73} // namespace by
Function or object evaluation arguments.
Definition args.hpp:22
Base class for representing byeol objects.
Definition baseObj.hpp:73
Definition coreInternal.hpp:39
Definition genericOrigin.hpp:25
str _onEvalSub(node &sub, const args &a) override
Protected virtual method for evaluating a sub-node.
str infer() const override
Base class for all AST nodes in the byeol language.
Definition node.hpp:195
User-defined origin type.
Definition origin.hpp:99
Function parameter list container.
Definition params.hpp:16
Definition tnarr.hpp:9
std::map< std::string, tstr< obj > > orgCache
Generic type origin with type parameters.
Definition genericOrigin.hpp:23
priorType
Definition tpriorities.hpp:10
to Top