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

[Freeciv-Dev] Re: Server/ruleset unification [Was [RFC PATCH] init_techs

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: Freeciv developers <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Server/ruleset unification [Was [RFC PATCH] init_techs]
From: Arien Malec <arien_malec@xxxxxxxxx>
Date: Tue, 25 Sep 2001 10:33:52 -0700 (PDT)

Attached is an EBNF description describing my proposal for part of the unified
language. I've left off help & server control for now. I've also left off the
spec for attribute_value (which is where all the excitement is at the moment).

Things to note:

1) The normal way to terminate a command is with '\n', but a create or object
set command is terminated with ';\n', since those sorts of commands are likely
to span lines

2) Many of the commands either take a simple attribute or an object spec. An
object spec can always be distingushed by the presence of the reserved word
'object'.

Examples of this syntax:

set fubar 1

create object tech automobile; #Gets created with default characteristics

create object tech automobile
        name = _("Automobile")
        req1 = "Combustion",
        req2 "Steel",
        flags = "Population_Pollution_Inc";

set object tech automobile
        req1 = "None"
        req2 = "None"; #And, doh, this means we don't need my init_techs patch!

Arien 

__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. 
http://im.yahoo.com
syntax                  : simple_syntax | compound_syntax

simple_syntax           : simple_statement '\n'

compound_syntax         : compound_statement ';' '\n'

simple_statement        :
                          simple_set_statement
                        | show_statement
                        | help_statement
                        | control_statement

compound_statement      :
                          object_set_statement
                        | create_statement


create_statement        : 'create' object_spec [attribute_setter_list]

set_statement           :
                          simple_set_statement
                        | object_set_statement

show_statement          : 'show' (attribute_name | object_spec)

simple_set_statement    : 'set' attribute_setter

object_set_statement    | 'set' object_spec [attribute_setter_list]

attribute_setter_list   : attribute_setter [',' attribute_setter_list]

attribute_setter        : attribute_name ['='] attribute_value

object_spec             : 'object' object_type object_name

object_type             :
                          'player'
                        | 'tech'
                        | 'unit'
                        | 'nation'
                        | 'terrain'
                        | 'government'
                        | 'citystyle'
                        | 'building'

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