summaryrefslogtreecommitdiff
path: root/CIAO/CCF/Test/CompilerElements/CPP/driver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CIAO/CCF/Test/CompilerElements/CPP/driver.cpp')
-rw-r--r--CIAO/CCF/Test/CompilerElements/CPP/driver.cpp40
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;
+}