From cea6fb57ac8c9a893c0f404fef6c1469f0b6222b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 22 Jul 2010 14:33:21 +0200 Subject: Next chunk of functionality Add SQL language lexer. Implement MySQL type declaration parser. Create sub-directories for databases, currently mysql and tracer. Create MySQL-specific context. --- odb/sql-token.ixx | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 odb/sql-token.ixx (limited to 'odb/sql-token.ixx') diff --git a/odb/sql-token.ixx b/odb/sql-token.ixx new file mode 100644 index 0000000..43f522f --- /dev/null +++ b/odb/sql-token.ixx @@ -0,0 +1,46 @@ +// file : odb/sql-token.ixx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +inline sql_token::token_type sql_token:: +type () const +{ + return type_; +} + +inline std::string const& sql_token:: +identifier () const +{ + return str_; +} + +inline sql_token::punctuation_type sql_token:: +punctuation () const +{ + return type_ == t_punctuation ? punctuation_ : p_invalid; +} + +inline std::string const& sql_token:: +literal () const +{ + return str_; +} + +inline sql_token:: +sql_token () + : type_ (t_eos) +{ +} + +inline sql_token:: +sql_token (punctuation_type p) + : type_ (t_punctuation), punctuation_ (p) +{ +} + +inline sql_token:: +sql_token (token_type t, std::string const& s) + : type_ (t), str_ (s) +{ +} -- cgit v1.1