From 526f66e63f23afb40cc01550ca1a3a3592a84254 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 20 Jul 2012 11:12:11 +0200 Subject: Use cxx_lexer interface instead of pragma_lex() directly This will allow us to use different kinds of cxx_lexer implementations in the future. --- odb/lookup.cxx | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'odb/lookup.cxx') 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; -- cgit v1.1