If else block C code


 
Thread Tools Search this Thread
Top Forums Programming If else block C code
# 1  
Old 01-12-2017
If else block C code

Hi,

We have hundreds of c codes for which we need to identify and analyse all the if , nested if and while conditions used in code.. is thr any tool to do that. All we is like index (like 1.2.1.3 in case of nested if)and the corresponding code (may be wrriten in a table/file).

Thanks..!
# 2  
Old 01-12-2017
Dear anijan,

I have a few to questions pose in response first:-
  • What have you tried so far?
  • What output/errors do you get?
  • What OS and version are you using?
  • What are your preferred tools? (C, shell, perl, awk, etc.)
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)
Most importantly, What have you tried so far?

There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.


We're all here to learn and getting the relevant information will help us all.
# 3  
Old 01-12-2017
Are you after some kind of static measure for code complexity?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Add a block of code at the end of a specific block

I need to search for a block with the starting pattern say "tabId": "table_1", and ending pattern say "]" and then add a few lines before "]" "block1":"block_111" "tabId": "table_1", "title":"My title" ..... .... }] how do I achieve it using awk and sed. Thanks, Lakshmi (3 Replies)
Discussion started by: Lakshmikumari
3 Replies

2. Shell Programming and Scripting

Commenting a block of code in xml where the tags may be similar

I want to comment a block of code in xml. Note that the tags will be similar. In the below xml code, I want to block the listener block for com.pkg1.class2. How do i do it ? Thanks in Advance <listener> <listener-class>com.pkg1.class1</listener-class> </listener> ......... <listener>... (4 Replies)
Discussion started by: Lakshmikumari
4 Replies

3. Shell Programming and Scripting

Printing a block of lines from a file, if that block does not contain two patterns using sed

I want to process a file block by block using sed, and if that block does not contain two patterns, then that complete block has to be printed. See below for the example data. ................................server 1............................... running process 1 running... (8 Replies)
Discussion started by: Kesavan
8 Replies

4. UNIX for Advanced & Expert Users

Move a block of lines to file if string found in the block.

I have a "main" file which has blocks of data for each user defined by tags BEGIN and END. BEGIN ID_NUM:24879 USER:abc123 HOW:47M CMD1:xyz1 CMD2:arp2 STATE:active PROCESS:id60 END BEGIN ID_NUM:24880 USER:def123 HOW:4M CMD1:xyz1 CMD2:xyz2 STATE:running PROCESS:id64 END (7 Replies)
Discussion started by: grep_me
7 Replies

5. Shell Programming and Scripting

Block of code replacement in Java source code through Unix script

Hi, I want to remove the following code from Source files (or replace the code with empty.) from all the source files in given directory. finally { if (null != hibernateSession && hibernateSession.isOpen()) { //hibernateSession.close(); } } It would be great if the script has... (2 Replies)
Discussion started by: hareeshram
2 Replies

6. UNIX for Dummies Questions & Answers

How to write code inside ssh block in shell?

Hi, I am new to shell script. I am trying to code on shell script but not able to find the correct syntax to write the code once it comes inside ssh. For eg: ssh -q HOST " SwapInUse=\`vmstat -nm | (while read; do echo "$(date +%Y%m%d.%H%M%S) $REPLY"; done) | tail -n +3 | awk '{print... (5 Replies)
Discussion started by: Yagami
5 Replies

7. UNIX and Linux Applications

Commenting out block of code in emacs in python mode

Hi, I am not sure if this is the right forum to post an emacs question, but if you could point me to an appropriate emacs forum that would be useful too. Anyway, here is the description of the problem: I usually develop python code with emacs, emacs being in python code. On my desktop a... (0 Replies)
Discussion started by: alex57326
0 Replies

8. Programming

Explain a block of code:

Hi, I have this block in a code and I need to know it's meaning: bool selectEvents = config.get("selectEvents",false); if (selectEvents) { ifstream in("events"); while (in) { int run, evt; in >> run >> evt; if (in.eof()) break; ... (5 Replies)
Discussion started by: eager2no
5 Replies

9. Shell Programming and Scripting

FTP inside a block of code

I need help on the code below. I am getting a compile error syntax error at line 283 : `<<' unmatched Looks like it doesn't like the << on the ftp line below. If I ran the code outside of this block everything work fine, but when I put in a block of code or in a function, I got syntax error. I... (1 Reply)
Discussion started by: leemjesse
1 Replies
Login or Register to Ask a Question