[cfe-dev] Need some guidance regarding Parsing

Francois Pichet pichet2000 at gmail.com
Sun Sep 5 19:47:12 PDT 2010


On Sun, Sep 5, 2010 at 5:36 PM, Wei Li <weili747 at gmail.com> wrote:
> Dear All :
>
> I am trying to insert a keyword "zone" . I changed the
> "TokenKinds.def" file by adding a line KEYWORD(zone  , KEYALL). Now
> when I compile a file with this extension I got the
> following error:
>
> ------------------------------------------------------------
> test.cpp:4:1: error: expected unqualified-id
> zone X;
> ^
>
> Which part of the parser should I look into to make this file
> workable? The scope of the keyword is very similar to "int". How can I
> have the flow of this keyword?
>

Look into file ParseDecl.cpp function
Parser::ParseDeclarationSpecifiers. You will need to add a case for
your new keyword there.




More information about the cfe-dev mailing list