LRDE Tiger Compiler
1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
|
Cast the type of an l-value to a given type. More...
#include <cast-var.hh>
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 Ty & | ty_get () const |
Return the target type. | |
Ty & | ty_get () |
Return the target type. |
Protected Attributes | |
Var * | var_ |
The cast variable. | |
Ty * | ty_ |
The target type. |
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.
|
overridevirtual |
Accept a const visitor v.
|
overridevirtual |
Accept a non-const visitor v.
|
inline |
Return the target type.
References ty_.
Referenced by ast::PrettyPrinter::operator()(), and astclone::Cloner::operator()().
|
inline |
Return the cast variable.
References var_.
Referenced by ast::PrettyPrinter::operator()(), and astclone::Cloner::operator()().
|
inline |
Return the cast variable.
References var_.
|
protected |
The target type.
Referenced by ty_get(), and ~CastVar().
|
protected |
The cast variable.
Referenced by var_get(), and ~CastVar().