[cfe-dev] How to make clang compile any other language ? I want it to support ACSL (specification language of C).)

Hal Finkel hfinkel at anl.gov
Fri Jul 26 14:06:37 PDT 2013


----- Original Message -----
> 
> 
> 
> 
> Hie all.
> I wanted to know is that any way we can check for the tokens
> generated by clang for a given test file. Actually I had done some
> changes in the tokenKinds.def file and added some more keywordss to
> it. Now, I want to check whether it is able to tokenize those new
> keywords or not. Is there any command which may help ?
> Thanks in advance.

If you run with:
  -Xclang -dump-tokens

then you'll get debugging information from the lexer on every token that is recognized.

 -Hal

> 
> 
> 
> On Fri, Jul 26, 2013 at 4:45 PM, surbhi singh <
> surbhi.chauhan011 at gmail.com > wrote:
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> On Fri, Jul 26, 2013 at 4:44 PM, surbhi singh <
> surbhi.chauhan011 at gmail.com > wrote:
> 
> 
> 
> 
> 
> 
> Hie all.
> I wanted to know is that any way we can check for the tokens
> generated by clang for a given test file. Actually I had done some
> changes in the tokenKinds.def file and added some more keywordss to
> it. Now, I want to check whether it is able to tokenize those new
> keywords or not. Is there any command which may help ?
> Thanks in advance.
> Surbhi
> 
> 
> 
> 
> 
> 
> On Mon, Jul 22, 2013 at 10:50 PM, James Dennett <
> james.dennett at gmail.com > wrote:
> 
> 
> 
> On Mon, Jul 22, 2013 at 5:26 AM, surbhi singh
> < surbhi.chauhan011 at gmail.com > wrote:
> > Hie Mahesha.
> > Thanks for this information. I want to know that from where should
> > I get
> > information about Clang's preprocessor.
> 
> Preprocessor.h is a useful entry point for the preprocessor.
> PPCallbacks is a useful extension point.
> 
> 
> > To be specific I want to know where
> > are the tokens specified in the code. I have searched the clang's
> > documentation, but not able to find the right code for me to start.
> 
> Searching for "Lex" should find you the code that generates the
> tokens.
> 
> -- James
> 
> 
> 
> 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the cfe-dev mailing list