Author Topic: SlickEdit C/C++ parser fails to process "(A[i])++;" (needed for refactoring)  (Read 6645 times)

Musenka

  • Community Member
  • Posts: 13
  • Hero Points: 0
Hello.
I discovered that built-in SlickEdit C/C++ parser fails to process code like "(A[ii])++;" ("int * A; int ii;"). Parsing is needed to perform code refactoring. So code refactoring refuses to work because of parsing errors.
I used such code constructions with MS Visual C++ (Win) and GNU C++ (Linux) compilers without any problems (no errors, no warnings). So the source code is OK, although maybe it looks "strange".
Is there any way to solve the problem (perform code refactoring, maybe with parsing errors) without changing the source code?
Of course, it would be nice to completely remove all parsing errors and make 100% clean refactoring :)... but is that possible?

« Last Edit: March 26, 2008, 02:51:40 PM by Musenka »

Musenka

  • Community Member
  • Posts: 13
  • Hero Points: 0
So, nobody uses
Code: [Select]
(A[i])++ construction? Maybe I should write to their product support and report this problem...

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347

Quote
Is there any way to solve the problem (perform code refactoring, maybe with parsing errors) without changing the source code?

If the number of parsing errors you're getting is small, you might be able to use conditional compilation (unless you consider that "changing the source") based on a #define that is "defined" only in slick's C++ pre-processor macro list.

Graeme


Musenka

  • Community Member
  • Posts: 13
  • Hero Points: 0
Thank you for your advice, we will consider this way.
And maybe this problem is already successfully solved in SlickEdit 2008?
Does anybody know? Can anybody help with checking that?

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Thank you for your advice, we will consider this way.
And maybe this problem is already successfully solved in SlickEdit 2008?
Does anybody know? Can anybody help with checking that?

Unfortunately. most of C++ refactoring has been removed from SlickEdit 2008 and is no longer supported  - all that's left is "quick refactoring" which is the same as SE2007 quick refactoring.   It apparently uses the tagging engine to find symbols so it's not possible to tell if the problem has been fixed in SE2008.  I guess it was too much work to support, with C++ being so complex.

You can get a refactoring tool here http://www.xref-tech.com/xrefactory/main.html which uses the EDG front end, so I'm sure it will handle anything you come up with, but it requires emacs and it's kind of expensive -  costs more than SlickEdit.  Also there's a free refactoring add-on for Visual Studio here http://www.devexpress.com/Products/NET/IDETools/RefactorCPP/.

Graeme
« Last Edit: March 29, 2008, 08:07:50 AM by Graeme »

Musenka

  • Community Member
  • Posts: 13
  • Hero Points: 0
I have downloaded SlickEdit 2008 trial version... And you are quite right  :(
Refactoring is dead. Refactor!, XRef, etc are not compatible with SlickEdit. They are even not compatible with command line (console). Only MS Visual Studio is supported... That is bad.
But thank you for the information!