[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnu-arch-users] Re: new language, arch, furth, etc.
From: |
Tom Lord |
Subject: |
[Gnu-arch-users] Re: new language, arch, furth, etc. |
Date: |
Tue, 20 Jul 2004 08:02:41 -0700 (PDT) |
(Language design for version variables, continued)
* First Cut: Simple Assignments
The very least a configuration language has to do is associate
names with values. A language providing simple assignments
fits that bill. Here is a (slightly informal) grammar for
such a language:
<program> := <assignment>*
<assignment> := "(" "define" <name> <value> ")"
<name> := ``an identifier''
<value> := ``a value''
Here are is a valid program using that grammar:
(define x 42)
(define message "hello world")
The informal grammar, to be made formal, needs definitions
for:
``an identifier''
and
``a value''
* Identifiers
Identifier syntax is a fairly arbitrary choice but there are
some considerations to keep in mind:
1. The lexical syntax of identifiers must not create
syntactic ambiguity in programs
2. The language as a whole should be easy to lex and parse
3. Identifiers are often used in more than one programming
language: there should be a mapping from our languages
variable names to those of, say, C, perl, python, and
Scheme
4. the syntax should be "extensible" in the sense that
the grammar can expand in the future. For that reason,
it is probably best to _not_ make the set of identifier
names as large as possible; rather, some possible
identifiers should be left undefined (illegal tokens)
for now.
I drew on my personal tastes and experience and decided that
identifiers in this language should be a subset of the identifiers
in Scheme:
<name> := <initial> <subsequent>*
<initial> := <letter>
<subsequent> := <letter> | "-" | <digit>
For example, these are valid identifiers:
diff3
hello-world
answer
but these are not:
3way-merge
hello_world
-t
- [Gnu-arch-users] new language, arch, furth, etc., Tom Lord, 2004/07/19
- Re: [Gnu-arch-users] new language, arch, furth, etc., Phil Frost, 2004/07/20
- [Gnu-arch-users] Re: new language, arch, furth, etc., Andreas Rottmann, 2004/07/20
- Re: [Gnu-arch-users] new language, arch, furth, etc., Aaron Bentley, 2004/07/20
- Re: [Gnu-arch-users] new language, arch, furth, etc., Tom Lord, 2004/07/20
- [Gnu-arch-users] Re: new language, arch, furth, etc.,
Tom Lord <=
- Re: [Gnu-arch-users] new language, arch, furth, etc., Colin Walters, 2004/07/20
- Re: [Gnu-arch-users] new language, arch, furth, etc., Charles Duffy, 2004/07/20
- Re: [Gnu-arch-users] new language, arch, furth, etc., Colin Walters, 2004/07/20
- Re: [Gnu-arch-users] new language, arch, furth, etc., Charles Duffy, 2004/07/20
- Re: [Gnu-arch-users] new language, arch, furth, etc., Colin Walters, 2004/07/20
- Re: [Gnu-arch-users] new language, arch, furth, etc., Talli Somekh, 2004/07/20
- Re: [Gnu-arch-users] new language, arch, furth, etc., James Blackwell, 2004/07/20
- Re: [Gnu-arch-users] new language, arch, furth, etc., Pierce T . Wetter III, 2004/07/20
- Re: [Gnu-arch-users] new language, arch, furth, etc., Tom Lord, 2004/07/20
- Re: [Gnu-arch-users] new language, arch, furth, etc., Jeremy Shaw, 2004/07/20