로딩중...
검색중...
일치하는것 없음
tpriorities.hpp
이 파일의 문서화 페이지로 가기
1
2#pragma once
3
5
6namespace by {
10 enum priorType {
11 EXACT_MATCH = 0,
19 };
20
21 const _nout nchar* getPriorTypeName(priorType type);
22
27 template <typename T> struct tprior: instance {
28 BY(CLASS(tprior, instance))
29
30 public:
31 tprior(const node& newElem, priorType type, ncnt lv);
32
33 public:
34 T* operator->();
35 T& operator*();
36 const T* operator->() const BY_CONST_FUNC(operator->())
37 const T& operator*() const BY_CONST_FUNC(operator*())
38
39 public:
40 T* get();
41 const T* get() const BY_CONST_FUNC(get())
42
48
49 public:
50 tstr<T> elem;
51 priorType type;
52 ncnt lv;
53 };
54
61
62 public:
64
65 template <typename... Es> tpriorities(const Es&... elems) {
66 static_assert(areBaseOfT<T, Es...>::value, "some of type of args are not based on type 'T'");
67 this->add({(T&) elems...});
68 }
69
70 public:
71 nbool isMatched() const;
72
73 using super::get;
74 T* get();
75 const T* get() const BY_CONST_FUNC(get())
76
82 void setPriorType(priorType new1);
83
84 private:
85 priorType _type;
86 };
87
89} // namespace by
Base class for all AST nodes in the byeol language
Definition node.hpp:195
Definition tnarr.hpp:9
Collection of prioritized elements
Definition tpriorities.hpp:59
const T * get() const BY_CONST_FUNC(get()) priorType getPriorType() const
Priority wrapper for type matching
Definition tpriorities.hpp:27
const T * get() const BY_CONST_FUNC(get()) nbool isSamePrecedence(const me &rhs) const
precedence is more detail concept of priority. it considers the owner of them are equal above priorit...
priorType
Definition tpriorities.hpp:10
@ NO_MATCH
Definition tpriorities.hpp:18
@ NUMERIC_MATCH
lv0: exact match.
Definition tpriorities.hpp:12
@ IMPLICIT_MATCH
Definition tpriorities.hpp:15
to Top