|
Yume
|
A declaration of a local variable (let).
More...
#include <ast.hpp>


Public Member Functions | |
| VarDecl (span< Token > tok, string name, OptionalType type, AnyExpr init) | |
| 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 -> VarDecl *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 |
| OptionalType | type |
| AnyExpr | init |
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) | |
|
inline |
|
overridevirtual |
Deep copy, except for the type and attachments.
Implements yume::ast::Decl.
Definition at line 94 of file ast.cpp.
References init, name, yume::ast::AST::tok(), type, and VarDecl().
|
inlineoverridevirtual |
Implements yume::ast::Decl.
|
overridevirtual |
| AnyExpr yume::ast::VarDecl::init |
Definition at line 876 of file ast.hpp.
Referenced by clone(), yume::Compiler::statement(), yume::semantic::TypeWalker::statement(), and visit().
| string yume::ast::VarDecl::name |
Definition at line 874 of file ast.hpp.
Referenced by clone(), yume::Compiler::statement(), yume::semantic::TypeWalker::statement(), and visit().
| OptionalType yume::ast::VarDecl::type |
Definition at line 875 of file ast.hpp.
Referenced by clone(), yume::semantic::TypeWalker::statement(), and visit().