summaryrefslogtreecommitdiff
path: root/cli/token.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-08-10 17:54:32 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-08-10 17:54:32 +0200
commitc3f7f0c0556270ced988a7adddec885270bc1ea7 (patch)
tree9fac46ab1e66a8be14ba46a2cf2c2a798d73adc6 /cli/token.ixx
parent8d796e32510dc00e0b6f25b841bff8425c54dc6b (diff)
Inline file for the Token class
Diffstat (limited to 'cli/token.ixx')
-rw-r--r--cli/token.ixx70
1 files changed, 70 insertions, 0 deletions
diff --git a/cli/token.ixx b/cli/token.ixx
new file mode 100644
index 0000000..bcf040a
--- /dev/null
+++ b/cli/token.ixx
@@ -0,0 +1,70 @@
+// file : cli/token.ixx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2009 Code Synthesis Tools CC
+// license : MIT; see accompanying LICENSE file
+
+inline Token::Type Token::
+type () const
+{
+ return type_;
+}
+
+inline std::size_t Token::
+line () const
+{
+ return l_;
+}
+
+inline std::size_t Token::
+column () const
+{
+ return c_;
+}
+
+inline Token::Keyword Token::
+keyword () const
+{
+ return keyword_;
+}
+
+inline std::string const& Token::
+identifier () const
+{
+ return str_;
+}
+
+inline Token::Punctuation Token::
+punctuation () const
+{
+ return punctuation_;
+}
+
+inline std::string const& Token::
+literal () const
+{
+ return str_;
+}
+
+inline Token::
+Token (std::size_t l, std::size_t c)
+ : l_ (l), c_ (c), type_ (t_eos)
+{
+}
+
+inline Token::
+Token (Keyword k, std::size_t l, std::size_t c)
+ : l_ (l), c_ (c), type_ (t_keyword), keyword_ (k)
+{
+}
+
+inline Token::
+Token (Punctuation p, std::size_t l, std::size_t c)
+ : l_ (l), c_ (c), type_ (t_punctuation), punctuation_ (p)
+{
+}
+
+inline Token::
+Token (Type t, std::string const& s, std::size_t l, std::size_t c)
+ : l_ (l), c_ (c), type_ (t), str_ (s)
+{
+}