by::node Class Referenceabstract

Base class for all AST nodes in byeol language. More...

#include <node.hpp>

Inheritance diagram for by::node:
by::instance by::frameInteractable by::typeProvidable by::clonable by::baseFunc by::baseObj by::expr by::frame by::slot by::srcFile by::thread by::tbaseBridgeFunc< Ret, T, Marshaling, Args... > by::tbaseBridgeFunc< void, T, Marshaling, Args... > by::baseCtor by::closure by::func by::inputFunc by::printFunc< T > by::tbaseBridgeFunc< Ret, T, Marshaling, Args > by::tbridgeClosure< Ret, T, Marshaling, Args > by::tbridgeClosure< void, T, Marshaling, Args... > by::tbridge< narr > by::arithmeticObj by::baseErr by::genericOrigin by::obj by::tbridge< T > by::FBOExpr by::FUOExpr by::asExpr by::assignExpr by::blockExpr by::defArrayExpr by::defNestedFuncExpr by::defSeqExpr by::defVarExpr by::getExpr by::ifExpr by::isExpr by::loopExpr by::retStateExpr by::runExpr by::autoslot by::dumSrcFile

Public Member Functions

me & operator[] (const std::string &name)
 
const me & operator[] (const std::string &name) const BY_CONST_FUNC(operator[](name))
 
me & operator[] (const std::string *it)
 
const me & operator[] (const std::string *it) const BY_CONST_FUNC(operator[](it))
 
me & operator[] (const nchar *name)
 
const me & operator[] (const nchar *name) const BY_CONST_FUNC(operator[](name))
 
nbool in (const node &elem) const
 
nbool in (const node *elem) const
 
virtual scopesubs ()=0
 
const scopesubs () const BY_CONST_FUNC(subs()) virtual tstr< nbicontainer > mySubs() const
 
const nodededuce (const node &it) const
 
const nodededuce (const node *it) const BY_SIDE_FUNC(deduce)
 
template<typename T >
T * sub (std::function< nbool(const std::string &, const T &)> l)
 
template<typename T >
const T * sub (std::function< nbool(const std::string &, const T &)> l) const BY_CONST_FUNC(sub< T >(l)) template< typename T
 
template<typename T = me>
const T * sub () const BY_CONST_FUNC(sub< T >()) template< typename T
 
template<typename T = me>
T * sub (const std::string *it) BY_SIDE_FUNC(sub)
 
template<typename T = me>
const T * sub (const std::string &name) const BY_CONST_FUNC(sub< T >(name)) template< typename T
 
template<typename T = me>
T * sub (const std::string *name, const args &a) BY_SIDE_FUNC(name
 
template<typename T = me>
const T * sub (const std::string &name, const args &a) const BY_CONST_FUNC(sub< T >(name
 
template<typename T = me>
const T a const T * sub (const std::string *name, const args &a) const BY_CONST_FUNC(sub< T >(name
 
template<typename T >
const T a const T a tnarr< T, strTacticsubAll (std::function< nbool(const std::string &, const T &)> l) const
 
template<typename T = me>
tnarr< T, strTacticsubAll () const
 
template<typename T = me>
tpriorities< T > subAll (const std::string &name) const
 
template<typename T = me>
tpriorities< T > subAll (const std::string *it) const BY_SIDE_FUNC(subAll< T >) template< typename T
 
template<typename T = me>
tpriorities< T > subAll (const std::string &name, const args &a) const
 
template<typename T = me>
tpriorities< T > subAll (const std::string *name, const args *a) const BY_SIDE_FUNC(name
 
tpriorities< T > subAll< T > tpriorities ())
 
template<typename T = me>
tpriorities< T > subAll (const std::string *name, const args &a) const BY_SIDE_FUNC(name
 
tpriorities< T > subAll< T > tpriorities ())
 
bool canRun (const args &a) const
 
virtual priorType prioritize (const args &a) const =0
 
priorType prioritize (const args *it) const BY_SIDE_FUNC(it
 
virtual str run (const args &a)=0
 
str run (const args *it) BY_SIDE_FUNC(run)
 
str run (const std::string &name, const args &a)
 
str run (const std::string &name, const args *a) BY_SIDE_FUNC(a
 
str run (name, a)
 
str str ())
 
str run (const std::string *name, const args &a) BY_SIDE_FUNC(name
 
str run str ())
 
str run (const std::string *name, const args *a) BY_SIDE_FUNC(name &&a
 
str run str ())
 
str run (const std::string &name)
 
str run (const std::string *it) BY_SIDE_FUNC(run)
 
str run ()
 
virtual void rel ()
 
template<typename T >
nbool is () const
 
nbool is (const typeProvidable &to) const
 
nbool is (const typeProvidable *it) const BY_SIDE_FUNC(is)
 
nbool is (const type &to) const
 
nbool is (const type *it) const BY_SIDE_FUNC(is)
 
template<typename T >
tstr< T > as () const
 
str as (const typeProvidable &to) const
 
str as (const typeProvidable *it) const BY_SIDE_FUNC(as)
 
str as (const type &to) const
 
str as (const type *it) const BY_SIDE_FUNC(as)
 
template<typename T >
nbool isImpli () const
 
virtual nbool isImpli (const type &to) const
 
nbool isImpli (const typeProvidable &to) const
 
nbool isImpli (const typeProvidable *it) const BY_SIDE_FUNC(isImpli)
 
template<typename T >
tstr< T > asImpli () const
 
virtual str asImpli (const type &to) const
 
str asImpli (const typeProvidable &to) const
 
str asImpli (const typeProvidable *it) const BY_SIDE_FUNC(asImpli)
 
virtual const srcgetSrc () const
 
virtual nbool isComplete () const
 
virtual str getEval () const
 
virtual void accept (const visitInfo &i, visitor &v)
 
void inFrame (const bicontainable *args) const override
 
void outFrame () const override
 
virtual const modifiergetModifier () const
 
virtual void inFrame (const bicontainable *args) const=0
 
void inFrame () const
 
virtual void outFrame () const=0
 
- Public Member Functions inherited from by::instance
 instance (id newId)
 
 instance (const me &rhs)
 
me & operator= (const me &rhs)=default
 
void * operator new (size_t sz) noexcept
 
void operator delete (void *pt, size_t sz) noexcept
 
virtual id getId () const
 
virtual nbool isHeap () const
 
const bindTaggetBindTag () const
 
- Public Member Functions inherited from by::typeProvidable
nbool operator== (const me &rhs) const
 
nbool operator!= (const me &rhs) const
 
virtual const typegetType () const =0
 
nbool isSub (const type &it) const
 
nbool isSub (const type *it) const BY_SIDE_FUNC(isSub)
 
nbool isSub (const me &it) const
 
nbool isSub (const me *it) const BY_SIDE_FUNC(isSub)
 
nbool isSuper (const type &it) const
 
nbool isSuper (const type *it) const BY_SIDE_FUNC(isSuper)
 
nbool isSuper (const me &it) const
 
nbool isSuper (const me *it) const BY_SIDE_FUNC(isSuper)
 
template<typename T >
nint isSub () const
 
template<typename T >
nint isSuper () const
 
template<typename T >
T * cast ()
 
template<typename T >
const T * cast () const BY_CONST_FUNC(cast< T >()) virtual void *cast(const type &to)
 
const void * cast (const type &to) const BY_CONST_FUNC(cast(to)) void *cast(const type *it) BY_SIDE_FUNC(cast)
 
- Public Member Functions inherited from by::clonable
virtual me * clone () const =0
 
virtual me * cloneDeep () const
 
virtual void onCloneDeep (const me &from)
 
- Public Member Functions inherited from by::frameInteractable
void inFrame () const
 

Public Attributes

T sub name
 
T sub nullptr
 
tpriorities< T > subAll< T > name
 
priorType prioritize it
 
priorType prioritize NO_MATCH
 
str run name
 

Protected Member Functions

virtual str _onRunSub (node &sub, const args &a)
 
virtual void _setSrc (const src &s)
 
void _setSrc (const src *it) BY_SIDE_FUNC(_setSrc)
 
- Protected Member Functions inherited from by::instance
nbool _setId (id new1)
 

Friends

class exprMaker
 
template<typename T >
class tmock
 

Additional Inherited Members

- Static Protected Member Functions inherited from by::instance
static instancer_getMgr ()
 

Detailed Description

Base class for all AST nodes in byeol language.

Provides common API to manipulate sub nodes and handle the hierarchical structure of the byeol abstract syntax tree.

Member Function Documentation

◆ deduce()

const node * by::node::deduce ( const node it) const
Parameters
rtype to be deduced to this type. if a type is null, it means that there is no type specified. it's complete different to 'void' type.
Returns
null if it's not relative between l & r.

◆ getEval()

virtual str by::node::getEval ( ) const
virtual

getType() returns what it is. opposite to it, this returns what this class will represents after evaluation.

for example, the expr class has derived from this node class. and if an user call the funcs to get type of it, class 'ntype' of 'expr' will be returned. but if that user call the 'getEval()' then the 'expr' object evaluate its terms and returns it as a node from the output. it could be an integer if it was addExpr and all terms are constructed with integers.

and also this func requires frames. means that you have to interact frame first before call this func.

Remarks
some derived class of node may require to call this function first by verifier. if you call this function without calling verifier previously will damage then process.

Reimplemented in by::baseCtor, by::ctor, by::asExpr, by::assignExpr, by::blockExpr, by::defArrayExpr, by::defAssignExpr, by::defSeqExpr, by::defVarExpr, by::endExpr, by::FBOExpr, by::getExpr, by::ifExpr, by::isExpr, by::loopExpr, by::retExpr, by::runExpr, by::genericOrigin, and by::slot.

◆ inFrame() [1/2]

void by::node::inFrame ( const bicontainable args) const
overridevirtual

Implements by::frameInteractable.

◆ inFrame() [2/2]

virtual void by::frameInteractable::inFrame ( const bicontainable args) const
virtual

Implements by::frameInteractable.

◆ isComplete()

virtual nbool by::node::isComplete ( ) const
virtual

returns whether this instance is complete or not. if some instance is incomplete, it means that it's not accessible on byeolang source codes.

Reimplemented in by::origin.

◆ outFrame() [1/2]

void by::node::outFrame ( ) const
overridevirtual

Implements by::frameInteractable.

◆ outFrame() [2/2]

virtual void by::frameInteractable::outFrame ( ) const
virtual

Implements by::frameInteractable.

◆ prioritize()

virtual priorType by::node::prioritize ( const args a) const
pure virtual

Implemented in by::expr, and by::retExpr.

◆ rel()

virtual void by::node::rel ( )
inlinevirtual

release all holding resources and ready to be terminated.as(

Remarks
some class won't be able to reinitialize after rel() got called.

Reimplemented in by::autoslot, by::blockExpr, by::frame, and by::thread.

◆ subAll()

template<typename T = me>
tpriorities< T > by::node::subAll ( const std::string *  it) const

finds subnodes of this node, allowing implicit conversion based on name and arguments.

Parameters
aif you pass this as a nullptr, the argument will be ignored and all names that are the same will be considered to meet the condition.
Warning
if you pass the argument as args(), it will be considered to meet the condition only if there are no parameters and the names are the same, so the two have completely different meanings.

The documentation for this class was generated from the following file: