Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Re: [RFC PATCH] init_techs
Home

[Freeciv-Dev] Re: [RFC PATCH] init_techs

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: Reinier Post <rp@xxxxxxxxxx>, Freeciv developers <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [RFC PATCH] init_techs
From: Daniel L Speyer <dspeyer@xxxxxxxxxxx>
Date: Mon, 24 Sep 2001 11:01:47 -0400 (EDT)

On Mon, 24 Sep 2001, Raimar Falke wrote:

> On Mon, Sep 24, 2001 at 09:33:28AM -0400, Daniel L Speyer wrote:
> > What about a truly general and extendable parsing?  Admittedly, this would
> > be difficult to write, but break down the command line according to
> > syntactical rules and then pass each function manually typed void*s.  A
> > callback function would look like
> > 
> > enum datatype;
> > void do_command(int argV, datatype argT[], char *argC[]);
                                               ^^^^^^
                                               Oops, this should be void *
> > 
> > Then if a function wants different arguments, it can throw some sort of
> > generalized error (not literally throw, that's just the idea).  There
> > could even be a function int checkarguments(int Vgiven,datatype
> > Tgiven[],int Vwanted,datatype Twanted[]) which would check everything,
> > give an appropriate error, and then return whether or not the function
> > should proceed.
> > 
> > If we designed it to be extensible enough, we could get the benefits of
> > both unified syntax and extendable functions.
> 
> You know (f)lex and yacc/bison?

I don't, though I'm sure I could learn them.  Why?

--Daniel Speyer
"May the /src be with you, always"


> 
>       Raimar
> 
> -- 
>  email: rf13@xxxxxxxxxxxxxxxxx
>  "How about the new language C&? No, that's not 'c ampersand', 'c reference', 
>   'reference to c' or 'c and'. It's pronounced 'campersand', to confuse the 
>   hell out of people who are unfamiliar with it, and it will, of course, 
>   have no pointers."
>     -- Xazziri in comp.lang.c++ about C#
> 
> 



[Prev in Thread] Current Thread [Next in Thread]