Tools for C code refactoring [closed] - c

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
What tools are there that supports refactoring C code (renaming variables, extracting methods, finding method references, ...)
Preferably for a Linux environment, but Windows tools are ok too.
If there's something available for emacs, even better!

Netbeans 6.7 and above have reasonably decent basic C (and possibly C++, but haven't tried it) refactoring. I use it when doing the JNI part of one of my projects, and stuff like renaming vars, macros, functions, finding usages of a function all work well. Definitely worth a try, to see if it does the rest of what you want, if you're not wedded to emacs yet.
For emacs, there is xrefactory but I haven't tried it myself.

I use Eclipse with CDT as an IDE and find that it works well for refactoring and searching code.

Old, but not bad is cscope and the GUI frontend kscope.

Qt Creator is very fast and useful IDE. It's not only for Qt Framework. You can use it for C and pure C++ projects too. Also it have many refactoring features. It's cross-platform and have vi emulation too. For refactoring features please refer it's documentation.

Slickedit is good at refactoring.

Maybe this previous question could help, at least in speeding up the compile-run cycle.
Fast compiling (or maybe more apt, fast lexical analysis) is one of the things needed to create a system supportive of refactoring.

This article discusses some C++ refactoring tools for Visual Studio.

Related

C syntax parser [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Are there any libs out there that can parse C syntax?
For example I would like to write my own code/scripts that will analyze c files given the c syntax. Number of "if" statements per function/file, lines of comments per lines of code in a function and so on.....
I have no problem writing all this custom code just wanted to make the job easier if there was already some lib that I can use to jump start instead of starting with the parser.
Thanks!
Besides the clang suggestion already made, consider pycparser and Boost.Wave.
Although they are more targeted at semantical analyses rather than syntactical ones, you might be interested in CIL and Frama-C, which is based on it (both in OCaml). Another tool (OCaml and Python bindings) of interest is Coccinelle.
Personally, I would look first for an existing tool to do what you want. This sounds like an awful lot of work and there are a lot of good free tools out there for code metrics (did you look on SourceForge?).
If you insist on going ahead with your project, you might google for Lex/Yacc grammars for C.
However, I switched from Lex/Yacc a few years ago to Antlr. I particularly like the way it allows you visually step through your parsing.
A great tool, and free. There is a complete grammar for C available too, so you can modify that to suit your needs.
Hope this helps. Good Luck
you might also consider trying a code coverage tool. although code coverage is meant to show you how much percent of the source code is executed but some of them also show how many conditional statements or loops it encountered whilst doing code coverage. One example that I can share based on my experience is windriver workbench code coverage tool

Learn C for programmers [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I would like to learn how to work with C,
The things I have problems with are compilation and makefiles, not so much the C syntax. Most books deal mostly with the language, but what I'm looking for is more the other parts. What IDE and compiler do I use, and how do I use these.
Thank you very much!
I would recommend gcc for the compiler and just a normal text editor for the ide. Compilation and working with makefiles is relatively simple, you could learn all you want by just googling it. I started out with vi and gcc. Now I use eclipse, netbeans, and gedit for when I am using c/c++.
If you are looking at strictly C, than there is nothing probably better on a nix system than Vim and Make.
Programming isn't always easy. Struggle with it and learn.
If you don't mind more C++ than I would recommend the following:
I have also used Code::Blocks which is a free open source IDE available for *nix systems.
On Windows just use Visual C++ Express which is also free.
Both Eclipse and Netbeans have functionality to develop and build C programs.
There's lots of tutorials e.g. Getting Started With the NetBeans C/C++
Much depends of the OS you actually use to compile. Really IDE and Makefiles are not C related and there is books about them. I would suggest to try a minimalist environment (any text editor and compiling from command line) to understand what is under the hood, then go for a full featured IDE.
Use gcc, write a Makefile for every project you make (even a small hello world program), and use gdb to debug. As for editing code, use whatever you enjoy typing in.

Beginners' guide for setting up Emacs with gcc/gdb? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I looked around the GNU emacs material and didn't find anything helpful.
Does anyone know of a good tutorial for setting up emacs, to basically turn it into an IDE? I'm looking for interfacing with gcc/gdb/make, etc...
Like other answers mentioned, M-x compile, M-x gdb will get you going. While debugging, I'd also suggest gdb-many-windows-mode, which makes Emacs look a bit closer to IDE when debugging.
Besides that and to get closer to "IDE-like features", you can look at:
CEDET http://cedet.sourceforge.net/ for code completion and project support. Excellent tutorial at http://xtalk.msk.su/~ott/en/writings/emacs-devenv/EmacsCedet.html .
If you don't mind using non-free software, Xrefactory (http://www.xref.sk/xrefactory/main.html) is probably the best (well, the only) refactoring tool. The C version is free, the C++ is not.
Yuval, you're probably being misled by looking for something about IDEs. All that stuff is automagically built into EMACS except for the CScope-like searching stuff.
M-x compile runs make by default, although I reset it to run Ant in java mode.
M-x gdb runs gdb
C-x ` (Ctrl-X backquote) goes to the next compile error
and so on.
Go dig about in the EMACS Wiki. Lots of good stuff. The Programming Category is where you should look.
Good Article
Look at CScope too... you just have to add two lines to your .emacs to be able to navigate through definitions and references
Even though not directly related to C/C++ i find that using a good color scheme is important. Try:
M-x color-theme-select
and you can browse around a lot of different setups if you do not want to create your own.
If you're working with version control system, you can find useful information in another my article about work with version control systems from emacs

Is there a Windows IDE that can handle both C and Perl? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm using Strawberry Perl which includes MinGW's GCC, I'm also making use of the GNU debugger GDB and Subversion. How can I have a single development environment that would suit this (other than just UltraEdit, the command shell and IE), and how can I further enhance its features?
I'd have a good look at Eclipse if I were you! Then have a look at the EPIC IDE Plug-in.
Subversion integrates quite nicely with that IDE via Tortoise SVN or even better as mentioned in one of the comments by Davide Gualano, Subversive.
Personally i'm using Komodo IDE from ActiveState. Komodo Edit might suit your needs and is its free alternative.
You can use emacs for windows.
http://www.gnu.org/software/emacs/windows/ntemacs.html
Have you tried Notepad++? It's mostly an "all stops pulled out" text editor with code highlighting for every language you can think of. But, it does have a pretty amazing macro / external command / extension thing, so hooking it up to a compiler is pretty easy.
I'm currently using it for C, Inform, Python, Perl, HTML, and VB.Net, with surprisingly few issues when shifting gears.
Also, FOSS.
(and, I've just discovered that it has code completion as well. Excellent!)
msvc 6 will do the job quite nicely.
my perl is installed at c:\perl\bin so...
under the custom menu, create a new tool.
command c:\perl\bin\perl.exe
arguments -w $(FileName)$(FileExt)
initial directory $(FileDir)
check the Use Output Window.
create a button on your tool bar, to run the tool.
The perl output will come out in the output window.
I'm no Windows developer or IDE user by a long shot, but the combination of Cygwin (for all the handy Unix tools and a better shell) and emacs does the job when I have to work on Windows.
Personally, I'm happily using SciTE for C, C++, Perl and Python development on Windows. Using a single tool has a lot of advantages for me - as becoming expert in it improves my productivity in all languages. SciTE has a built-in scripting language, and is also quite easy to combine it with external scripting, so it's extensible beyond imagination - and that using quite standard tools.

IDE for C application development that you admire most [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I am looking for a good Integrated development environment for developing applictaions in C language for both windows and linux.
IDE should have:
good interface,
easy file management,
auto filling and
any advanced options.
Tell me which IDE you most admire for these tasks
For general PC application development
For embedded application development in C
If you think it is more specific question then you may also take it as a general case.
Thanks in advance.
For general PC development - Microsoft Visual Studio + VisualAssist
For large-scale development you can hardly find anything better than Source Insight
If you need a cross-platform IDE have a look at Eclipse CDT
For both purposes I'd suggest Eclipse.
I'd describe Visual Studio as the most feature rich and comfortable place to be when writing and debugging code, but it has a narrow target audience - Windows developers.
As others have said, Eclipse is probably your best bet, The large array of available plugins come in handy too. For example, if you want to move to a new source code repository, the chances are there's an Eclipse plugin already written for it. You don't have that luxury with most other IDEs.
Well when I'm working with C I use Vim, with the right plugins I find it to be the best IDE for C around. It takes a little bit of practice to get used to it but once you do you'll just be flying around your files.
Apart from TextMate on OS X which is more a very featurefull text editor, I'd say NetBeans or Eclipse.
EDIT: yes, if you have a mac, you can do PC development with VMWare/Paralles as easily as you would in a "real" PC and you get OS X as a bonus.
I'd say Eclipse is the best choice.
Eclipse page
Check out Code::Blocks, it's pretty good, does C, and is available for Windows and Linux as requested.
Even if it was developed for JAVA first, I like the NetBeans IDE because it has some nice features and it knows about C, too.
CVS/SVN Plugins are available.
SlickEdit is nice cross-platform IDE with autocomplition, macroses, various text editors emulation mode, refactoring capabilities etc... Commercial though.
There's some good advice on C IDEs here as well: C on Visual Studio
I asked about using C in Visual Studio but the answers contain suggestions on a variety of IDEs

Resources