Yume
Public Member Functions | Public Attributes | List of all members
yume::ast::BinaryLogicExpr Struct Referencefinal

A logical operator such as || or &&. Since these aren't overloadable, they have their own AST node. More...

#include <ast.hpp>

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

Public Member Functions

 BinaryLogicExpr (span< Token > tok, Atom operation, AnyExpr lhs, AnyExpr rhs)
 
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 -> BinaryLogicExpr *override
 Deep copy, except for the type and attachments. More...
 
auto clone () const -> Expr *override=0
 Deep copy, except for the type and attachments. 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

Atom operation
 
AnyExpr lhs
 
AnyExpr rhs
 

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)
 

Detailed Description

A logical operator such as || or &&. Since these aren't overloadable, they have their own AST node.

Definition at line 581 of file ast.hpp.

Constructor & Destructor Documentation

◆ BinaryLogicExpr()

yume::ast::BinaryLogicExpr::BinaryLogicExpr ( span< Token tok,
Atom  operation,
AnyExpr  lhs,
AnyExpr  rhs 
)
inline

Definition at line 587 of file ast.hpp.

Referenced by clone().

Member Function Documentation

◆ clone()

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

Deep copy, except for the type and attachments.

Implements yume::ast::Expr.

Definition at line 116 of file ast.cpp.

References BinaryLogicExpr(), lhs, operation, rhs, and yume::ast::AST::tok().

◆ describe()

auto yume::ast::BinaryLogicExpr::describe ( ) const -> string
inlineoverridevirtual

A short, string representation for debugging.

Reimplemented from yume::ast::AST.

Definition at line 590 of file ast.hpp.

◆ visit()

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

Recursively visit this ast node and all its constituents.

See also
Visitor

Implements yume::ast::AST.

Definition at line 128 of file visit.cpp.

References lhs, operation, rhs, visit(), and visitor.

Referenced by visit().

Member Data Documentation

◆ lhs

AnyExpr yume::ast::BinaryLogicExpr::lhs

Definition at line 584 of file ast.hpp.

Referenced by clone(), yume::semantic::TypeWalker::expression(), and visit().

◆ operation

Atom yume::ast::BinaryLogicExpr::operation

Definition at line 583 of file ast.hpp.

Referenced by clone(), and visit().

◆ rhs

AnyExpr yume::ast::BinaryLogicExpr::rhs

Definition at line 585 of file ast.hpp.

Referenced by clone(), yume::semantic::TypeWalker::expression(), and visit().


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