From 720c5a33b6a49cf328fdd7611f49153cf8f60247 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 8 Apr 2020 14:51:57 +0300 Subject: Separate tests and examples into individual packages Also make cli module to be explicitly enabled via the config.cli configuration variable. --- cli/lexer.hxx | 142 ---------------------------------------------------------- 1 file changed, 142 deletions(-) delete mode 100644 cli/lexer.hxx (limited to 'cli/lexer.hxx') diff --git a/cli/lexer.hxx b/cli/lexer.hxx deleted file mode 100644 index bd7b0c9..0000000 --- a/cli/lexer.hxx +++ /dev/null @@ -1,142 +0,0 @@ -// file : cli/lexer.hxx -// author : Boris Kolpackov -// license : MIT; see accompanying LICENSE file - -#ifndef CLI_LEXER_HXX -#define CLI_LEXER_HXX - -#include -#include -#include -#include // std::size_t -#include - -#include - -class lexer -{ -public: - lexer (std::istream& is, std::string const& id); - - token - next (); - - bool - valid () const; - -protected: - class xchar - { - public: - typedef std::char_traits traits_type; - typedef traits_type::int_type int_type; - typedef traits_type::char_type char_type; - - xchar (int_type v, std::size_t l, std::size_t c); - - operator char_type () const; - - int_type - value () const; - - std::size_t - line () const; - - std::size_t - column () const; - - private: - int_type v_; - std::size_t l_; - std::size_t c_; - }; - - xchar - peek (); - - xchar - get (); - - void - unget (xchar); - -protected: - class invalid_input {}; - - void - skip_spaces (); - - token - identifier (xchar); - - token - int_literal (xchar, - bool neg = false, - std::size_t ml = 0, - std::size_t mc = 0); - - token - char_literal (xchar); - - token - string_literal (xchar); - - std::string - string_literal_trailer (); - - token - path_literal (xchar); - - token - call_expression (xchar); - - token - template_expression (xchar); - -protected: - bool - is_alpha (char c) const; - - bool - is_oct_digit (char c) const; - - bool - is_dec_digit (char c) const; - - bool - is_hex_digit (char c) const; - - bool - is_alnum (char c) const; - - bool - is_space (char c) const; - - bool - is_eos (xchar const& c) const; - - char - to_upper (char c) const; - -private: - typedef std::map keyword_map; - - std::locale loc_; - std::istream& is_; - std::string id_; - std::size_t l_; - std::size_t c_; - - keyword_map keyword_map_; - - bool eos_; - bool include_; // Literal in include or source. - bool valid_; - - xchar buf_; - bool unget_; -}; - -#include - -#endif // CLI_LEXER_HXX -- cgit v1.1