[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 970624: Restriction of variable name in ncgen?



> Subject: Re: 970624: Restriction of variable name in ncgen?

Glenn,

> > It seems that the allowed "-" in variable names would cause a problem
> > in c and fortran code.
> > Is this situation handled differently?
> >
> > --Tom
> 
> You are right, it causes a problem.
> 
> netcdf test {
>         variables: float theta-0;
> }
> 
> produces
> 
>       ...
>       /* variable ids */
>       int theta-0_id;
> 
> Which can't be compiled.

I've just checked in the ncgen fixes for this, so now it generates
syntactically correct code for C and Fortran when dimensions,
attributes, or variables have names that include one or more "-" or "."
characters.  The fixes will be in the next minor release, but I've
appended a patch file in case you want to try them out now.  I also had
to change libsrc/string.c to permit "." in netCDF component names.

> Russ Rew, the author of ncgen (and thus cdl syntax solomon) is on
> vacation this week. In my previous message, I was trying to rationally
> deduce the reasoning behind the cdl syntax. Since we are now into the
> realm of channeling, I'll have to defer further discussion of this
> until his return.
> 
> When/if he fixes the above problem,
> perhaps he will be willing to add the '.' syntax you request.

You did a fairly good job of channeling :-).  

I still can't permit a leading "." or "-" in names because of grammar
ambiguities with floating constants, but otherwise, it seems to work.

Thanks for the suggestion.

--Russ

_____________________________________________________________________

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu

[patch deleted to save space]