diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2019-08-24 17:41:30 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2019-08-28 15:01:48 +0300 |
commit | 4bdf53837e010073de802070d4e6087410662d3e (patch) | |
tree | 2820d3964877d1a7d498833da325aa3d3a699353 /libbuild2/cc/parser.hxx | |
parent | ea24f530048cbce0c5335ca3fd3632c8ce34315a (diff) |
Move cc build system module to separate library
Diffstat (limited to 'libbuild2/cc/parser.hxx')
-rw-r--r-- | libbuild2/cc/parser.hxx | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/libbuild2/cc/parser.hxx b/libbuild2/cc/parser.hxx new file mode 100644 index 0000000..324b62a --- /dev/null +++ b/libbuild2/cc/parser.hxx @@ -0,0 +1,55 @@ +// file : libbuild2/cc/parser.hxx -*- C++ -*- +// copyright : Copyright (c) 2014-2019 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +#ifndef LIBBUILD2_CC_PARSER_HXX +#define LIBBUILD2_CC_PARSER_HXX + +#include <libbuild2/types.hxx> +#include <libbuild2/utility.hxx> + +#include <libbuild2/diagnostics.hxx> + +#include <libbuild2/cc/types.hxx> + +namespace build2 +{ + namespace cc + { + // Extract translation unit information from a preprocessed C/C++ source. + // + struct token; + class lexer; + + class parser + { + public: + unit + parse (ifdstream&, const path& name); + + private: + void + parse_import (token&, bool); + + void + parse_module (token&, bool); + + string + parse_module_name (token&); + + string + parse_header_name (token&); + + public: + string checksum; // Translation unit checksum. + + private: + lexer* l_; + unit* u_; + + optional<location> module_marker_; + }; + } +} + +#endif // LIBBUILD2_CC_PARSER_HXX |