summaryrefslogtreecommitdiff
path: root/CIAO/CCF/Test/CompilerElements/CPP/driver.cpp
blob: de3624d86a77c598fd8e4cbff7cbf55ccaf44529 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// file      : CCF/Test/CompilerElements/CPP/driver.cpp
// author    : Boris Kolpackov <boris@dre.vanderbilt.edu>
// cvs-id    : $Id$

#include <iostream>

#include "CCF/CompilerElements/TokenStream.hpp"
#include "CCF/CompilerElements/Preprocessor.hpp"

using std::cout;
using std::endl;

using CCF::CompilerElements::InputStreamAdapter;

using namespace CCF::CompilerElements::CPP;

int
main ()
{
  InputStreamAdapter isa (std::cin);
  Preprocessor pp (isa);

  try
  {
    for (;;)
    {
      Token t (pp.next ());

      if (t == Token::eos) break;

      std::cout << t;
    }
  }
  catch (std::exception const& e)
  {
    cout << e.what () << endl;
  }

  return 0;
}