[cfe-dev] Understanding Clang parsing

Charles Davis cdavis at mymail.mines.edu
Wed Mar 3 18:49:54 PST 2010


On 3/3/10 7:40 PM, kalyan ponnala wrote:
> Hi,
> 
> I am trying to understand how the lexer and parser work inside
> Clang/LLVM solution file. I am using a cmake generated visual studio
> 2008 solution file. I tried stepping into the lexer and understand the
> way clang's lexer works.
> 
> 1. Can anyone tell me how the parser is designed in a short sentence. I
> would like to concentrate on how the AST works inside this parser design.
The Parser takes tokens read by the Lexer and assigns meaning to them.
It's responsible for determining what 'int' means, for example. The
parser uses this information to build the AST.

I understand your concern. Parts of Clang have me confused, too :). But
don't worry; there's plenty of people around here (including me) who are
willing to help you understand how Clang works.

Chip



More information about the cfe-dev mailing list