expr.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include "core/ast/args.hpp"
6
7struct exprTest;
8
9namespace by {
10
15 class _nout expr: public node {
16 public:
17 // expr can be casted to @ref node. it's proxy.
22 class _nout exprType: public ntype {
23 BY(ME(exprType, ntype))
24
25 public:
26 nbool isImpli(const type& to) const override;
27
28 using super::asImpli;
29 str asImpli(const node& from, const type& to) const override;
30 };
31
32 BY(ADT(expr, node, exprType))
33 friend class exprMaker;
34 friend struct ::exprTest;
35
36 public:
37 using super::subs;
38 scope& subs() override;
39
40 using super::isImpli;
41 nbool isImpli(const type& to) const override;
42
43 using super::prioritize;
46 priorType prioritize(const args& a) const override;
47
48 const src& getSrc() const override;
49
50 private:
51 void _setSrc(const src& newSrc) override;
52
53 protected:
54 tstr<src> _src;
55 point _pos;
56 };
57} // namespace by
Function call arguments container.
Definition: args.hpp:13
Type information for expression nodes
Definition: expr.hpp:22
Base class for all expressions.
Definition: expr.hpp:15
priorType prioritize(const args &a) const override
Factory for creating expressions with source location information.
Definition: exprMaker.hpp:17
Base class for all AST nodes in byeol language.
Definition: node.hpp:30
Native type system for byeol language.
Definition: ntype.hpp:19
Source location information.
Definition: src.hpp:11
Base class for runtime type information in byeol language.
Definition: type.hpp:12
Source code position tracking structure.
Definition: point.hpp:11
priorType
the lower value, the higher priority.
Definition: tpriorities.hpp:8