diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-07-20 11:12:11 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-07-27 10:30:15 +0200 |
commit | 526f66e63f23afb40cc01550ca1a3a3592a84254 (patch) | |
tree | f17fd648c4c1e11838b413c6de91ff61693c0480 /odb/lookup.cxx | |
parent | 0a6a2fe64508497d287aa3341e667fe313912774 (diff) |
Use cxx_lexer interface instead of pragma_lex() directly
This will allow us to use different kinds of cxx_lexer implementations
in the future.
Diffstat (limited to 'odb/lookup.cxx')
-rw-r--r-- | odb/lookup.cxx | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/odb/lookup.cxx b/odb/lookup.cxx index 1568c42..c6b40b1 100644 --- a/odb/lookup.cxx +++ b/odb/lookup.cxx @@ -9,14 +9,14 @@ using namespace std; namespace lookup { std::string - parse_scoped_name (std::string& t, cpp_ttype& tt, cxx_lexer& lex) + parse_scoped_name (cxx_lexer& l, cpp_ttype& tt, string& tl, tree& tn) { string name; if (tt == CPP_SCOPE) { name += "::"; - tt = lex.next (t); + tt = l.next (tl, &tn); } while (true) @@ -26,24 +26,25 @@ namespace lookup if (tt != CPP_NAME && tt != CPP_KEYWORD) throw invalid_name (); - name += t; - tt = lex.next (t); + name += tl; + tt = l.next (tl, &tn); if (tt != CPP_SCOPE) break; name += "::"; - tt = lex.next (t); + tt = l.next (tl, &tn); } return name; } tree - resolve_scoped_name (string& t, + resolve_scoped_name (cxx_lexer& l, cpp_ttype& tt, + string& tl, + tree& tn, cpp_ttype& ptt, - cxx_lexer& lex, tree scope, string& name, bool is_type, @@ -59,7 +60,7 @@ namespace lookup first = false; ptt = tt; - tt = lex.next (t); + tt = l.next (tl, &tn); } while (true) @@ -72,10 +73,10 @@ namespace lookup if (tt != CPP_NAME && tt != CPP_KEYWORD) throw invalid_name (); - name += t; - id = get_identifier (t.c_str ()); + name += tl; + id = get_identifier (tl.c_str ()); ptt = tt; - tt = lex.next (t); + tt = l.next (tl, &tn); bool last (tt != CPP_SCOPE); tree decl = lookup_qualified_name (scope, id, last && is_type, false); @@ -110,7 +111,7 @@ namespace lookup name += "::"; ptt = tt; - tt = lex.next (t); + tt = l.next (tl, &tn); } return scope; |