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

Handling of generic, oriented or undirected, graph. More...

Classes

class  Deref
class  endo_map
 A renaming mapping defaulting to identity: Mapping a class with itself (endomorphism). Unless a value is already mapped onto another, map it to itself if nonstrict. This is a special case of std::map. More...
class  error
 Handle errors in the whole project. More...
class  escaped
class  file_library
 Manage search path. More...
class  generic_variant
class  graph
struct  empty
class  directed_graph
class  undirected_graph
class  list
class  map
 Wrapper around std::map providing syntactic sugar for any mapping of types manipulation. More...
struct  pair
class  path
 Helper for handling paths. More...
class  ref
class  scoped_map
struct  constify_traits
 Return T constified. More...
struct  id_traits
 Return T as is. More...
struct  select_iterator
 The iterator over a non const structure is plain iterator. More...
struct  select_iterator< const T >
 The iterator over a const structure is a const_iterator. More...
class  separator
class  set
 The class misc::set is wrapper around std::set. More...
class  symbol
 Define symbol class. More...
class  timer
 Timing nested tasks. More...
class  unique
 Define unique class. More...
class  variant
struct  iomanipulator
 Defines the operator() for the classes get_type, set_type and swap_type. More...
class  xalloc
 Allocate slots in std::ostreams. More...

Typedefs

typedef boost::property
< boost::graph_name_t,
std::string > 
name_prop_type
 Graph property: name.

Enumerations

enum  deref_e { deref }

Functions

template<typename Container >
void deep_clear (Container &c)
 Invoke delete on all the members of c, and clear it.
template<typename Container >
Container::const_iterator find (const Container &c, const typename Container::value_type &v)
 Find v in the whole c.
template<typename Container >
Container::iterator find (Container &c, const typename Container::value_type &v)
 Find v in the whole c.
template<typename Container , typename Functor >
Functor & for_each (Container &c, Functor &v)
 Apply f to all the members of c, and return it.
template<typename Container >
bool has (const Container &c, const typename Container::value_type &v)
 Is v member of c?
template<typename Map >
Map::iterator put (Map &map, const typename Map::key_type &key, const typename Map::mapped_type &value)
 Insert or update key -> value in map, return iterator to it.
Deref operator<< (std::ostream &ostr, deref_e)
std::ostream & operator<< (std::ostream &o, const error &e)
 Display the error message on the given ostream.
template<class T >
escaped escape (const T &)
std::ostream & operator<< (std::ostream &o, const escaped &)
std::string basename (const std::string &file)
path basedir (const std::string &file)
bool file_exists (const std::string &file)
std::ostream & operator<< (std::ostream &ostr, const file_library &l)
 BOOST_PP_REPEAT_FROM_TO (1, BOOST_VARIANT_LIMIT_TYPES, MISC_GENERIC_VARIANT_CONVERSION_OPERATOR_DEF, T) template< MISC_GENERIC_VARIANT_PARAMS > MISC_GENERIC_VARIANT_TYPE
template<typename Orientation , typename VertexLabel , typename EdgeLabel >
std::ostream & operator<< (std::ostream &ostr, const graph< Orientation, VertexLabel, EdgeLabel > &g)
std::ostream & operator<< (std::ostream &ostr, empty)
std::ostream & incindent (std::ostream &o)
 Increment the indentation.
std::ostream & decindent (std::ostream &o)
 Decrement the indentation.
std::ostream & resetindent (std::ostream &o)
 Reset the indentation.
std::ostream & iendl (std::ostream &o)
 Print an end of line, then set the indentation.
std::ostream & incendl (std::ostream &o)
 Increment the indentation, print an end of line, and set the indentation.
std::ostream & decendl (std::ostream &o)
 Decrement the indentation, print an end of line, and set the indentation.
template<class Ident_ >
std::ostream & operator<< (std::ostream &ostr, const list< Ident_ > &l)
 Output l onto ostr.
template<typename Ident_ >
bool operator% (const Ident_ &data, const list< Ident_ > &l)
 Shortcut for misc::list::has.
template<class T >
std::ostream & operator<< (std::ostream &ostr, const list< T > &l)
template<class T >
bool operator% (const T &data, const list< T > &l)
template<class T , class N >
std::ostream & operator<< (std::ostream &ostr, const map< T, N > &m)
 Output m onto ostr.
template<class Fst , typename Snd >
pair< Fst, Snd > make_pair (Fst fst, Snd snd)
 Shorthand to create pair (fst, snd).
template<class Fst , typename Snd >
std::ostream & operator<< (std::ostream &ostr, const pair< Fst, Snd > &p)
 Output the pair object s on ostr.
std::ostream & operator<< (std::ostream &ostr, const path &p)
template<typename Key , typename Data >
std::ostream & operator<< (std::ostream &ostr, const scoped_map< Key, Data > &tbl)
template<class C , typename S >
separator< C, S > separate (const C &c, const S &s)
 Shorthand to create separator(c, s).
template<class C >
separator< C, char > separate (const C &c)
 Shorthand to create separator(c, '
').
template<class C , typename S >
std::ostream & operator<< (std::ostream &ostr, const separator< C, S > &s)
 Output the separator object s on ostr.
template<typename K , typename C , typename A >
set< K, C, A > set_difference (const set< K, C, A > &s1, const set< K, C, A > &s2)
template<typename K , typename C , typename A >
set< K, C, A > set_intersection (const set< K, C, A > &s1, const set< K, C, A > &s2)
template<typename K , typename C , typename A >
set< K, C, A > set_union (const set< K, C, A > &s1, const set< K, C, A > &s2)
template<typename K , typename C , typename A >
std::ostream & operator<< (std::ostream &ostr, const set< K, C, A > &s)
template<typename K , typename C , typename A >
bool operator% (const K &k, const set< K, C, A > &s)
std::ostream & operator<< (std::ostream &ostr, const symbol &the)
 Intercept output stream redirection.
template<typename T , class C >
std::ostream & operator<< (std::ostream &ostr, const unique< T, C > &u)
 Intercept output stream redirection.
std::ostream & operator<< (std::ostream &o, const iomanipulator &g)
 Launch the iomanipulator action on o.
MAYBE_EXTERN template
std::ostream & 
operator<< (std::ostream &ostr, const map< temp::Label, temp::Label > &m)
MAYBE_EXTERN template
std::ostream & 
operator<< (std::ostream &ostr, const list< temp::Label > &l)
MAYBE_EXTERN template bool operator% (const temp::Label &t, const list< temp::Label > &l)

Detailed Description

Handling of generic, oriented or undirected, graph.

A set of handy C++ tools.

Typedef Documentation

typedef boost::property<boost::graph_name_t, std::string> misc::name_prop_type

Graph property: name.

Enumeration Type Documentation

Enumerator:
deref 

Function Documentation

path misc::basedir ( const std::string &  file)
std::string misc::basename ( const std::string &  file)
misc::BOOST_PP_REPEAT_FROM_TO ( ,
BOOST_VARIANT_LIMIT_TYPES  ,
MISC_GENERIC_VARIANT_CONVERSION_OPERATOR_DEF  ,
 
)
std::ostream & misc::decendl ( std::ostream &  o)
template<typename Container >
void misc::deep_clear ( Container &  c)
bool misc::file_exists ( const std::string &  file)
template<typename Container >
Container::const_iterator misc::find ( const Container &  c,
const typename Container::value_type &  v 
)
inline
template<typename Container >
Container::iterator misc::find ( Container &  c,
const typename Container::value_type &  v 
)
inline

Find v in the whole c.

References find().

template<typename Container , typename Functor >
Functor & misc::for_each ( Container &  c,
Functor &  v 
)
inline
template<typename Container >
bool misc::has ( const Container &  c,
const typename Container::value_type &  v 
)
inline
std::ostream & misc::iendl ( std::ostream &  o)
std::ostream & misc::incindent ( std::ostream &  o)

Increment the indentation.

Referenced by incendl(), and ast::PrettyPrinter::operator()().

template<class Fst , typename Snd >
pair< Fst, Snd > misc::make_pair ( Fst  fst,
Snd  snd 
)

Shorthand to create pair (fst, snd).

Referenced by overload::bind(), and parse::parse().

MAYBE_EXTERN template bool misc::operator% ( const temp::Label t,
const list< temp::Label > &  l 
)
template<typename Ident_ >
bool misc::operator% ( const Ident_ &  data,
const list< Ident_ > &  l 
)

Shortcut for misc::list::has.

template<class T >
bool misc::operator% ( const T &  data,
const list< T > &  l 
)
template<typename K , typename C , typename A >
bool misc::operator% ( const K &  k,
const set< K, C, A > &  s 
)
inline
std::ostream & misc::operator<< ( std::ostream &  o,
const iomanipulator &  g 
)
inline

Launch the iomanipulator action on o.

Call the operator() of g(so set, get or swap the xalloced data with data_).

template<class Fst , typename Snd >
std::ostream & misc::operator<< ( std::ostream &  ostr,
const pair< Fst, Snd > &  p 
)
inline

Output the pair object s on ostr.

template<typename Key , typename Data >
std::ostream & misc::operator<< ( std::ostream &  ostr,
const scoped_map< Key, Data > &  tbl 
)
inline
Deref misc::operator<< ( std::ostream &  ostr,
deref_e   
)
inline
template<class C , typename S >
std::ostream & misc::operator<< ( std::ostream &  ostr,
const separator< C, S > &  s 
)
inline

Output the separator object s on ostr.

std::ostream & misc::operator<< ( std::ostream &  o,
const escaped &  rhs 
)
inline
MAYBE_EXTERN template std::ostream & misc::operator<< ( std::ostream &  ostr,
const map< temp::Label, temp::Label > &  m 
)
MAYBE_EXTERN template std::ostream & misc::operator<< ( std::ostream &  ostr,
const list< temp::Label > &  l 
)
template<class Ident_ >
std::ostream& misc::operator<< ( std::ostream &  ostr,
const list< Ident_ > &  l 
)

Output l onto ostr.

std::ostream & misc::operator<< ( std::ostream &  ostr,
const path &  p 
)
inline

References misc::path::dump().

template<typename T , class C >
std::ostream & misc::operator<< ( std::ostream &  ostr,
const unique< T, C > &  u 
)
inline

Intercept output stream redirection.

Parameters
ostrthe destination output stream
thea reference to the unique to redirect
std::ostream& misc::operator<< ( std::ostream &  ostr,
const symbol &  the 
)

Intercept output stream redirection.

Parameters
ostrthe destination output stream
thea reference to the symbol to redirect
std::ostream & misc::operator<< ( std::ostream &  ostr,
const file_library &  l 
)
inline
template<typename Orientation , typename VertexLabel , typename EdgeLabel >
std::ostream & misc::operator<< ( std::ostream &  ostr,
const graph< Orientation, VertexLabel, EdgeLabel > &  g 
)
inline
template<class T >
std::ostream& misc::operator<< ( std::ostream &  ostr,
const list< T > &  l 
)
std::ostream & misc::operator<< ( std::ostream &  ostr,
empty   
)
inline
std::ostream & misc::operator<< ( std::ostream &  o,
const error &  e 
)

Display the error message on the given ostream.

References misc::error::stream_get().

template<class T , class N >
std::ostream & misc::operator<< ( std::ostream &  ostr,
const map< T, N > &  m 
)

Output m onto ostr.

template<typename K , typename C , typename A >
std::ostream & misc::operator<< ( std::ostream &  ostr,
const set< K, C, A > &  s 
)
inline
template<typename Map >
Map::iterator misc::put ( Map &  map,
const typename Map::key_type &  key,
const typename Map::mapped_type &  value 
)
std::ostream & misc::resetindent ( std::ostream &  o)

Reset the indentation.

template<class C , typename S >
separator< C, S > misc::separate ( const C &  c,
const S &  s 
)

Shorthand to create separator(c, s).

Referenced by tree::operator<<(), translate::operator<<(), and separate().

template<class C >
separator< C, char > misc::separate ( const C &  c)

Shorthand to create separator(c, '
').

References separate().

template<typename K , typename C , typename A >
set< K, C, A > misc::set_difference ( const set< K, C, A > &  s1,
const set< K, C, A > &  s2 
)
inline
template<typename K , typename C , typename A >
set< K, C, A > misc::set_intersection ( const set< K, C, A > &  s1,
const set< K, C, A > &  s2 
)
inline
template<typename K , typename C , typename A >
set< K, C, A > misc::set_union ( const set< K, C, A > &  s1,
const set< K, C, A > &  s2 
)
inline