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 15:42:01 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

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[]);
> 
> 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?

        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]