LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ast::CastExp Class Reference

Cast the type of an expression to a given type. More...

#include <cast-exp.hh>

Inheritance diagram for ast::CastExp:
Collaboration diagram for ast::CastExp:

Public Member Functions

Ctor & dtor.
 CastExp (const Location &location, Exp *exp, Ty *ty)
 Construct a CastExp node.
virtual ~CastExp ()
 Destroy a CastExp node.
Visitors entry point.
virtual void accept (ConstVisitor &v) const override
 Accept a const visitor v.
virtual void accept (Visitor &v) override
 Accept a non-const visitor v.
Accessors.
const Expexp_get () const
 Return the cast expression.
Expexp_get ()
 Return the cast expression.
const Tyty_get () const
 Return the target type.
Tyty_get ()
 Return the target type.
Accessors.
const Locationlocation_get () const
 Return scanner position information.
void location_set (const Location &)
 Set scanner position information.

Protected Attributes

Expexp_
 The cast expression.
Tyty_
 The target type.
Location location_
 Scanner position information.

Detailed Description

Cast the type of an expression to a given type.

This node is only used in the bound checking transformation (see desugar::bound_checks_add). You don't need to worry about it (nor about the `cast' keyword) if you don't implement this option.

Constructor & Destructor Documentation

ast::CastExp::CastExp ( const Location location,
Exp exp,
Ty ty 
)

Construct a CastExp node.

ast::CastExp::~CastExp ( )
virtual

Destroy a CastExp node.

References exp_, and ty_.

Member Function Documentation

void ast::CastExp::accept ( ConstVisitor v) const
overridevirtual

Accept a const visitor v.

Implements ast::Exp.

void ast::CastExp::accept ( Visitor v)
overridevirtual

Accept a non-const visitor v.

Implements ast::Exp.

const Exp & ast::CastExp::exp_get ( ) const
inline

Return the cast expression.

References exp_.

Referenced by ast::PrettyPrinter::operator()(), and astclone::Cloner::operator()().

Exp & ast::CastExp::exp_get ( )
inline

Return the cast expression.

References exp_.

const Location & ast::Ast::location_get ( ) const
inlineinherited
void ast::Ast::location_set ( const Location location)
inlineinherited

Set scanner position information.

References ast::Ast::location_.

const Ty & ast::CastExp::ty_get ( ) const
inline

Return the target type.

References ty_.

Referenced by ast::PrettyPrinter::operator()(), and astclone::Cloner::operator()().

Ty & ast::CastExp::ty_get ( )
inline

Return the target type.

References ty_.

Member Data Documentation

Exp* ast::CastExp::exp_
protected

The cast expression.

Referenced by exp_get(), and ~CastExp().

Location ast::Ast::location_
protectedinherited
Ty* ast::CastExp::ty_
protected

The target type.

Referenced by ty_get(), and ~CastExp().


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