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

James Dennett james.dennett at gmail.com
Tue Sep 10 18:30:27 PDT 2013


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 :-)

-- James



More information about the cfe-dev mailing list