LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
identifier.hxx
Go to the documentation of this file.
1 
6 #ifndef TEMP_IDENTIFIER_HXX
7 # define TEMP_IDENTIFIER_HXX
8 
9 # include <cstdlib>
10 
11 # include <sstream>
12 # include <iostream>
13 
14 # include <boost/variant.hpp>
15 
16 # include <misc/contract.hh>
17 # include <temp/identifier.hh>
18 
19 namespace temp
20 {
21 
22  /*-------------.
23  | Identifier. |
24  `-------------*/
25 
26  template <template <typename Tag_> class Traits_>
28  Identifier<Traits_>::map;
29 
30  template <template <typename Tag_> class Traits_>
31  std::ostream&
32  operator<<(std::ostream& ostr, const Identifier<Traits_>& obj)
33  {
34  typename Identifier<Traits_>::map_type* m =
36  if (m)
37  return (*m)(obj).dump(ostr);
38  else
39  return obj.dump(ostr);
40  }
41 
42 
43  template <template <typename Tag_> class Traits_>
45  : value_(count_)
46  , prefix_(&Traits_<unsigned>::prefix)
47  , rank_(Traits_<unsigned>::rank)
48  {
49  ++count_;
50  }
51 
52  template <template <typename Tag_> class Traits_>
54  : value_(sym)
55  , prefix_(&Traits_<misc::symbol>::prefix)
56  , rank_(Traits_<misc::symbol>::rank)
57  {
58  }
59 
60  // FIXME: Some code was deleted here.
61 
62 
63  /*------------------.
64  | Variant visitor. |
65  `------------------*/
66 
67  // FIXME: Some code was deleted here.
68 
69 } // namespace temp
70 
71 #endif // !TEMP_IDENTIFIER_HXX