Yume
Public Member Functions | Public Attributes | List of all members
yume::ast::FunctionType Struct Reference

A function type i.e. ->(Foo,Bar)Baz. More...

#include <ast.hpp>

Inheritance diagram for yume::ast::FunctionType:
Inheritance graph
[legend]
Collaboration diagram for yume::ast::FunctionType:
Collaboration graph
[legend]

Public Member Functions

 FunctionType (span< Token > tok, OptionalType ret, vector< AnyType > args, bool fn_ptr)
 
void visit (Visitor &visitor) const override
 Recursively visit this ast node and all its constituents. More...
 
auto describe () const -> string override
 A short, string representation for debugging. More...
 
auto clone () const -> FunctionType *override
 Deep copy, except for the type and attachments. More...
 
auto clone () const -> Type *override=0
 Deep copy, except for the type and attachments. More...
 
- Public Member Functions inherited from yume::ast::AST
 AST (const AST &)=delete
 
 AST (AST &&)=default
 
auto operator= (const AST &) -> AST &=delete
 
auto operator= (AST &&) -> AST &=delete
 
virtual ~AST ()=default
 
virtual void visit (Visitor &visitor) const =0
 Recursively visit this ast node and all its constituents. More...
 
auto val_ty () const noexcept -> optional< ty::Type >
 
auto ensure_ty () const -> ty::Type
 
void val_ty (optional< ty::Type > type)
 
void attach_to (nonnull< AST * > other)
 Make the type of this node depend on the type of other. More...
 
auto kind () const -> Kind
 
auto kind_name () const -> string
 Human-readable string representation of the Kind of this node. More...
 
auto token_range () const -> const span< Token > &
 
auto equals_by_hash (ast::AST &other) const -> bool
 
auto location () const -> Loc
 The union of the locations of the Tokens making up this node. More...
 
virtual auto describe () const -> string
 A short, string representation for debugging. More...
 
virtual auto clone () const -> AST *=0
 Deep copy, except for the type and attachments. More...
 

Public Attributes

OptionalType ret
 
vector< AnyTypeargs
 
bool fn_ptr
 

Additional Inherited Members

- Protected Member Functions inherited from yume::ast::Type
 AST (Kind kind, span< Token > tok)
 
 AST (const AST &)=delete
 
 AST (AST &&)=default
 
- Protected Member Functions inherited from yume::ast::AST
void unify_val_ty ()
 Verify the type compatibility of the depends of this node, and merge the types if possible. This is called every time the node's type is updated. More...
 
auto tok () const noexcept -> span< Token >
 
 AST (Kind kind, span< Token > tok)
 

Detailed Description

A function type i.e. ->(Foo,Bar)Baz.

Definition at line 380 of file ast.hpp.

Constructor & Destructor Documentation

◆ FunctionType()

yume::ast::FunctionType::FunctionType ( span< Token tok,
OptionalType  ret,
vector< AnyType args,
bool  fn_ptr 
)
inline

Definition at line 386 of file ast.hpp.

Referenced by clone().

Member Function Documentation

◆ clone()

auto yume::ast::FunctionType::clone ( ) const -> FunctionType *override
overridevirtual

Deep copy, except for the type and attachments.

Implements yume::ast::Type.

Definition at line 109 of file ast.cpp.

References args, fn_ptr, FunctionType(), ret, and yume::ast::AST::tok().

◆ describe()

auto yume::ast::FunctionType::describe ( ) const -> string
overridevirtual

A short, string representation for debugging.

Reimplemented from yume::ast::AST.

Definition at line 32 of file describe.cpp.

References args, yume::ast::OptionalAnyBase< T >::has_value(), and ret.

◆ visit()

void yume::ast::FunctionType::visit ( Visitor visitor) const
overridevirtual

Recursively visit this ast node and all its constituents.

See also
Visitor

Implements yume::ast::AST.

Definition at line 116 of file visit.cpp.

References args, fn_ptr, ret, and visitor.

Member Data Documentation

◆ args

vector<AnyType> yume::ast::FunctionType::args

Definition at line 383 of file ast.hpp.

Referenced by clone(), describe(), and visit().

◆ fn_ptr

bool yume::ast::FunctionType::fn_ptr

Definition at line 384 of file ast.hpp.

Referenced by clone(), and visit().

◆ ret

OptionalType yume::ast::FunctionType::ret

Definition at line 382 of file ast.hpp.

Referenced by clone(), describe(), and visit().


The documentation for this struct was generated from the following files: