aboutsummaryrefslogtreecommitdiff
path: root/build/token.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-03-30 14:16:54 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-03-30 14:16:54 +0200
commitb1715878d50aa8a3c3e2404f3ded120329994aba (patch)
tree85c9feb4556f7555f0acc0e2d012ee52b73c1b34 /build/token.cxx
parent70256514a09e4692c6839f5c2b21b7ec9c1055bd (diff)
Initial support for command line variables
Diffstat (limited to 'build/token.cxx')
-rw-r--r--build/token.cxx34
1 files changed, 34 insertions, 0 deletions
diff --git a/build/token.cxx b/build/token.cxx
new file mode 100644
index 0000000..33d30a8
--- /dev/null
+++ b/build/token.cxx
@@ -0,0 +1,34 @@
+// file : build/token.cxx -*- C++ -*-
+// copyright : Copyright (c) 2014-2015 Code Synthesis Tools CC
+// license : MIT; see accompanying LICENSE file
+
+#include <build/token>
+
+#include <ostream>
+
+using namespace std;
+
+namespace build
+{
+ ostream&
+ operator<< (ostream& os, const token& t)
+ {
+ switch (t.type ())
+ {
+ case token_type::eos: os << "<end-of-file>"; break;
+ case token_type::newline: os << "<newline>"; break;
+ case token_type::pair_separator: os << "<pair separator>"; break;
+ case token_type::colon: os << ":"; break;
+ case token_type::lcbrace: os << "{"; break;
+ case token_type::rcbrace: os << "}"; break;
+ case token_type::equal: os << "="; break;
+ case token_type::plus_equal: os << "+="; break;
+ case token_type::dollar: os << "$"; break;
+ case token_type::lparen: os << "("; break;
+ case token_type::rparen: os << ")"; break;
+ case token_type::name: os << t.name (); break;
+ }
+
+ return os;
+ }
+}