I've read http://msdn.microsoft.com/en-us/library/aa730877%28vs.80%29.aspx but this document was for VS 2005. I stuck on the part 'Importing a .rules File in Visual C++' in the document. It seems that VS 2010 does not support .rules file, instead, it seems to use .targets file for custom build rules.
Does anyone know how to use flex & bison in VS 2010? Thanks.
The good news is, that targets file works after a conversion to 2010.
Although the example wont run because of dependencies you are now able to create your own project and build your own lexer and parser. The only issue you will have is the use of unistd.h being included. Add this and it wont:
#define YY_NO_UNISTD_H
I think you can get the rest of the things you need to build your parser in 2010 in the flex & bison book.