diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-07-22 14:33:21 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-07-22 14:33:21 +0200 |
commit | cea6fb57ac8c9a893c0f404fef6c1469f0b6222b (patch) | |
tree | fed8b6ffa8ea2cb6347ece69c0cb81003d0ccbf6 /odb/sql-token.ixx | |
parent | 5f71c55a1c24c23af1eeb0d664922497a0e5c071 (diff) |
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.
Diffstat (limited to 'odb/sql-token.ixx')
-rw-r--r-- | odb/sql-token.ixx | 46 |
1 files changed, 46 insertions, 0 deletions
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 <boris@codesynthesis.com> +// 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) +{ +} |