summaryrefslogtreecommitdiff
path: root/modules/CIAO/CCF/Test/CompilerElements
diff options
context:
space:
mode:
authorjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-29 21:10:39 +0000
committerjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-29 21:10:39 +0000
commite7b830ab561638ed25822054be80ce12e8801d38 (patch)
treea5b9aa16924c541fcb424ee9460b1ac7f5a89352 /modules/CIAO/CCF/Test/CompilerElements
parent9b720f395833b3ce2f499463e5fed37a0da926f4 (diff)
downloadATCD-DiffServ-Merge.tar.gz
branching/taggingDiffServ-Merge
Diffstat (limited to 'modules/CIAO/CCF/Test/CompilerElements')
-rw-r--r--modules/CIAO/CCF/Test/CompilerElements/CPP/driver.cpp40
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;
+}