[cfe-dev] New to Clang

Sebastian Redl sebastian.redl at getdesigned.at
Thu Aug 26 10:31:41 PDT 2010


On Aug 26, 2010, at 9:46 AM, Wei Li wrote:

> Dear  all;
> 
> I am a PhD student in EE at The university of Waterloo. I am planning
> to use the Clang front end for my work.
> 
> I will be extending the C language to support my needs for the
> research i.e. I will be creating some new keywords.
> 
> I am an electrical engineer not a compiler person. However, I am
> reading on compiler. My question is how to start in the Clang? I see
> LEX directory . My understating is to walk through this first in order
> to create new tokens. But which file to touch first?

The only part of Lex you'll ever need to touch (unless you're extending the preprocessor) is TokenKinds.td, which actually lives in Basic. It defines the special tokens and keywords that exist in Clang. If you need a new keyword, you simply add it there.
Everything else should probably go into Parser, Sema and CodeGen.

Sebastian



More information about the cfe-dev mailing list