sun::ast::ReferenceCreationAST

sun::ast::ReferenceCreationAST

class · Source (opens in a new tab)

class sun::ast::ReferenceCreationAST : public sun::ast::ExprAST

Reference creation: ref x = y (mutable) or const ref x = y (immutable) Creates a reference variable x that points to the address of y.

Inherits

Public Functions

ReferenceCreationAST

public · function · Source (opens in a new tab)

sun::ast::ReferenceCreationAST::ReferenceCreationAST(std::string name, std::unique_ptr< ExprAST > target, bool isMutable=true, sun::support::Position loc={})

Creates this syntax node and takes ownership of any supplied child expressions.

Related: ExprAST, sun::support::Position

dotLabel

public · function · Source (opens in a new tab)

std::string sun::ast::ReferenceCreationAST::dotLabel() const override

Returns the node label used in syntax-tree graph visualizations.

forEachChildSlot

public · function · Source (opens in a new tab)

void sun::ast::ReferenceCreationAST::forEachChildSlot(const ChildSlotFn &fn) override

Visits replaceable child expressions so tree passes can rewrite them in place.

Related: ChildSlotFn

getName

public · function · Source (opens in a new tab)

const std::string & sun::ast::ReferenceCreationAST::getName() const

Returns the declared name used to identify this object.

getQualifiedName

public · function · Source (opens in a new tab)

const sun::semantic_analysis::QualifiedName & sun::ast::ReferenceCreationAST::getQualifiedName() const

Qualified name (after semantic analysis qualifies it).

Related: sun::semantic_analysis::QualifiedName

getTarget

public · function · Source (opens in a new tab)

const ExprAST * sun::ast::ReferenceCreationAST::getTarget() const

Returns the target stored by this object.

Related: ExprAST

getType

public · function · Source (opens in a new tab)

ASTNodeType sun::ast::ReferenceCreationAST::getType() const override

Returns the syntax-node kind used to dispatch tree visitors.

Related: ASTNodeType

hasQualifiedName

public · function · Source (opens in a new tab)

bool sun::ast::ReferenceCreationAST::hasQualifiedName() const

Reports whether a name including the enclosing scopes has been assigned.

isMutable

public · function · Source (opens in a new tab)

bool sun::ast::ReferenceCreationAST::isMutable() const

Reports whether the loan grants exclusive write access to its target.

setQualifiedName

public · function · Source (opens in a new tab)

void sun::ast::ReferenceCreationAST::setQualifiedName(sun::semantic_analysis::QualifiedName qname)

Records the declaration name together with its enclosing scopes.

Related: sun::semantic_analysis::QualifiedName

toString

public · function · Source (opens in a new tab)

std::string sun::ast::ReferenceCreationAST::toString() const override

Returns a readable representation for diagnostics and debugging.

Protected Functions

ensureAnalysis

protected · function · Source (opens in a new tab)

void sun::ast::ReferenceCreationAST::ensureAnalysis() const override

Override to allocate VariableAnalysis instead of base ExprAnalysis.

Related: VariableAnalysis, ExprAnalysis

Private Functions

varAnalysis

private · function · Source (opens in a new tab)

VariableAnalysis & sun::ast::ReferenceCreationAST::varAnalysis() const

Access as VariableAnalysis.

Related: VariableAnalysis

Private Fields

mutable_

private · variable · Source (opens in a new tab)

bool sun::ast::ReferenceCreationAST::mutable_

No documentation comment.

name

private · variable · Source (opens in a new tab)

std::string sun::ast::ReferenceCreationAST::name

No documentation comment.

target

private · variable · Source (opens in a new tab)

std::unique_ptr<ExprAST> sun::ast::ReferenceCreationAST::target

No documentation comment.

Related: ExprAST