|
Yume
|
A declaration of a struct (struct) or an interface (interface).
More...
#include <ast.hpp>


Public Member Functions | |
| StructDecl (span< Token > tok, string name, vector< TypeName > fields, vector< GenericParam > type_args, Compound body, OptionalType implements, std::unordered_set< string > annotations, bool is_interface=false) | |
| void | visit (Visitor &visitor) const override |
| Recursively visit this ast node and all its constituents. More... | |
| auto | decl_name () const -> string override |
| auto | clone () const -> StructDecl *override |
| Deep copy, except for the type and attachments. More... | |
Public Member Functions inherited from yume::ast::Decl | |
| auto | clone () const -> Decl *override=0 |
| Deep copy, except for the type and attachments. More... | |
| virtual auto | decl_name () const -> string=0 |
| auto | describe () const -> string final |
| A short, string representation for debugging. More... | |
| auto | clone () const -> Stmt *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 | |
| string | name |
| vector< TypeName > | fields |
| vector< GenericParam > | type_args |
| Compound | body |
| OptionalType | implements |
| std::unordered_set< string > | annotations |
| bool | is_interface |
Static Public Attributes | |
| static constexpr auto | BUILTIN_TYPE_SLICE = "__builtin_type_Slice" |
| static constexpr auto | BUILTIN_TYPE_STATIC_ARRAY = "__builtin_type_StaticArray" |
Additional Inherited Members | |
Protected Member Functions inherited from yume::ast::Stmt | |
| 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) | |
A declaration of a struct (struct) or an interface (interface).
|
inline |
|
overridevirtual |
Deep copy, except for the type and attachments.
Implements yume::ast::Decl.
Definition at line 100 of file ast.cpp.
References annotations, body, fields, implements, is_interface, name, StructDecl(), yume::ast::AST::tok(), and type_args.
|
inlineoverridevirtual |
Implements yume::ast::Decl.
|
overridevirtual |
Recursively visit this ast node and all its constituents.
Implements yume::ast::AST.
Definition at line 103 of file visit.cpp.
References annotations, body, fields, implements, is_interface, name, type_args, and visitor.
| std::unordered_set<string> yume::ast::StructDecl::annotations |
Definition at line 854 of file ast.hpp.
Referenced by clone(), yume::Struct::has_annotation(), and visit().
| Compound yume::ast::StructDecl::body |
Definition at line 852 of file ast.hpp.
Referenced by yume::Struct::body(), clone(), and visit().
|
staticconstexpr |
Definition at line 857 of file ast.hpp.
Referenced by yume::Compiler::decl_statement(), and yume::ty::Type::is_slice().
|
staticconstexpr |
| vector<TypeName> yume::ast::StructDecl::fields |
Definition at line 850 of file ast.hpp.
Referenced by clone(), yume::semantic::TypeWalker::statement(), and visit().
| OptionalType yume::ast::StructDecl::implements |
Definition at line 853 of file ast.hpp.
Referenced by clone(), yume::semantic::TypeWalker::statement(), and visit().
| bool yume::ast::StructDecl::is_interface |
| string yume::ast::StructDecl::name |
Definition at line 849 of file ast.hpp.
Referenced by clone(), yume::Struct::name(), and visit().
| vector<GenericParam> yume::ast::StructDecl::type_args |
Definition at line 851 of file ast.hpp.
Referenced by clone(), yume::semantic::TypeWalker::statement(), and visit().