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

Cast the type of an l-value to a given type. More...

#include <cast-var.hh>

Collaboration diagram for ast::CastVar:

Public Member Functions

Ctor & dtor.
 CastVar (const Location &location, Var *var, Ty *ty)
 Construct a CastVar node.
virtual ~CastVar ()
 Destroy a CastVar 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 Var & var_get () const
 Return the cast variable.
Var & var_get ()
 Return the cast variable.
const Tyty_get () const
 Return the target type.
Tyty_get ()
 Return the target type.

Protected Attributes

Var * var_
 The cast variable.
Tyty_
 The target type.

Detailed Description

Cast the type of an l-value 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::CastVar::CastVar ( const Location location,
Var *  var,
Ty ty 
)

Construct a CastVar node.

ast::CastVar::~CastVar ( )
virtual

Destroy a CastVar node.

References ty_, and var_.

Member Function Documentation

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

Accept a const visitor v.

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

Accept a non-const visitor v.

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

Return the target type.

References ty_.

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

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

Return the target type.

References ty_.

const Var & ast::CastVar::var_get ( ) const
inline

Return the cast variable.

References var_.

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

Var & ast::CastVar::var_get ( )
inline

Return the cast variable.

References var_.

Member Data Documentation

Ty* ast::CastVar::ty_
protected

The target type.

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

Var* ast::CastVar::var_
protected

The cast variable.

Referenced by var_get(), and ~CastVar().


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