aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/parser.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/cc/parser.hxx')
-rw-r--r--libbuild2/cc/parser.hxx26
1 files changed, 21 insertions, 5 deletions
diff --git a/libbuild2/cc/parser.hxx b/libbuild2/cc/parser.hxx
index 7b33ef9..0c2eb2d 100644
--- a/libbuild2/cc/parser.hxx
+++ b/libbuild2/cc/parser.hxx
@@ -10,6 +10,7 @@
#include <libbuild2/diagnostics.hxx>
#include <libbuild2/cc/types.hxx>
+#include <libbuild2/cc/guess.hxx> // compiler_id
namespace build2
{
@@ -23,18 +24,32 @@ namespace build2
class parser
{
public:
+ // The compiler_id argument should identify the compiler that has done
+ // the preprocessing.
+ //
unit
- parse (ifdstream&, const path_name&);
+ parse (ifdstream& is, const path_name& n, const compiler_id& cid)
+ {
+ unit r;
+ parse (is, n, r, cid);
+ return r;
+ }
+
+ void
+ parse (ifdstream&, const path_name&, unit&, const compiler_id&);
private:
void
- parse_import (token&, bool);
+ parse_module (token&, bool, location_value);
void
- parse_module (token&, bool);
+ parse_import (token&, bool);
- string
- parse_module_name (token&);
+ pair<string, bool>
+ parse_module_name (token&, bool);
+
+ void
+ parse_module_part (token&, string&);
string
parse_header_name (token&);
@@ -43,6 +58,7 @@ namespace build2
string checksum; // Translation unit checksum.
private:
+ const compiler_id* cid_;
lexer* l_;
unit* u_;