diff options
author | Abdullah Sowayan <sowayan@users.noreply.github.com> | 2007-03-18 22:23:37 +0000 |
---|---|---|
committer | Abdullah Sowayan <sowayan@users.noreply.github.com> | 2007-03-18 22:23:37 +0000 |
commit | 06a34455bd98b1379cc69bbc5b2cf085e0fc0d9b (patch) | |
tree | 8815ce3b3a85c3c4285429295f338e00ea4497f4 /CIAO/CCF/Test/CompilerElements/CPP/driver.cpp | |
parent | d66fcc9b4aaec8e88eeb83fc578fdf8a3cc963de (diff) | |
download | ATCD-Static_RT_DAnCE.tar.gz |
Diffstat (limited to 'CIAO/CCF/Test/CompilerElements/CPP/driver.cpp')
-rw-r--r-- | CIAO/CCF/Test/CompilerElements/CPP/driver.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/CIAO/CCF/Test/CompilerElements/CPP/driver.cpp b/CIAO/CCF/Test/CompilerElements/CPP/driver.cpp new file mode 100644 index 00000000000..de3624d86a7 --- /dev/null +++ b/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; +} |