Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Can't generate AST correctly when parsing a C source code(written on Windows) under Linux(This is caused by the different EOL under Linux and Windows)
Can't generate AST correctly when parsing a C source code(written on Windows) under Linux [message #904220] Tue, 28 August 2012 03:03
Jason Qiang is currently offline Jason QiangFriend
Messages: 1
Registered: August 2012
Junior Member
I have a C source code which is written in Windows EOL: '\r\n'.
When I want to get the AST under Linux in my plug-in project like this:
IASTTranslationUnit tu = xxx.getASTTranslationUnit(cEditor);
tu.accept(myVisitor);

I can only get the top function declaration from my visitor.
But if I replace all '\r\n' with '\r', i will get the right AST.

My question is:
Can I handle this with some extra CDT flags/options?
Or this situation is not supported by CDT and I have to convert it in some other ways by myself just as what i did above.
Previous Topic:Can't start Indigo
Next Topic:How to run multiple Google Test binaries in CDT C++ unit test?
Goto Forum:
  


Current Time: Wed Oct 09 03:57:22 GMT 2024

Powered by FUDForum. Page generated in 0.02865 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top