sun::ast::MemberAccessAST

sun::ast::MemberAccessAST

class · Source (opens in a new tab)

class sun::ast::MemberAccessAST : public sun::ast::ExprAST

Member access expression: object.fieldName or object.methodName For method calls, this is wrapped in CallExprAST For generic method calls like object.method<T>(), typeArguments will be populated.

Inherits

Public Functions

MemberAccessAST

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

sun::ast::MemberAccessAST::MemberAccessAST(std::unique_ptr< ExprAST > obj, std::string member, std::vector< std::unique_ptr< TypeAnnotation > > typeArgs={})

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

Related: ExprAST, TypeAnnotation

dotLabel

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

std::string sun::ast::MemberAccessAST::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::MemberAccessAST::forEachChildSlot(const ChildSlotFn &fn) override

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

Related: ChildSlotFn

getMemberName

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

const std::string & sun::ast::MemberAccessAST::getMemberName() const

Returns the member name to resolve on the receiver.

getObject

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

const ExprAST * sun::ast::MemberAccessAST::getObject() const

Provides the receiver expression used for member access.

Related: ExprAST

getQualifiedName

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

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

Returns the declaration name together with its enclosing scopes.

Related: sun::semantic_analysis::QualifiedName

getResolvedTypeArgs

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

const std::vector< TypePtr > & sun::ast::MemberAccessAST::getResolvedTypeArgs() const

Returns the concrete generic type arguments.

Related: TypePtr

getResolvedVariadicArgTypes

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

const std::vector< TypePtr > & sun::ast::MemberAccessAST::getResolvedVariadicArgTypes() const

Returns the concrete variadic argument types.

Related: TypePtr

getType

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

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

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

Related: ASTNodeType

getTypeArguments

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

const std::vector< std::unique_ptr< TypeAnnotation > > & sun::ast::MemberAccessAST::getTypeArguments() const

Provides the concrete types supplied for generic specialization.

Related: TypeAnnotation

hasQualifiedName

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

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

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

hasResolvedTypeArgs

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

bool sun::ast::MemberAccessAST::hasResolvedTypeArgs() const

Reports whether this object has resolved type args.

hasTypeArguments

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

bool sun::ast::MemberAccessAST::hasTypeArguments() const

Reports whether this object has type arguments.

isBoundMethodRef

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

bool sun::ast::MemberAccessAST::isBoundMethodRef() const

Reports whether this syntax node represents a bound method reference.

releaseObject

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

std::unique_ptr< ExprAST > sun::ast::MemberAccessAST::releaseObject()

Transfers ownership of the receiver expression to the caller.

Related: ExprAST

setIsBoundMethodRef

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

void sun::ast::MemberAccessAST::setIsBoundMethodRef(bool value) const

Bound method reference: method used in value position (set by semantic analyzer); the resolved type is then a LambdaType.

Related: LambdaType

setQualifiedName

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

void sun::ast::MemberAccessAST::setQualifiedName(sun::semantic_analysis::QualifiedName name) const

The symbol this access denotes — a module's function or variable, or the specialization instantiated for a generic call (set by the semantic analyzer).

Codegen calls this name; it never spells one itself.

Related: sun::semantic_analysis::QualifiedName

setResolvedTypeArgs

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

void sun::ast::MemberAccessAST::setResolvedTypeArgs(std::vector< TypePtr > types) const

Resolved type arguments for generic method calls (set by semantic analyzer).

Related: TypePtr

setResolvedVariadicArgTypes

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

void sun::ast::MemberAccessAST::setResolvedVariadicArgTypes(std::vector< TypePtr > types) const

Resolved types of the actual variadic arguments for a generic method call with an args... pack (set by semantic analyzer).

They are part of the specialization's identity, and so of its name.

Related: TypePtr

toString

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

std::string sun::ast::MemberAccessAST::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::MemberAccessAST::ensureAnalysis() const override

Override to allocate MemberAccessAnalysis instead of base ExprAnalysis.

Related: MemberAccessAnalysis, ExprAnalysis

Private Functions

memberAnalysis

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

MemberAccessAnalysis & sun::ast::MemberAccessAST::memberAnalysis() const

Access as MemberAccessAnalysis.

Related: MemberAccessAnalysis

Private Fields

memberName

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

std::string sun::ast::MemberAccessAST::memberName

No documentation comment.

object

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

std::unique_ptr<ExprAST> sun::ast::MemberAccessAST::object

No documentation comment.

Related: ExprAST

typeArguments

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

std::vector<std::unique_ptr<TypeAnnotation> > sun::ast::MemberAccessAST::typeArguments

No documentation comment.

Related: TypeAnnotation