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: Daniel L Speyer <dspeyer@xxxxxxxxxxx>
Cc: Reinier Post <rp@xxxxxxxxxx>, Freeciv developers <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [RFC PATCH] init_techs
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 24 Sep 2001 17:42:09 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Mon, Sep 24, 2001 at 11:01:47AM -0400, Daniel L Speyer wrote:
> 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?

You can easily define a small language which may be used to interface
with the server. It can reduce the amount of parsing the "real"
freeciv code has to do. It looks like some propose to implement
something like this by hand.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Only one human captain has ever survived battle with the Minbari
  fleet. He is behind me. You are in front of me. If you value your 
  lives, be somewhere else."
    -- Ambassador Delenn, "Severed Dreams," Babylon 5


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