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

Root class of all Ast visitors. More...

#include <visitor.hh>

Inheritance diagram for ast::GenVisitor< Const >:

Public Member Functions

virtual void operator() (typename Const< Ast >::type &e)
 The entry point: visit e.
virtual void operator() (typename Const< ArrayExp >::type &)=0
virtual void operator() (typename Const< ArrayTy >::type &)=0
virtual void operator() (typename Const< AssignExp >::type &)=0
virtual void operator() (typename Const< BreakExp >::type &)=0
virtual void operator() (typename Const< CallExp >::type &)=0
virtual void operator() (typename Const< CastExp >::type &)=0
virtual void operator() (typename Const< CastVar >::type &)=0
virtual void operator() (typename Const< ClassTy >::type &)=0
virtual void operator() (typename Const< DecsList >::type &)=0
virtual void operator() (typename Const< Field >::type &)=0
virtual void operator() (typename Const< FieldInit >::type &)=0
virtual void operator() (typename Const< FieldVar >::type &)=0
virtual void operator() (typename Const< ForExp >::type &)=0
virtual void operator() (typename Const< FunctionDec >::type &)=0
virtual void operator() (typename Const< IfExp >::type &)=0
virtual void operator() (typename Const< IntExp >::type &)=0
virtual void operator() (typename Const< LetExp >::type &)=0
virtual void operator() (typename Const< MethodCallExp >::type &)=0
virtual void operator() (typename Const< MethodDec >::type &)=0
virtual void operator() (typename Const< NameTy >::type &)=0
virtual void operator() (typename Const< NilExp >::type &)=0
virtual void operator() (typename Const< ObjectExp >::type &)=0
virtual void operator() (typename Const< OpExp >::type &)=0
virtual void operator() (typename Const< RecordExp >::type &)=0
virtual void operator() (typename Const< RecordTy >::type &)=0
virtual void operator() (typename Const< SeqExp >::type &)=0
virtual void operator() (typename Const< SimpleVar >::type &)=0
virtual void operator() (typename Const< StringExp >::type &)=0
virtual void operator() (typename Const< SubscriptVar >::type &)=0
virtual void operator() (typename Const< TypeDec >::type &)=0
virtual void operator() (typename Const< VarDec >::type &)=0
virtual void operator() (typename Const< WhileExp >::type &)=0
virtual void operator() (typename Const< FunctionDecs >::type &)=0
virtual void operator() (typename Const< MethodDecs >::type &)=0
virtual void operator() (typename Const< TypeDecs >::type &)=0
virtual void operator() (typename Const< VarDecs >::type &)=0
template<class E >
void operator() (E *e)
 Helper to visit nodes manipulated via a pointer.
Ctor & dtor.
virtual ~GenVisitor ()
 Destroy a GenVisitor.

Protected Member Functions

template<typename E >
void accept (E *e)

Detailed Description

template<template< typename > class Const>
class ast::GenVisitor< Const >

Root class of all Ast visitors.

GenVisitor<CONSTIFY> is the root class of all Ast visitors.

Constructor & Destructor Documentation

template<template< typename > class Const>
ast::GenVisitor< Const >::~GenVisitor ( )
virtual

Destroy a GenVisitor.

Member Function Documentation

template<template< typename > class Const>
template<typename E >
void ast::GenVisitor< Const >::accept ( E *  e)
protected

A convenient shortcut for recurring code like this:

if (e)
e->accept(*this);

However, the drawback of this approach is that it doesn't take care of the constness, and any const violation will be reported within the body of this method, not at its corresponding call site.

We cannot use the misc/select_const.hh approach here, since the compiler cannot resolve a function overloaded or specialized on an associated type of a template. E.g., writing accept like this:

template <typename E>
void accept(typename Const<E>::type* e);

won't work directly. Of course, one can help the compiler, providing it with E

accept<ast::NameTy>(e.result_get());

but this is painful.

template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< Ast >::type &  e)
virtual

The entry point: visit e.

Reimplemented in ast::GenDefaultVisitor< Const >.

template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< ArrayExp >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< ArrayTy >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< AssignExp >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< BreakExp >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< CallExp >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< CastExp >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< CastVar >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< ClassTy >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< DecsList >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< Field >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< FieldInit >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< FieldVar >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< ForExp >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< FunctionDec >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< IfExp >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< IntExp >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< LetExp >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< MethodCallExp >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< MethodDec >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< NameTy >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< NilExp >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< ObjectExp >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< OpExp >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< RecordExp >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< RecordTy >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< SeqExp >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< SimpleVar >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< StringExp >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< SubscriptVar >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< TypeDec >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< VarDec >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< WhileExp >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< FunctionDecs >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< MethodDecs >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< TypeDecs >::type &  )
pure virtual
template<template< typename > class Const>
virtual void ast::GenVisitor< Const >::operator() ( typename Const< VarDecs >::type &  )
pure virtual
template<template< typename > class Const>
template<class E >
void ast::GenVisitor< Const >::operator() ( E *  e)

Helper to visit nodes manipulated via a pointer.


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