Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any tutorials on this project? #31

Open
rchlin opened this issue Nov 11, 2015 · 5 comments
Open

Any tutorials on this project? #31

rchlin opened this issue Nov 11, 2015 · 5 comments

Comments

@rchlin
Copy link

rchlin commented Nov 11, 2015

There is no wiki either.

@rchlin
Copy link
Author

rchlin commented Nov 12, 2015

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

@shevek
Copy link
Owner

shevek commented Nov 16, 2015

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/

@rchlin
Copy link
Author

rchlin commented Nov 16, 2015

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.

@ooxi
Copy link

ooxi commented Nov 16, 2015

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

@shevek
Copy link
Owner

shevek commented Nov 18, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants