Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Underline if();
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mmb
Senior Member

42 Posts

Posted - Jul 05 2006 :  07:45:47 AM  Show Profile  Reply with Quote
Some of the supiest error one ahve to find in a C-like language is a forgotten ';' after an 'if' like this

if (bla);
...

I would bet such a code is in 99,9 percent of all cases simply wrong
but sometimes really hard to find.
Simply underline such constructs (maybe add an option to switch this on).
When adding an option you could also add an option to underline
while(); and for(); although these construct do happen but sometimes
are as bad as the if...

bugfix
Tomato Guru

Germany
324 Posts

Posted - Jul 05 2006 :  09:34:45 AM  Show Profile  Reply with Quote
In vs.net you can search w/ regular expressions for such kind of stuff.
Out of my mind it should look smth like
(if|for|while)[\\t ]*\\(.*\\)[\\t ]*;

Another common typo is if(bla = blub) instead of if(bla == blub)

http://www.mf-sd.de
Go to Top of Page

mmb
Senior Member

42 Posts

Posted - Jul 05 2006 :  2:56:45 PM  Show Profile  Reply with Quote
I'm sorry to say that it is not possible to detect this kind of errors using regular expressions. Context free grammars would be needed to detect all possible if's. But this is not the point:

This kind of errors are often difficult to detect but depending on the parse tree that is generated by VA easily to underline.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jul 06 2006 :  5:37:24 PM  Show Profile  Reply with Quote
mmb which IDE are you using? i know that VS2005 can produce some fairly reasonable warnings / errors when i make a typo.

some of the time you can tell you have made a typo because local variables or function calls are not coloured correctly.

it would be reasonable to think VA could detect this, i am just concerned about entering the world of static code analysis, since that is a whole new product.

zen is the art of being at one with the two'ness
Go to Top of Page

mmb
Senior Member

42 Posts

Posted - Jul 06 2006 :  6:03:59 PM  Show Profile  Reply with Quote
feline: It's true that VC2005 produces the right warning C4390. The VC6 compiler is silent here. We use both IDE's (VC6 used less resources in a virtual machine).
Sorryly I'm sometimes called by students that typically ignore all warnings to "look, I do it all right but it did not work". So, this feature would save me some walking

An the other hand, how would you call "enhanced coloring" if not static analysis?

Go to Top of Page

Admin
Whole Tomato Software

USA
74 Posts

Posted - Jul 06 2006 :  7:46:57 PM  Show Profile  Reply with Quote
You present some interesting ideas but we're far from implementing them at this point. Our lists of things to do are quite long.

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jul 08 2006 :  2:00:00 PM  Show Profile  Reply with Quote
by static code analysis i was thinking more along the lines of LINT, which is where people will want us to end up if we are not careful

http://www.gimpel.com/

as for the students, something tells me that if they ignore compiler warnings they will also ignore more colouring on the screen *rolls eyes*

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000