By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,678 Members | 1,150 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,678 IT Pros & Developers. It's quick & easy.

Utility to convert complex declarations into, well, lol, plain-text

P: n/a
Is there a utility that takes an arbitrarily complex C language
declaration, checks it validity, and breaks it down into something
more understandable.

Is there a executable version for wintel platforms?
Apr 29 '07 #1
Share this Question
Share on Google+
11 Replies


P: n/a
In article <n6********************************@4ax.com>,
nospam <no****@nospam.comwrote:
>Is there a utility that takes an arbitrarily complex C language
declaration, checks it validity, and breaks it down into something
more understandable.
You mean something like the old 'cdecl' exercise?
>Is there a executable version for wintel platforms?

You could compile it yourself.

http://linux.maruhn.com/sec/cdecl.html
--
"It is important to remember that when it comes to law, computers
never make copies, only human beings make copies. Computers are given
commands, not permission. Only people can be given permission."
-- Brad Templeton
Apr 29 '07 #2

P: n/a
nospam <no****@nospam.comwrites:
Is there a utility that takes an arbitrarily complex C language
declaration, checks it validity, and breaks it down into something
more understandable.

Is there a executable version for wintel platforms?
This is in the FAQ.

Section 18. Tools and Resources

18.1: I need: A: Look for programs (see also
question 18.16) named:

a C cross-reference cflow, cxref, calls, cscope,
generator xscope, or ixfw

a C beautifier/pretty- cb, indent, GNU indent, or
printer vgrind

a revision control or CVS, RCS, or SCCS
configuration management
tool

a C source obfuscator obfus, shroud, or opqcp
(shrouder)

a "make" dependency makedepend, or try cc -M or
generator cpp -M

tools to compute code ccount, Metre, lcount, or csize,
metrics or see URL http://www.qucis.queensu.ca/
Software-Engineering/Cmetrics.html ;
there is also a package sold
by McCabe and Associates

a C lines-of-source this can be done very
counter crudely with the standard
Unix utility wc, and
somewhat better with
grep -c ";"

a C declaration aid check volume 14 of
(cdecl) comp.sources.unix (see
question 18.16) and K&R2

a prototype generator see question 11.31

a tool to track down
malloc problems see question 18.2

a "selective" C
preprocessor see question 10.18

language translation see questions 11.31 and
tools 20.26

C verifiers (lint) see question 18.7

a C compiler! see question 18.3

(This list of tools is by no means complete; if you know of
tools not mentioned, you're welcome to contact this list's
maintainer.)

--
"I hope, some day, to learn to read.
It seems to be even harder than writing."
--Richard Heathfield
Apr 29 '07 #3

P: n/a

"Ben Pfaff" <bl*@cs.stanford.eduwrote in message
news:87************@blp.benpfaff.org...
nospam <no****@nospam.comwrites:
>Is there a utility that takes an arbitrarily complex C language
declaration, checks it validity, and breaks it down into something
more understandable.

Is there a executable version for wintel platforms?

This is in the FAQ.

Section 18. Tools and Resources
What he wants is something like

input:
y = 1/((x + 1) * ( x + 2) + 3);
output:
y = (x+1) * (x+2);
y += 3;
y = 1/y;

Now the snag is more obvious. We need to insert a test before line 3.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Apr 29 '07 #4

P: n/a
"Malcolm McLean" <re*******@btinternet.comwrites:
"Ben Pfaff" <bl*@cs.stanford.eduwrote in message
news:87************@blp.benpfaff.org...
>nospam <no****@nospam.comwrites:
>>Is there a utility that takes an arbitrarily complex C language
declaration, checks it validity, and breaks it down into something
more understandable.

Is there a executable version for wintel platforms?

This is in the FAQ.

Section 18. Tools and Resources
What he wants is something like

input:
y = 1/((x + 1) * ( x + 2) + 3);
output:
y = (x+1) * (x+2);
y += 3;
y = 1/y;

Now the snag is more obvious. We need to insert a test before line 3.
He asked about declarations, not statements.

Your guess about what he actually wants may well be correct, but if so
then he also needs to understand the terminology.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Apr 29 '07 #5

P: n/a
On Sat, 28 Apr 2007 18:42:33 -0700, Ben Pfaff <bl*@cs.stanford.edu>
wrote:
>nospam <no****@nospam.comwrites:
>Is there a utility that takes an arbitrarily complex C language
declaration, checks it validity, and breaks it down into something
more understandable.

Is there a executable version for wintel platforms?

This is in the FAQ.

Section 18. Tools and Resources

18.1: I need: A: Look for programs (see also
question 18.16) named:
> (This list of tools is by no means complete; if you know of
tools not mentioned, you're welcome to contact this list's
maintainer.)
And some of my favorites:

18.1: I need: A: Look for programs
named:

A static source A. PC-lint,
code analyzer. http://www.gimpel.com/

A code coverage A. BullseyeCoverage,
tool. http://www.bullseye.com/

A diff utility. A. BeyondCompare,
http://www.scootersoftware.com/

Best regards
--
jay
Apr 29 '07 #6

P: n/a
In article <ur******************************@bt.com>,
Malcolm McLean <re*******@btinternet.comwrote:
>input:
y = 1/((x + 1) * ( x + 2) + 3);
output:
y = (x+1) * (x+2);
y += 3;
y = 1/y;

Now the snag is more obvious. We need to insert a test before line 3.
Under what conditions would you expect the test to fail?
dave

--
Dave Vandervies dj******@csclub.uwaterloo.ca
From that simple premise, you have managed to demonstrate that, in the lab in
which I had chemistry classes about 25 years ago, the teacher's lab stool was
intelligent. --Richard Heathfield in comp.programming
Apr 29 '07 #7

P: n/a
"Malcolm McLean" <re*******@btinternet.comwrites:
"Ben Pfaff" <bl*@cs.stanford.eduwrote in message
news:87************@blp.benpfaff.org...
>nospam <no****@nospam.comwrites:
>>Is there a utility that takes an arbitrarily complex C language
declaration, checks it validity, and breaks it down into something
more understandable.

Is there a executable version for wintel platforms?

This is in the FAQ.

Section 18. Tools and Resources
What he wants is something like

input:
y = 1/((x + 1) * ( x + 2) + 3);
output:
y = (x+1) * (x+2);
y += 3;
y = 1/y;
He asked about declarations, not expressions.
--
Comp-sci PhD expected before end of 2007
Seeking industrial or academic position *outside California* in 2008
Apr 29 '07 #8

P: n/a
In article <f1**********@rumours.uwaterloo.ca>,
Dave Vandervies <dj******@caffeine.csclub.uwaterloo.cawrote:
>In article <ur******************************@bt.com>,
Malcolm McLean <re*******@btinternet.comwrote:
>>input:
y = 1/((x + 1) * ( x + 2) + 3);
output:
y = (x+1) * (x+2);
y += 3;
y = 1/y;
>>Now the snag is more obvious. We need to insert a test before line 3.
>Under what conditions would you expect the test to fail?
I seem to recall that C99 has complex number support ;-)
--
I was very young in those days, but I was also rather dim.
-- Christopher Priest
Apr 29 '07 #9

P: n/a
Ben Pfaff <bl*@cs.stanford.eduwrote:
nospam <no****@nospam.comwrites:
>Is there a utility that takes an arbitrarily complex C language
declaration, checks it validity, and breaks it down into something
more understandable.

Is there a executable version for wintel platforms?
This is in the FAQ.
The FAQ doesn't answer the question. In particular (something to get used
to in case you decide to learn how to do research), it's citing information
that's been obsolete for several years.
Section 18. Tools and Resources
18.1: I need: A: Look for programs (see also
question 18.16) named:
....
a C declaration aid check volume 14 of
(cdecl) comp.sources.unix (see
question 18.16) and K&R2
comp.sources.unix is defunct, has been for a long time - shortly after
the material for the FAQ was scraped out of stray places.

For grins, read 18.16, which was apparently last updated roughly 10 years ago.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
May 3 '07 #10

P: n/a
Thomas Dickey <di****@saltmine.radix.netwrites:
Ben Pfaff <bl*@cs.stanford.eduwrote:
>nospam <no****@nospam.comwrites:
>>Is there a utility that takes an arbitrarily complex C language
declaration, checks it validity, and breaks it down into something
more understandable.

Is there a executable version for wintel platforms?
>This is in the FAQ.

The FAQ doesn't answer the question.
It says to get cdecl from comp.sources.unix. You can still do
that, with Google Groups. Or, if you don't want to do that, you
can easily search the web for "cdecl", once you know that the
utility has that name.

There's no need for the FAQ to hold the reader's hand. Its
readers are, after all, programmers, who should be able to use
some amount of logical reasoning.
--
Ben Pfaff
http://benpfaff.org
May 3 '07 #11

P: n/a
Ben Pfaff <bl*@cs.stanford.eduwrote:
Thomas Dickey <di****@saltmine.radix.netwrites:
>Ben Pfaff <bl*@cs.stanford.eduwrote:
>>nospam <no****@nospam.comwrites:
>>>Is there a utility that takes an arbitrarily complex C language
declaration, checks it validity, and breaks it down into something
more understandable.

Is there a executable version for wintel platforms?
>>This is in the FAQ.

The FAQ doesn't answer the question.
It says to get cdecl from comp.sources.unix. You can still do
It says several things. But it doesn't answer the question, as
noted above ("executable"...).
that, with Google Groups. Or, if you don't want to do that, you
can easily search the web for "cdecl", once you know that the
utility has that name.
fortunately ten-year old information is not entirely stale.
But it's not the FAQ which makes it useful (obsolete references
to newsgroups, ftp sites, etc).
There's no need for the FAQ to hold the reader's hand. Its
readers are, after all, programmers, who should be able to use
some amount of logical reasoning.
some of them are programmers. But "logical reasoning" is an unreasonable
inference.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
May 3 '07 #12

This discussion thread is closed

Replies have been disabled for this discussion.