Hi,

To implement (performant) string based lookup functionality we'd like to
call some Parser functions that are currently inaccessible. Attached
patch is one solution; we'd place the calls through a class deriving
from Parser. Making some key parsing functions (the ones we use :-)
public is another option.

Rationale: the public Parser interfaces do string -> AST node
operations; we do not want to create AST nodes nor do we even have valid
C++ code, think lookup("int") where "int" is not a valid C++ declaration
that the public Parser interfaces expect.

Cheers, Axel.
Index: tools/clang/include/clang/Parse/Parser.h
===================================================================
--- tools/clang/include/clang/Parse/Parser.h	(revision 162901)
+++ tools/clang/include/clang/Parse/Parser.h	(working copy)
@@ -282,7 +282,7 @@
   /// the EOF was encountered.
   bool ParseTopLevelDecl(DeclGroupPtrTy &Result);
 
-private:
+protected:
   //===--------------------------------------------------------------------===//
   // Low-Level token peeking and consumption methods.
   //
@@ -709,7 +709,7 @@
     return Diag(Tok, DiagID);
   }
 
-private:
+protected:
   void SuggestParentheses(SourceLocation Loc, unsigned DK,
                           SourceRange ParenRange);
   void CheckNestedObjCContexts(SourceLocation AtLoc);
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to