|
nany
|
Definition of a single class or function. More...
#include <atom.h>
Classes | |
| struct | FlagAutoSwitch |
| struct | Instances |
| struct | Parameters |
Public Types | |
| enum | Type : yuint8 { Type::namespacedef, Type::funcdef, Type::classdef, Type::vardef, Type::typealias, Type::unit } |
| enum | Flags : uint32_t { Flags::suggestInReport, Flags::captureVariables, Flags::error, Flags::pushCapturedVariables, Flags::recursive, Flags::instanciating } |
| enum | Category : uint32_t { Category::special, Category::funcoperator, Category::view, Category::classParent, Category::ctor, Category::clone, Category::dtor, Category::defvarInit, Category::functor, Category::capturedVar, Category::propget, Category::propset, Category::propsetCustom, Category::unittest } |
Public Member Functions | |
| Atom (const AnyString &name, Type type) | |
| Atom (Atom &rootparent, const AnyString &name, Type type) | |
Queries | |
| AnyString | name () const |
| Atom name. | |
| CLID | clid () const |
| Get the clid for this atom. | |
| bool | isNamespace () const |
| Get if the atom is a namespace. | |
| bool | isClass () const |
| Get if the atom is a class. | |
| bool | isFunction () const |
| Get if the atom is a function. | |
| bool | isOperator () const |
| Get if the atom is an operator. | |
| bool | isSpecial () const |
| Get if the atom is a special atom (operator, view...) | |
| bool | isView () const |
| Get if the atom is a view. | |
| bool | isMemberVariable () const |
| Get if the atom is a member variable. | |
| bool | isClassMember () const |
| Get if the atom is a class member (function or variable) | |
| bool | isAnonymousClass () const |
| Get if the atom is an anonymous class. | |
| bool | isMemberVarDefaultInit () const |
| Is a constructor. | |
| bool | isTypeAlias () const |
| Is a type alias. | |
| bool | isUnit () const |
| Get if the atom is an unit. | |
| bool | isCtor () const |
| Get if the atom is a constructor. | |
| bool | isDtor () const |
| Get if the atom is a destructor. | |
| bool | isCloneCtor () const |
| Get if the atom is a clone constructor. | |
| bool | isFunctor () const |
| Get if the atom is a functor (operator ()) | |
| bool | callable () const |
| Get if the atom is callable (can be called like a function) | |
| bool | isCapturedVariable () const |
| Get if the atom is a captured variable. | |
| bool | isProperty () const |
| Get if the atom is a property (get or set) | |
| bool | isPropertyGet () const |
| Get if the atom is a property getter. | |
| bool | isPropertySet () const |
| Get if the atom is a property setter. | |
| bool | isPropertySetCustom () const |
| Get if the atom is a property setter (custom operator) | |
| bool | isUnittest () const |
| Get if the atom is an unittest. | |
| bool | isPublicOrPublished () const |
| Get if the atom is publicly accessible. | |
| bool | hasReturnType () const |
| Get if the atom has a return type. | |
| bool | hasGenericParameters () const |
| Get if the atom has generic type parameters. | |
| bool | isContextual () const |
| Get if the atom is contextual. More... | |
| bool | canAccessTo (const Atom &) const |
| Get if this atom can access (use) another one. | |
| bool | canCaptureVariabes () const |
| Get if the atom can capture out-of-scope variables. | |
| Atom * | parentScope () |
| Get the parent atom (if any) | |
| const Atom * | parentScope () const |
| Get the parent scope. | |
| bool | nameLookupFromParentScope (std::vector< std::reference_wrapper< Atom >> &list, const AnyString &name) |
| Perform a name lookup from the local scope to the top root atom. More... | |
| bool | nameLookupOnChildren (std::vector< std::reference_wrapper< Atom >> &list, const AnyString &name, bool *singleHop=nullptr) |
| Perform a name lookup from the local scope only. More... | |
| bool | propertyLookupOnChildren (std::vector< std::reference_wrapper< Atom >> &list, const AnyString &prefix, const AnyString &name) |
| Perform a name lookup on properties from the local scope only. More... | |
| bool | hasMember (const AnyString &name) const |
| Get if this atom has a child member. | |
| template<class C > | |
| void | eachChild (const C &callback) |
| Iterate through all children. More... | |
| template<class C > | |
| void | eachChild (const C &callback) const |
| template<class C > | |
| void | eachChild (const AnyString &needle, const C &callback) |
| Iterate through all children with a given name. More... | |
| template<class C > | |
| void | eachChild (const AnyString &needle, const C &callback) const |
| uint32_t | findClassAtom (Atom *&out, const AnyString &name) |
| uint32_t | findFuncAtom (Atom *&out, const AnyString &name) |
| uint32_t | findVarAtom (Atom *&out, const AnyString &name) |
| Atom * | findNamespaceAtom (const AnyString &name) |
| const Atom * | findChildByMemberFieldID (uint32_t field) const |
| void | renameChild (const AnyString &from, const AnyString &to) |
| Rename an atom. More... | |
| bool | findParent (const Atom &atom) const |
| Determine whether an atom is a parent to the current atom. | |
| uint32_t | childrenCount () const |
| Get the number of children. | |
| bool | hasChildren () const |
| Get if this atom owns children (sub-classes, methods...) | |
sizeof | |
| uint64_t | runtimeSizeof () const |
| Size at runtime (sizeof) | |
Info / Debugging | |
| YString | fullname () const |
| Get the full name of the atom (without any parameters) | |
| void | retrieveFullname (YString &out, const ClassdefTableView *table=nullptr, bool parentName=true) const |
| Append the full name of the atom (without any parameters) | |
| YString | caption () const |
| Get the full name of the atom along with its parameters. | |
| YString | caption (const ClassdefTableView &) const |
| Get the full name of the atom along with its parameter. | |
| void | retrieveCaption (YString &out, const ClassdefTableView &table) const |
| Append the full name of the atom along with its parameters. | |
| void | printTree (const ClassdefTableView &) const |
| Print the subtree. | |
| AnyString | keyword () const |
| Keyword (class, func, var, namespace...) More... | |
Static Public Member Functions | |
| static void | extractNames (AnyString &keyword, AnyString &varname, const AnyString &name) |
| Get the atom keyword ('func', 'class', 'operator'...) of a given name. | |
Public Attributes | |
| struct ny::Atom::Instances | instances |
| uint32_t | atomid = 0u |
| Atom unique ID (32-bits only, used for classification) | |
| Yuni::Flags< Flags > | flags = {Flags::suggestInReport} |
| Atom flags. | |
| Yuni::Flags< Category > | category |
| Atom Category. | |
| struct { | |
| uint16_t fieldindex = 0 | |
| Field index within the class (before optimization) | |
| uint16_t effectiveFieldIndex = 0 | |
| Effective field index for runtime. | |
| } | varinfo |
| Various information for vardef only (class member) | |
| struct { | |
| bool isInstanciated = false | |
| Flag to determine whether the class has already been instanciated or not. | |
| uint16_t nextFieldIndex = 0 | |
| Next field index for new variable members. | |
| struct { | |
| uint32_t atomid = 0 | |
| uint32_t instanceid = (uint32_t) - 1 | |
| } dtor | |
| Direct access to the destructor (used for reduce compilation time) | |
| struct { | |
| uint32_t atomid = 0 | |
| uint32_t instanceid = (uint32_t) - 1 | |
| } clone | |
| Direct access to the clone func (used to reduce compilation time) | |
| } | classinfo |
| Various information for classdef only. | |
| const Type | type |
| Flag to determine whether this entry is a blueprint or a namespace. | |
| nyvisibility_t | visibility = nyv_public |
| Visibility. | |
| Atom * | parent = nullptr |
| Parent node. | |
| struct { | |
| YString filename | |
| File source. | |
| uint32_t line = 0 | |
| Start offset. | |
| uint32_t offset = 0 | |
| end offset | |
| } | origin |
| Origins. | |
| Vardef | returnType |
| The return type. | |
| Parameters | parameters |
| Parameters (for functions) | |
| Parameters | tmplparams |
| Template parameters. | |
| Parameters | tmplparamsForPrinting |
| Template parameters just for printing informations (such as errors) | |
| uint32_t | localVariablesCount = 0u |
| The maximum number of variables / classdefs registered for the atom. | |
| Atom * | scopeForNameResolution = nullptr |
| A different scope for name resolution, if not null (for plugs/outlets) | |
| struct { | |
| ir::Sequence * ircode = nullptr | |
| The original IR sequence. | |
| uint32_t offset = 0 | |
| Offset to start within this sequence. | |
| uint32_t stackSizeExtra = 0 | |
| For capturing variables, it may be required to increase the IR stack size. | |
| bool owned = false | |
| Flag to determine whether the sequence is owned by the atom or not. | |
| } | opcodes |
| The original IR sequence. | |
| AnyString | builtinalias |
| Builtin alias (empty if none) | |
| nytype_t | builtinMapping = nyt_void |
| Builtin type (!= nyt_void if this atom represents a builtin) | |
| std::unique_ptr< std::unordered_set< AnyString > > | candidatesForCapture |
| List of potential candidates for being captured. | |
Friends | |
| struct | AtomMap |
Definition of a single class or function.
|
strong |
|
strong |
| Enumerator | |
|---|---|
| suggestInReport | Allow this atom in error reporting. |
| captureVariables | Allow this atom (and the sub-functions) to capture variables. |
| error | Suppress error messages related to this atom (and code generation) |
| pushCapturedVariables | Append captured variables when calling this function (ctor) |
| recursive | This func will call itself (directly or indirectly) |
| instanciating | Atom currently being instanciated. |
|
strong |
|
inline |
Iterate through all children.
|
inline |
Iterate through all children with a given name.
|
inline |
Get if the atom is contextual.
Contextual means the internal values may vary from a parent instanciation, like a class inside a function, generic types params...
| AnyString ny::Atom::keyword | ( | ) | const |
Keyword (class, func, var, namespace...)
| bool ny::Atom::nameLookupFromParentScope | ( | std::vector< std::reference_wrapper< Atom >> & | list, |
| const AnyString & | name | ||
| ) |
Perform a name lookup from the local scope to the top root atom.
| [in,out] | list | List where all matches will be added |
| name | The identifier name to find |
| bool ny::Atom::nameLookupOnChildren | ( | std::vector< std::reference_wrapper< Atom >> & | list, |
| const AnyString & | name, | ||
| bool * | singleHop = nullptr |
||
| ) |
Perform a name lookup from the local scope only.
| [in,out] | list | List where all matches will be added |
| name | The identifier name to find |
| bool ny::Atom::propertyLookupOnChildren | ( | std::vector< std::reference_wrapper< Atom >> & | list, |
| const AnyString & | prefix, | ||
| const AnyString & | name | ||
| ) |
Perform a name lookup on properties from the local scope only.
| [in,out] | list | List where all matches will be added |
| name | The identifier name to find |
| void ny::Atom::renameChild | ( | const AnyString & | from, |
| const AnyString & | to | ||
| ) |
Rename an atom.
| uint32_t ny::Atom::offset = 0 |
end offset
Offset to start within this sequence.
1.8.12