[cfe-dev] How to add a function to an AST?

Manuel Klimek klimek at google.com
Wed Sep 11 02:34:34 PDT 2013


On Wed, Sep 11, 2013 at 3:30 AM, James Dennett <james.dennett at gmail.com>wrote:

> On Tue, Sep 10, 2013 at 6:10 PM, Joshua T <llvm.mailing at gmail.com> wrote:
> > Okay, thank you guys!
> > It seems that I could solve my problem!
> >
> >
> >
> > Usually we just use the lexer towards the "," from the end of the
> > parameter... (you know how many there are, so you know whether there is
> > going to be a comma or not)
> >
> > Finally, a question for Manuel :-)
> > Sorry for bothering you but exploring and understanding clang techniques
> is
> > exiting!
> >
> > Why do you use the lexer?
> > Something like this could make it hard to find the correct comma:
> >
> > void foo (int i /* comment , , , , */, /* , , , , */ int j /* ,,,*/, /*
> ,,,,
> > */ int k);
>
> The next token after "int i" there is the right comma (and similarly
> for "int j").  In other words: don't worry, this isn't hard :-)
>

And if the Lexer is !inKeepCommentMode you can also get comments as tokens.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130911/267e0711/attachment.html>


More information about the cfe-dev mailing list