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
15 class _nout genericOrigin: public baseObj {
16 BY(CLASS(genericOrigin, baseObj), VISIT())
17 friend class verifier;
18 friend class graphVisitor;
19 friend class exprMaker;
20 typedef std::vector<std::string> strings;
21
22 public:
23 genericOrigin(const origin& org, const strings& paramNames);
24
25 public:
26 const baseObj& getOrigin() const override;
27 const strings& getParamNames() const;
28
29 using super::prioritize;
30 priorType prioritize(const args& a) const override;
31
32 str run(const args& a) override;
33
34 str getEval() const override;
35
36 scope& subs() override;
37
38 const std::map<std::string, tstr<obj>>& getCache() const;
39
40 using super::inFrame;
41 void inFrame(const bicontainable* args) const override;
42
43 using super::outFrame;
44 void outFrame() const override;
45
46 protected:
47 str _onRunSub(node& sub, const args& a) override;
48
49 private:
50 std::string _makeKey(const args& a) const;
51
53 tstr<obj> _makeGeneric(const std::string& argName, const params& ps);
54 nbool _isSelfMaking(const std::string& key) const;
55
56 private:
57 std::map<std::string, tstr<obj>> _cache;
58 tstr<obj> _org;
59 strings _paramNames;
60 };
61} // namespace by
Function call arguments container.
Definition: args.hpp:13
Base class for all objects in byeol language.
Definition: baseObj.hpp:24
Factory for creating expressions with source location information.
Definition: exprMaker.hpp:17
Generic type origin with type parameters.
Definition: genericOrigin.hpp:15
str getEval() const override
AST graph visualization visitor.
Definition: graphVisitor.hpp:11
Base class for all AST nodes in byeol language.
Definition: node.hpp:30
User-defined class origin in byeol language.
Definition: origin.hpp:17
Function parameter list container.
Definition: params.hpp:15
Template bidirectional container interface.
Definition: tbicontainable.hpp:17
AST verifier for semantic analysis.
Definition: verifier.hpp:20
priorType
the lower value, the higher priority.
Definition: tpriorities.hpp:8