Charlie Zender - 2002-02-12

Hi,

hope things are going well.

>      Hows the release going ? Have we had many downloads yet ?

Sourceforge records 56 downloads as of today.

> I've been thinking about defining dimensions on the fly . I see two possible
> approaches :
> A) We have a define function e.g    defdim("lat",10)  -- And then fill out
> the
>      associated var with something like
>         lat[lat] = {1.0,2.0,3.0,4.0 ... 10.0}

> B) We use a postfix operator so that the parser/scanner recognises it as a
> dimension e.g
>      lat$=10, then fill out the associated var as before

Basically, I agree.

>      lat[lat$] ={ 1.0,2.0....10}

The above step is optional, right? There should be no requirement that
a dimension must have an associated variable.

> I prefer the second approach because it means the user will be able to
> manipulate the dimensions like an attribute in calculations e.g.
>  if( lat$ > 10) then ...
>  att@test = 1at$ *20.0;
>  lon$=lat$+2;

I also prefer the idea of using syntax to identify when a name refers
to a dimension (rather than a variable). This is basically your
second option. Although a postfix operator will work and can be
used for development purposes, I would like to think about using a
more standard syntax than postfix dollarsign, e.g., /lat/ or $lat.

> I've been looking at some implementations of the "if" statement--gomscript
> and the Unix utility bc-Neither of them I fully understand

This is probably naive of me, but have you tried using a new start
states e.g., something like
%s IFTHENSTATE
%%
"if" { BEGIN IFTHENSTATE; }
<IFTHENSTATE>"(" { evaluate expression;
             return BOOLEAN; }
<IFTHENSTATE>"then" { if(!prs_arg.boolean) ignore everything;
")" { BEGIN INITIAL; }

> - I'm thinking of
> e-mailing the authors of the "Pidgeon" book for some help -- Do you know of
> any experts in yacc we can call on  ?

I do not.
The GNU octave project might be a good place to look at how language
constructs are implemented since source code is freely available.
Octave is yet another high level numerical language like IDL and matlab.   
Also, full BNF specifications of many languages are available
on the web. In _theory_ it may be possible to take the BNF
representation and implement the parser rules from there.
So maybe give google a try and see what you find, e.g.,

http://cui.unige.ch/db-research/Enseignement/analyseinfo/BNFweb.html

Finally the embedded SQL parser in the lex & yacc book looks pretty
full-featured, although it does not seem to explicitly implement the
if statement if does handle many conditional statements so I would
recommend reading that if you have not already.

> Regards Henry

Ciao,
Charlie