[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::languages

Title:Languages
Notice:Speaking In Tongues
Moderator:TLE::TOKLAS::FELDMAN
Created:Sat Jan 25 1986
Last Modified:Thu May 22 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:394
Total number of notes:2683

141.0. "CDECL - Compose C declarations" by ARGUS::STAPLETON () Wed May 27 1987 16:00

Posted to the following conferences:

	TLE::LANGUAGES
	CAFEIN::MS_LANGUAGES
	{COLORS,MOSAIC,RAINBO,VIKING}::RAINBOW
	{COLORS,MOSAIC,RAINBO,VIKING}::VAXMATE

Feel free to post this elsewhere if you can think of other appropriate
conferences.

===============================================================================

How many times have you looked at a C program and wondered what a particular
declaration meant?  How many times have you slaved over figuring out how to
declare something in C?  Well, I have a program to help you!  This program
was obtained from MIMSY.UMD.EDU on the ARPANET by anonymous FTP, as a result
of seeing it mentioned in a USENET news article.

An example of what CDECL does:

    If you enter:
	declare fptab as array of pointer to function returning pointer to char
    CDECL will type out:
	char *(*fptab[])()

    If you enter:
	explain char *(*fptab[])()
    CDECL will type out:
	declare fptab as array of pointer to function returning pointer to char

Listed below is where you can get the files for either a VMS version or an
MS-DOS version of CDECL.

===============================================================================

		    ARGUS::DISK$USER:[STAPLETON.xxxxx]

For VMS		For MS-DOS	Comment................................

[.VDECL]	[.MDECL]

CDECL.1;1    =	CDECL.1;1	Unformatted MAN page
CDECL.DOC;1  =	CDECL.DOC;1	Formatted MAN page from local Ultrix-32m system
CDECL.EXE;1	CDECL.EXE;1	Executble for specific system
CDGRAM.C;2			Modified to work on VMS
CDGRAM.C;1   =	CDGRAM.C;1	Generated by YACC on local Ultrix-32m system
CDGRAM.Y;1   =	CDGRAM.Y;1	Input for CDGRAM.C
CDLEX.C;2	CDLEX.C;2	Modified for VMS and MS-DOS
CDLEX.C;1    =	CDLEX.C;1	Generated by LEX on local Ultrix-32m system
CDLEX.L;1    =	CDLEX.L;1	Input for CDLEX.C
CDSUPP.C;1   =	CDSUPP.C;1	Support functions for final program
MAKEFILE.;1  =	MAKEFILE.;1	Make file to erect CDECL

===============================================================================

The files with an equal sign between them are identical.  CDGRAM.C had to be
modified only for VMS.  The files in the original distribution are:

	Makefile, cdecl.1, cdgram.y, cdlex.l, and cdsupp.c

The rest of the files were generated on various local systems as noted above.

    Enjoy

	JTS/hs
T.RTitleUserPersonal
Name
DateLines
141.1Please put in the ToolShedAKQJ10::YARBROUGHWhy is computing so labor intensive?Thu May 28 1987 12:514
Sounds ideal for the Software Tools Clearinghouse. Please contact 
METOO::TOOLSHED for details. (METOO=57643, as of a short time ago.)

Lynn Yarbrough 
141.2Half a loafDENTON::AMARTINAlan H. MartinThu May 28 1987 15:395
Re .0:

Note that this program does not handle the type specifier void or
declarations containing function prototypes.
				/AHM
141.3ARGUS::STAPLETONThu May 28 1987 17:056
    Re: .1 - Feel free to copy it!
    Re: .2 - I don't know squat about writing compilers, lexical scanners,
    etc.  If you are willing to modify CDECL, I will rebuild it and
    offer the new version to the net.
    
    	JTS/hs
141.4Digital has it now!TLE::RMEYERSRandy MeyersThu May 28 1987 17:435
Re: .0

The program is a bit redundant for users of VAX C.  If you compile
your programs /LIST/SHOW=SYMBOLS, the listing file demystifies all
the declarations in the program.
141.5ARGUS::STAPLETONFri May 29 1987 14:2912
    Re: .4
    
    Thanks for the tip about /LIST/SHOW=SYMBOLS.  I didn't know about
    it, but that only makes CDECL half redundant.  CDECL is still useful
    for translating english into C as in:
    
    	declare foo as etc...
    
    CDECL also does casts.  Is there a way of getting VAX C to explain
    complex casts?
    
    	JTS/hs
141.6LSE Extension?JHEREG::TANNENBAUMTPU DeveloperSat May 30 1987 19:553
    Is CDECL callable?  It might be interesting to mix it with LSE...
    
    	- Barry