Re: Parsing functions - do I need a keyword like 'def' to indicate a function?

Dave Thompson <david.thompson1@worldnet.att.net>
28 Nov 2004 23:19:02 -0500

          From comp.compilers

Related articles
[11 earlier articles]
Re: Parsing functions - do I need a keyword like 'def' to indicate a f angagon@earthlink.net (Matt O'Connor) (2004-10-30)
Re: Parsing functions - do I need a keyword like 'def' to indicate a f alexc@TheWorld.com (Alex Colvin) (2004-11-02)
Re: Parsing functions - do I need a keyword like 'def' to indicate a f david.thompson1@worldnet.att.net (Dave Thompson) (2004-11-02)
Re: Parsing functions - do I need a keyword like 'def' to indicate a f clint@0lsen.net (Clint Olsen) (2004-11-06)
Re: Parsing functions - do I need a keyword like 'def' to indicate a f kenrose@tfb.com (Ken Rose) (2004-11-14)
Re: Parsing functions - do I need a keyword like 'def' to indicate a f kers@hplb.hpl.hp.com (Chris Dollin) (2004-11-17)
Re: Parsing functions - do I need a keyword like 'def' to indicate a f david.thompson1@worldnet.att.net (Dave Thompson) (2004-11-28)
| List of all articles for this month |

From: Dave Thompson <david.thompson1@worldnet.att.net>
Newsgroups: comp.compilers
Date: 28 Nov 2004 23:19:02 -0500
Organization: AT&T Worldnet
References: 04-10-092 04-10-161 04-10-185 04-11-006 04-11-014 04-11-036
Keywords: syntax, design
Posted-Date: 28 Nov 2004 23:19:02 EST

On 14 Nov 2004 22:41:57 -0500, Ken Rose <kenrose@tfb.com> wrote:
<snip: function/etc definition versus use, in particular in C>
> >>If it's inside a function it can only be a call.
> >
> > What about function prototypes? Those can occur both inside and outside of
> > functions.


You mean declarations; 'prototype' actually means only the C99/C++
form with parameter types inside the parenthesized list, and this is
an option on both declaration and definition, although people often
misuse the term to mean only declarations.


> A call will never start with a type name. A prototype will always start
> with a type name, the name of the return type.


Actually before C99 the type is optional, defaulting to int; but the
declaration-specifiers (list) must be nonempty (except on a function
definition, which cannot be nested) so a declaration must begin with a
type name, qualifier, or storage class specifier, all of which are
distinguishable.


- David.Thompson1 at worldnet.att.net


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.