![]() |
| | #1 |
| Frequently Quite Prolix Join Date: Apr 2005 Location: Canada
Posts: 7,629
| codeform version 1.2.0 #2 Codeform's main page: http://dwks.theprogrammingsite.com/myprogs/codeform.htm Direct download link: http://dwks.theprogrammingsite.com/m...n/codeform.zip "clip" download link (Windows clipboard utilities): http://dwks.theprogrammingsite.com/m.../down/clip.zip Since the other threads were sadly lost in the recent presumed board restore from a backup, I'm starting another codeform thread. With good reason. Here is a list of the things I have done in the past two days:
HOWTO.txt is sort of out of date. I want to add Perl support (a rather large undertaking, don't expect it within days ).Also see the TODO list for other things that I still need to do: Code: /*-------------------------------------------*\
| TODO list for future versions of codeform |
\*-------------------------------------------*/
Short-term
- ? Optimise rule searching by looking in the previous position first
- Add support for "\n" and "\param" in specific comments ("" and /*! */)
- Make a "function" rule: \w+\s+\(
- ? Don't print closing tags for same-coloured nested comments
- Provide a default rules directory that is searched first
- Make "escaped newline" (\) character specifiable
- Don't count #es in #defines as new comments;
don't allow nestcoms to include themselves
[done] - Allow multiple prev pointers!
[done] - free static variables in add_rule()
Long-term
- Make input, output and styles rules files separate
Distant long-term
- Support indent-style code beautifying
Codeform online still isn't working. Any ideas? How can I run a program as a restricted user from a priviledged Perl script?
__________________ dwk Seek and ye shall find. quaere et invenies. "Simplicity does not precede complexity, but follows it." -- Alan Perlis "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra "The only real mistake is the one from which we learn nothing." -- John Powell Other boards: DaniWeb, TPS Unofficial Wiki FAQ: cpwiki.sf.net My website: http://dwks.theprogrammingsite.com/ Projects: codeform, xuni, atlantis, etc. New project: nort Last edited by dwks; 03-23-2007 at 05:55 PM. |
| dwks is offline | |
| | #2 |
| Registered User Join Date: Dec 2002
Posts: 409
| Would you like me to put the win api list back up? |
| kryptkat is offline | |
| | #3 |
| Frequently Quite Prolix Join Date: Apr 2005 Location: Canada
Posts: 7,629
| Sure. Or you could create the codeform rules files yourself if you're feeling up to it. ![]() Perhaps something like this: Code: =keyword keyworddarkb= keyworddarka= auto:$(keyworddarkb):$(keyworddarka) bool:*:* break:*:* case:*:* ... Code: #!/usr/bin/perl
print "=keyword\n\nkeyworddarkb=\nkeyworddarka=\n\n";
chomp($l = <>);
print "$l:\$(keyworddarkb):\$(keyworddarka)\n";
while(<>) {
chomp;
print "$_:*:*\n";
}
__________________ dwk Seek and ye shall find. quaere et invenies. "Simplicity does not precede complexity, but follows it." -- Alan Perlis "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra "The only real mistake is the one from which we learn nothing." -- John Powell Other boards: DaniWeb, TPS Unofficial Wiki FAQ: cpwiki.sf.net My website: http://dwks.theprogrammingsite.com/ Projects: codeform, xuni, atlantis, etc. New project: nort Last edited by dwks; 03-23-2007 at 06:18 PM. |
| dwks is offline | |
| | #4 |
| Registered User Join Date: Dec 2002
Posts: 409
| Code: =keyword keyworddarkb= keyworddarka= auto:$(keyworddarkb):$(keyworddarka) bool:*:* break:*:* case:*:* ... Code: #!/usr/bin/perl
print "=keyword\n\nkeyworddarkb=\nkeyworddarka=\n\n";
$l = <>;
print "$l:$(keyworddarkb):$(keyworddarka)\n"
while(<>) {
print "$_:*:*\n";
}
|
| kryptkat is offline | |
| | #5 |
| Frequently Quite Prolix Join Date: Apr 2005 Location: Canada
Posts: 7,629
| I'll run it for you then. (It's a Perl interpreter BTW.) Post the list (as an attachment!) if you have it handy. If not, I'll start looking . . . .
__________________ dwk Seek and ye shall find. quaere et invenies. "Simplicity does not precede complexity, but follows it." -- Alan Perlis "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra "The only real mistake is the one from which we learn nothing." -- John Powell Other boards: DaniWeb, TPS Unofficial Wiki FAQ: cpwiki.sf.net My website: http://dwks.theprogrammingsite.com/ Projects: codeform, xuni, atlantis, etc. New project: nort |
| dwks is offline | |
| | #6 |
| Registered User Join Date: Dec 2002
Posts: 409
| put it all on one file.txt note to self.... dx9 and gdi need to add |
| kryptkat is offline | |
| | #7 |
| Frequently Quite Prolix Join Date: Apr 2005 Location: Canada
Posts: 7,629
| Here it is . . . generated by this: Code: #!/usr/bin/perl
print "=keyword\n\nkeyworddarkb=\nkeyworddarka=\n\n";
chomp($l = <>);
$l =~ s/\s*\(?\s*$//;
print "$l:\$(keyworddarkb):\$(keyworddarka)\n";
while($l = <>) {
chomp($l);
$l =~ s/\(?\s*$//;
if($l =~ /\/\*(.*)\*\// || $l =~ /(. Functions)/) {
print "# $1\n";
}
elsif($l ne '') {
print "$l:*:*\n";
}
}
Code: $ ./codeform -f rules/cpp_vbb_1 -f rules/winapi ... ![]() [edit] Stupid attachments. You can't have a file with no extension . . . remove the .txt. [/edit]
__________________ dwk Seek and ye shall find. quaere et invenies. "Simplicity does not precede complexity, but follows it." -- Alan Perlis "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra "The only real mistake is the one from which we learn nothing." -- John Powell Other boards: DaniWeb, TPS Unofficial Wiki FAQ: cpwiki.sf.net My website: http://dwks.theprogrammingsite.com/ Projects: codeform, xuni, atlantis, etc. New project: nort Last edited by dwks; 03-23-2007 at 07:00 PM. |
| dwks is offline | |
| | #9 |
| Registered User Join Date: Dec 2002
Posts: 409
| tested it. it hangs. let it run all night just to see if it was slow or not working. 9pm to 7:30am is enough time to know that it crashed. first thought colins on math functions second thought two rule files third thought comments in file. fourth thought perl script messed up fifth thought multiple references of the same functions manually edit win api file retry with manually made rule file. other thoughts as to why it crashed? [edit] how large of .c file can it handle? [/edit] Last edited by kryptkat; 03-24-2007 at 05:26 AM. |
| kryptkat is offline | |
| | #10 |
| Registered User Join Date: Dec 2002
Posts: 409
| care to try that again? here is the list sorted with the duplicates removed and the comments removed. it is ready for a perl script to turn it to a winapi rule file. note there is gdi in there hbitmap and bitblit i think all of it . |
| kryptkat is offline | |
| | #11 | ||
| Frequently Quite Prolix Join Date: Apr 2005 Location: Canada
Posts: 7,629
| Quote:
Comments in file beginning with '#' are fine -- "/**/" comments are not. I think I got rid of them though. The Perl script may well have messed up. ![]() Multiple functions of the same name would cause the duplicates to be ignored (only the first one counts). Quote:
I expect the problems you encountered were due to a bug in the codeform I uploaded . . . I've re-uploaded it again, having done the following changes last night (it was a late night...):
Valgrind now reports no memory leaks for codeform! Even for rules/c_1_css. But it does report "invalid read"s, whatever that is. (Enlighten me?) I will indeed re-create the winapi file and test it this time (I'm on the right computer). I'll report back in a few minutes.
__________________ dwk Seek and ye shall find. quaere et invenies. "Simplicity does not precede complexity, but follows it." -- Alan Perlis "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra "The only real mistake is the one from which we learn nothing." -- John Powell Other boards: DaniWeb, TPS Unofficial Wiki FAQ: cpwiki.sf.net My website: http://dwks.theprogrammingsite.com/ Projects: codeform, xuni, atlantis, etc. New project: nort | ||
| dwks is offline | |
| | #12 |
| Frequently Quite Prolix Join Date: Apr 2005 Location: Canada
Posts: 7,629
| Okay, download the latest version; rules/winapi is included in it. I tested it with this command line and it worked: Code: C:\>codeform -f rules\_html -f rules\c_1ext -f rules\winapi rules\winapi ![]() [edit] For nicer colours try Code: C:\>codeform -f rules\_html -f rules\c_1 -f rules\winapi rules\winapi Code: =keyword keyworddarkb= keyworddarka= AbnormalTermination:$(keyworddarkb):$(keyworddarka) AbortDoc:*:* AbortPath:*:* AbortPrinter:*:* AbortProc:*:* ABORTPROC:*:* AbortSystemShutdown:*:* accept:*:* AcceptEx:*:* AccessNtmsLibraryDoor:*:* ACMDRIVERENUMCB:*:* ACMDRIVERPROC:*:* ACMFILTERCHOOSEHOOKPROC:*:* ACMFILTERENUMCB:*:* ACMFILTERTAGENUMCB:*:* ACMFORMATCHOOSEHOOKPROC:*:* ACMFORMATENUMCB:*:* ACMFORMATTAGENUMCB:*:* ...etc... The executable included in the .ZIP is not compiled with my normal compiler but it should still work. The linux executable included is ancient. If you're using linux just compile it yourself. Type "make clean" and then "make".
__________________ dwk Seek and ye shall find. quaere et invenies. "Simplicity does not precede complexity, but follows it." -- Alan Perlis "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra "The only real mistake is the one from which we learn nothing." -- John Powell Other boards: DaniWeb, TPS Unofficial Wiki FAQ: cpwiki.sf.net My website: http://dwks.theprogrammingsite.com/ Projects: codeform, xuni, atlantis, etc. New project: nort Last edited by dwks; 03-24-2007 at 02:09 PM. |
| dwks is offline | |
| | #13 | |
| Registered User Join Date: Dec 2002
Posts: 409
| Quote:
was looking over your changes....good to know. i do not have linux. the winapi file is large and i hope it will add to the progs popularity. it has helped fix a few progs already. if i had realized you were going to run it through a prog to make the rule file i would have plucked cleaned stuffed and baked the file in the first place. thank you. | |
| kryptkat is offline | |
| | #14 | |
| Frequently Quite Prolix Join Date: Apr 2005 Location: Canada
Posts: 7,629
| I used another Perl program that basically takes codeform.c and copies it 100 times into another file. Here are the results: Code: timeit: 14285 ms
Volume in drive [edited]
Volume Serial Number is [edited]
Directory of [edited]
24/03/2007 03:59 PM 7,098,100 bigfile
24/03/2007 03:59 PM 20,343,374 bigfile.htm
2 File(s) 27,441,474 bytes
0 Dir(s) 56,410,112 bytes free
A 7MB file was processed in 14.3 seconds (admittedly, it was in the background but this is a really fast computer).Quote:
All I did was write a program to parse it and tested and uploaded it . . . you did all of the work.Sorry that the change list is not very legible. I wrote it as I was coding and never intended to put it on the internet or anything.
__________________ dwk Seek and ye shall find. quaere et invenies. "Simplicity does not precede complexity, but follows it." -- Alan Perlis "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra "The only real mistake is the one from which we learn nothing." -- John Powell Other boards: DaniWeb, TPS Unofficial Wiki FAQ: cpwiki.sf.net My website: http://dwks.theprogrammingsite.com/ Projects: codeform, xuni, atlantis, etc. New project: nort | |
| dwks is offline | |
| | #15 |
| Woof, woof! Join Date: Mar 2007 Location: Australia
Posts: 3,139
| DWKS, perhaps look into the <pre></pre> tags and keep tabs?, Rather than converting them to spaces...? Think about it, its an extra 3 bytes per tab... It all adds up. Not to mention it makes the highlighted source easier to "cut & paste" while keeping its original formatting. Anywho just thought i'd comment. |
| zacs7 is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| No Version info tab in file properties? | cpjust | Windows Programming | 2 | 06-03-2008 03:42 PM |
| How to set File Version of VC++ 6 dll | mercury529 | Windows Programming | 3 | 12-08-2006 02:49 PM |
| Finding the windows version... | The_Muffin_Man | Windows Programming | 1 | 06-10-2004 11:39 PM |
| Dev C++ Version 5 | Zoalord | C++ Programming | 3 | 08-30-2003 01:56 PM |
| Problem building Quake source | Silvercord | Game Programming | 14 | 01-25-2003 10:01 PM |