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

Brock <awwaiid@thelackthereof.org>
17 Oct 2004 16:04:54 -0400

          From comp.compilers

Related articles
Parsing functions - do I need a keyword like 'def' to indicate a funct clearm_ATSYMBOL_comcast_DOT_net@giganews.com (M Cleary) (2004-10-12)
Re: Parsing functions - do I need a keyword like 'def' to indicate a f awwaiid@thelackthereof.org (Brock) (2004-10-17)
Re: Parsing functions - do I need a keyword like 'def' to indicate a f cdc@maxnet.co.nz (Carl Cerecke) (2004-10-17)
Re: Parsing functions - do I need a keyword like 'def' to indicate a f alexc@TheWorld.com (Alex Colvin) (2004-10-17)
Re: Parsing functions - do I need a keyword like 'def' to indicate a f vbdis@aol.com (2004-10-17)
Re: Parsing functions - do I need a keyword like 'def' to indicate a f cfc@shell01.TheWorld.com (Chris F Clark) (2004-10-17)
Re: Parsing functions - do I need a keyword like 'def' to indicate a f lkrupp@pssw.NOSPAM.com.INVALID (Louis Krupp) (2004-10-17)
Re: Parsing functions - do I need a keyword like 'def' to indicate a f lars@bearnip.com (2004-10-17)
[10 later articles]
| List of all articles for this month |

From: Brock <awwaiid@thelackthereof.org>
Newsgroups: comp.compilers
Date: 17 Oct 2004 16:04:54 -0400
Organization: Compilers Central
References: 04-10-092
Keywords: syntax, design
Posted-Date: 17 Oct 2004 16:04:53 EDT

It all depends on the other top-level constructs in your grammar. Most
likely this will be no problem. One reason that so many languages use a
function declaration keyword is to disambiguate between function
declarations and function calls. But if you don't allow nested functions
you should be able to get away with it.


--Brock


On 2004.10.12.00.53, M Cleary wrote:
| I'm trying to create a simple scripting language using lex and yacc. I've
| noticed that the grammars for most scripting languages have some kind of
| keyword in front of function declarations. ...


| Does anyone have any suggestions as to whether or not I should have/need a
| keyword in front?


Post a followup to this message

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