diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2017-05-01 18:24:31 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2017-05-01 19:30:26 +0300 |
commit | 70317569c6dcd9809ed4a8c425777e653ec6ca08 (patch) | |
tree | 07a538b296933e9e2a1f81088f8fcc8da3f749ad /build2/test/script/lexer | |
parent | cbec9ea8841c8a58b2d50bb628b28aea7a6fe179 (diff) |
Add hxx extension for headers
Diffstat (limited to 'build2/test/script/lexer')
-rw-r--r-- | build2/test/script/lexer | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/build2/test/script/lexer b/build2/test/script/lexer deleted file mode 100644 index 4851e13..0000000 --- a/build2/test/script/lexer +++ /dev/null @@ -1,90 +0,0 @@ -// file : build2/test/script/lexer -*- C++ -*- -// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd -// license : MIT; see accompanying LICENSE file - -#ifndef BUILD2_TEST_SCRIPT_LEXER -#define BUILD2_TEST_SCRIPT_LEXER - -#include <build2/types> -#include <build2/utility> - -#include <build2/lexer> - -#include <build2/test/script/token> - -namespace build2 -{ - namespace test - { - namespace script - { - struct lexer_mode: build2::lexer_mode - { - using base_type = build2::lexer_mode; - - enum - { - command_line = base_type::value_next, - first_token, // Expires at the end of the token. - second_token, // Expires at the end of the token. - variable_line, // Expires at the end of the line. - command_expansion, - here_line_single, - here_line_double, - description_line // Expires at the end of the line. - }; - - lexer_mode () = default; - lexer_mode (value_type v): base_type (v) {} - lexer_mode (base_type v): base_type (v) {} - }; - - class lexer: public build2::lexer - { - public: - using base_lexer = build2::lexer; - using base_mode = build2::lexer_mode; - - lexer (istream& is, - const path& name, - lexer_mode m, - const char* escapes = nullptr) - : base_lexer (is, name, nullptr, false) - { - mode (m, '\0', escapes); - } - - virtual void - mode (base_mode, - char = '\0', - optional<const char*> = nullopt) override; - - // Number of quoted (double or single) tokens since last reset. - // - size_t - quoted () const {return quoted_;} - - void - reset_quoted (size_t q) {quoted_ = q;} - - virtual token - next () override; - - protected: - token - next_line (); - - token - next_description (); - - virtual token - word (state, bool) override; - - protected: - size_t quoted_; - }; - } - } -} - -#endif // BUILD2_TEST_SCRIPT_LEXER |