sun::ast::MemberAccessAST
class · Source (opens in a new tab)
class sun::ast::MemberAccessAST : public sun::ast::ExprASTMember 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
- sun::ast::ExprAST (public)
Public Functions
- MemberAccessAST
- dotLabel
- forEachChildSlot
- getMemberName
- getObject
- getQualifiedName
- getResolvedTypeArgs
- getResolvedVariadicArgTypes
- getType
- getTypeArguments
- hasQualifiedName
- hasResolvedTypeArgs
- hasTypeArguments
- isBoundMethodRef
- releaseObject
- setIsBoundMethodRef
- setQualifiedName
- setResolvedTypeArgs
- setResolvedVariadicArgTypes
- toString
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 overrideReturns 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) overrideVisits 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() constReturns the member name to resolve on the receiver.
getObject
public · function · Source (opens in a new tab)
const ExprAST * sun::ast::MemberAccessAST::getObject() constProvides 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() constReturns 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() constReturns the concrete generic type arguments.
Related: TypePtr
getResolvedVariadicArgTypes
public · function · Source (opens in a new tab)
const std::vector< TypePtr > & sun::ast::MemberAccessAST::getResolvedVariadicArgTypes() constReturns the concrete variadic argument types.
Related: TypePtr
getType
public · function · Source (opens in a new tab)
ASTNodeType sun::ast::MemberAccessAST::getType() const overrideReturns 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() constProvides the concrete types supplied for generic specialization.
Related: TypeAnnotation
hasQualifiedName
public · function · Source (opens in a new tab)
bool sun::ast::MemberAccessAST::hasQualifiedName() constReports whether a name including the enclosing scopes has been assigned.
hasResolvedTypeArgs
public · function · Source (opens in a new tab)
bool sun::ast::MemberAccessAST::hasResolvedTypeArgs() constReports whether this object has resolved type args.
hasTypeArguments
public · function · Source (opens in a new tab)
bool sun::ast::MemberAccessAST::hasTypeArguments() constReports whether this object has type arguments.
isBoundMethodRef
public · function · Source (opens in a new tab)
bool sun::ast::MemberAccessAST::isBoundMethodRef() constReports 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) constBound 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) constThe 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) constResolved 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) constResolved 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 overrideReturns a readable representation for diagnostics and debugging.
Protected Functions
ensureAnalysis
protected · function · Source (opens in a new tab)
void sun::ast::MemberAccessAST::ensureAnalysis() const overrideOverride 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() constAccess as MemberAccessAnalysis.
Related: MemberAccessAnalysis
Private Fields
memberName
private · variable · Source (opens in a new tab)
std::string sun::ast::MemberAccessAST::memberNameNo documentation comment.
object
private · variable · Source (opens in a new tab)
std::unique_ptr<ExprAST> sun::ast::MemberAccessAST::objectNo documentation comment.
Related: ExprAST
typeArguments
private · variable · Source (opens in a new tab)
std::vector<std::unique_ptr<TypeAnnotation> > sun::ast::MemberAccessAST::typeArgumentsNo documentation comment.
Related: TypeAnnotation