summaryrefslogtreecommitdiff
path: root/TAO/CIAO/CCF/CCF/CompilerElements/PreprocessorToken.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/CIAO/CCF/CCF/CompilerElements/PreprocessorToken.cpp')
-rw-r--r--TAO/CIAO/CCF/CCF/CompilerElements/PreprocessorToken.cpp57
1 files changed, 57 insertions, 0 deletions
diff --git a/TAO/CIAO/CCF/CCF/CompilerElements/PreprocessorToken.cpp b/TAO/CIAO/CCF/CCF/CompilerElements/PreprocessorToken.cpp
new file mode 100644
index 00000000000..5f3e629243e
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/CompilerElements/PreprocessorToken.cpp
@@ -0,0 +1,57 @@
+// file : CCF/CompilerElements/PreprocessorToken.cpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#include "CCF/CompilerElements/PreprocessorToken.hpp"
+
+namespace CCF
+{
+ namespace CompilerElements
+ {
+ namespace CPP
+ {
+ Token const Token::eos;
+
+ Token::
+ Token (char c, unsigned long line)
+ : c_ (traits::to_int_type (c)), line_ (line)
+ {
+ }
+
+ Token::
+ Token ()
+ : c_ (traits::eof ()), line_ (0)
+ {
+ }
+
+ Token::
+ operator char () const throw (EOS)
+ {
+ if (*this == eos) throw EOS ();
+
+ return traits::to_char_type (c_);
+ }
+
+
+ unsigned long Token::
+ line () const throw (EOS)
+ {
+ if (*this == eos) throw EOS ();
+
+ return line_;
+ }
+
+ bool
+ operator== (Token const& a, Token const& b)
+ {
+ return a.c_ == b.c_;
+ }
+
+ bool
+ operator!= (Token const& a, Token const& b)
+ {
+ return a.c_ != b.c_;
+ }
+ }
+ }
+}