Represents an entity in the source code, which can be a constant, object, macro, or function.
constructor Entity
DEFINITION
|
Entity |
( |
const Location & location, |
| | Symbol name, |
| | std::shared_ptr< Scope > containing_scope, |
| | const std::shared_ptr< StructuredValue > & definition | ); |
| PARAMETER | DESCRIPTION |
location |
|
name |
|
containing_scope |
|
definition |
|
constructor Entity
DEFINITION
|
Entity |
( |
const Location & location, |
| | Symbol name, |
| | Visibility visibility, |
| | std::shared_ptr< Scope > containing_scope, |
| | bool default_only = false | ); |
| PARAMETER | DESCRIPTION |
location |
|
name |
|
visibility |
|
containing_scope |
|
default_only |
|
destructor ~Entityvirtual
method asconst
| RETURNS | DESCRIPTION |
const T * |
|
method containing_scopeconst
DEFINITION
|
std::shared_ptr< Scope > containing_scope |
( |
) const; |
| RETURNS | DESCRIPTION |
std::shared_ptr< Scope > |
|
method evaluate_implementationvirtual protected
DEFINITION
|
virtual void evaluate_implementation |
( |
EvaluationContext & context | ); |
| PARAMETER | DESCRIPTION |
context |
|
method evaluate_processvirtual protected
DEFINITION
|
virtual void evaluate_process |
( |
EvaluationContext & context | ); |
| PARAMETER | DESCRIPTION |
context |
|
method evaluation_contextvirtual protected
DEFINITION
|
virtual EvaluationContext evaluation_context |
( |
); |
| RETURNS | DESCRIPTION |
EvaluationContext |
|
method expand_calls
Expand macro and function calls in the entity.
method expand_calls_implementationvirtual protected
Expand macro and function calls in the entity.
The default implementation calls expand_calls() on all sub-body-elements and sub-expressions using traverse().
DEFINITION
|
virtual void expand_calls_implementation |
( |
); |
method get_locationconst
DEFINITION
|
Location get_location |
( |
) const; |
| RETURNS | DESCRIPTION |
Location |
|
method get_nameconst
DEFINITION
|
Symbol get_name |
( |
) const; |
| RETURNS | DESCRIPTION |
Symbol |
|
method get_visibilityconst
DEFINITION
|
Visibility get_visibility |
( |
) const; |
| RETURNS | DESCRIPTION |
Visibility |
|
method is_default_onlyconst
DEFINITION
|
bool is_default_only |
( |
) const; |
method is_publicconst
DEFINITION
|
bool is_public |
( |
) const; |
method operator<const
DEFINITION
|
bool operator< |
( |
const Entity & other | ) const; |
| PARAMETER | DESCRIPTION |
other |
|
method resolve
Resolve names in the entity.
method resolve_implementationvirtual protected
Resolve names in the entity.
The default implementation calls resolve() on all sub-body-elements and sub-expressions using traverse().
DEFINITION
|
virtual void resolve_implementation |
( |
); |
method serializeconst virtual
DEFINITION
|
virtual void serialize |
( |
std::ostream & stream | ) const; |
| PARAMETER | DESCRIPTION |
stream |
|
method serialize_entityconst protected
DEFINITION
|
void serialize_entity |
( |
std::ostream & stream | ) const; |
| PARAMETER | DESCRIPTION |
stream |
|
method traversevirtual protected
Traverse the Entity.
This function is used by the default implementations of resolve_implementation() and expand_calls_implementation(). Unless a subclass overrides both of these methods, it should override traverse().
DEFINITION
|
virtual void traverse |
( |
std::function< void(Entity &)> entity_callable, |
| | std::function< void(Body &)> body_callable, |
| | std::function< void(Expression &)> expression_callable | ); |
| PARAMETER | DESCRIPTION |
entity_callable |
|
body_callable |
A callable to apply to each sub-body-element.
|
expression_callable |
A callable to apply to each sub-expression.
|
method uses
DEFINITION
|
void uses |
( |
Entity * entity | ); |
| PARAMETER | DESCRIPTION |
entity |
|
member containing_module
DEFINITION
Module * containing_module;
member containing_scope_protected
DEFINITION
std::weak_ptr< Scope > containing_scope_;
member default_onlyprivate
DEFINITION
bool default_only;
member location
The location of the entity in the source code.
DEFINITION
Location location;
member referenced_entities
All entities referenced by the entity.
DEFINITION
std::unordered_set< Entity * > referenced_entities;
member resolvedprivate
DEFINITION
bool resolved;
member token_default_onlystatic private
DEFINITION
static const Token token_default_only;
member token_visibilitystatic private
DEFINITION
static const Token token_visibility;
member visibility
The visibility of the entity, i. e. in which scope it can be used.
DEFINITION
Visibility visibility;