diff options
author | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-29 21:15:18 +0000 |
---|---|---|
committer | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-29 21:15:18 +0000 |
commit | b71531b42b3325fd6079a7039aae8641262c8adf (patch) | |
tree | a5b9aa16924c541fcb424ee9460b1ac7f5a89352 /modules/CIAO/CCF/Test/CompilerElements/CPP/driver.cpp | |
parent | a0f67cc97c0050d907145e312135b60c0125e56e (diff) | |
download | ATCD-b71531b42b3325fd6079a7039aae8641262c8adf.tar.gz |
branching/taggingDS-main
Diffstat (limited to 'modules/CIAO/CCF/Test/CompilerElements/CPP/driver.cpp')
-rw-r--r-- | modules/CIAO/CCF/Test/CompilerElements/CPP/driver.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/modules/CIAO/CCF/Test/CompilerElements/CPP/driver.cpp b/modules/CIAO/CCF/Test/CompilerElements/CPP/driver.cpp new file mode 100644 index 00000000000..de3624d86a7 --- /dev/null +++ b/modules/CIAO/CCF/Test/CompilerElements/CPP/driver.cpp @@ -0,0 +1,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; +} |