jcpp icon indicating copy to clipboard operation
jcpp copied to clipboard

Any tutorials on this project?

Open rchlin opened this issue 10 years ago • 5 comments

There is no wiki either.

rchlin avatar Nov 11 '15 08:11 rchlin

And the Preprocessor seemed to keep comments by default, and can not be disabled!

rchlin avatar Nov 12 '15 08:11 rchlin

CppReader behaves as a Java Reader. Preprocessor has its own lexer-like API if you want to use it directly. Keeping comments can be enabled or disabled using Feature.KEEPCOMMENTS or Feature.KEEPALLCOMMENTS. Overall documentation is available here: https://shevek.github.io/jcpp/docs/javadoc/

shevek avatar Nov 16 '15 04:11 shevek

If I use Preprocessor directly, Feature.KEEPCOMMENTS or Feature.KEEPALLCOMMENTS will not take effect and pp.token() willl always keep comments. In order to disable comments, I have to use LexerSource or CppReader.

rchlin avatar Nov 16 '15 13:11 rchlin

Please don't reuse issues for new questions. A minimal code sample would be great so reproduce your bug report.

ooxi avatar Nov 16 '15 15:11 ooxi

Re: KEEPCOMMENTS: I didn't check again, but that's probably true, but it's fairly easy to filter the returned token stream by type yourself. Filtering comments within the API is only really important if you don't have access to the token stream (and hence types), as in CppReader. I don't think LexerSource has anything to do with comments.

shevek avatar Nov 18 '15 09:11 shevek