(mm) | Java applet to unscramble C declaration | |||||||||||||||||||||
Home | Software | Count | ||||||||||||||||||||||
Software: GWT GWTOAuthLogin X/Motif ansi xterm grabc mdgclock miv mplaymidi mppp mxascii mcmap mxcmap mxconsole mxkill mxshowfont qtip xmastm yrolo Web mhttpd web counter upload.pl TimeTrack.pl mod_auth_ldap Games fltkmm iphonemm Java cdcl cdclgwt jdgclock Libraries libcalen libmcfg libsll libmsock Misc bangla font dpr genmake hod smtp.pl vhtml phones_ldap showpic_ldap mbasecalc fluid_hack kdialppp strip2csv googlecode-upload MS Windows mwinclip.pl mbasecalc mailsend wiv |
This is a java applet which can unscramble C declarations. The code to parse C declaration is translated from the C code described in K&R, 2nd edition, page 123. Here are some C declarations from K&R, page 122. Try without the applet first and see if you can unscramble them. Examples: int *f() int (*f)() char **argv int (*daytab)[13] void *comp() void (*comp)() char (*(*x())[])() char (*(*x[3])())[5]Also look at the JavaScript version of cdcl
Note: It can not handle declarations with function argument types or qualifiers like const, volatile etc. For Example: it can not handle declaration like: char * const (a[10]) (int **b) Therefore, you have to rewrite the declaration to char *(a[10]) () Rules for unscrambling
ExampleHere is an example of the above rules. Let unscramble it:char (*(*x[3])())[5] CopyrightThis applet is in the public domain. Do anything you like with it. It would be nice but not required if you give me the credit for it.If you are using this applet, please let me know. Bug reports, suggestions are always welcome!
Download
Initial release: Aug-09-1996
URL of this page: |
|||||||||||||||||||||
back | Page updated: Tue Feb 25 19:50:46 2014 GMT Copyright © 2014 muquit@muquit.com. |