[cfe-commits] Opening Parser internals for 3rd parties

Axel Naumann Axel.Naumann at cern.ch
Fri Sep 14 08:21:30 PDT 2012


Hi Doug,

On 09/11/2012 08:13 AM, Douglas Gregor wrote:
> On Aug 30, 2012, at 6:05 AM, Axel Naumann <Axel.Naumann at cern.ch>
> wrote:
>> To implement (performant) string based lookup functionality we'd
>> like to call some Parser functions that are currently inaccessible.
>
> I'm fine with the general notion of opening up the parser more, but
> what specific functions are you looking for?

Great news! We use these members of Parser:

ConsumeToken
EnterScope
ExitScope
getTypeAnnotation
NextToken
NotTypeCast
ParseAssignmentExpression
ParseTypeName
ParseUnqualifiedId
SkipUntil
TryAnnotateCXXScopeToken
TryAnnotateTypeOrScopeToken
TypeCastState


The functionality we use those for is:

* get QualType from string
* get DeclContext from string
* find FunctionDecl from function name and parameter types passed as string
* find FunctionDecl from function name and argument expressions passed
as string

If you want to see how we use these Parser functions then please have a
look at the code:
<http://root.cern.ch/viewvc/trunk/interpreter/cling/lib/Interpreter/LookupHelper.cpp?view=markup>.

Are there higher-level functions that we should have used, and that
nonetheless do not modify the AST? If not, can above functions be made
accessible? (I'm not claiming that this is the final list, though :-)

Cheers, Axel.




More information about the cfe-commits mailing list