Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keywords are reserved in CDL files. #178

Closed
DennisHeimbigner opened this issue Dec 26, 2015 · 2 comments
Closed

Keywords are reserved in CDL files. #178

DennisHeimbigner opened this issue Dec 26, 2015 · 2 comments

Comments

@DennisHeimbigner
Copy link
Collaborator

re: e-support ticket BNL-694121
There is an ambiguity in the grammar for cdl files.

Consider this CDL file fragment:

netcdf X {
variables:
int data;:

data:_Fillvalue = ...

The last line is ambiguous because it can be interpreted as the beginning
of the data: section. If you remove that line, thecdl file
compiles ok. This is going to be difficult to fix (maybe impossible)
because it can require significant lookahead.
It appears that this is only a problem for variables named 'data' or 'group'.

@DennisHeimbigner
Copy link
Collaborator Author

Ok, so I had this wrong. ncgen handles this ok, as per this comment in the ncgen man page.

Note also that the words variable',dimension', data',group', and
`types' are legal CDL names, but be careful that there is a space be-
tween them and any following colon character when used as a variable
name. This is mostly an issue with attribute declarations.

However, ncdump does not obey this rule. So that needs to be fixed.

DennisHeimbigner added a commit that referenced this issue Dec 27, 2015
NetCDF-c Github issue #178 / esupport BNL-694121

The ncgen man pages says:
> Note also that the words variable',dimension', data',group', and
> `types' are legal CDL names, but be careful that there is a space be-
> tween them and any following colon character when used as a variable
> name. This is mostly an issue with attribute declarations.

Ncdump does not obey this rule.
The fix is to modify ncdump/ncdump.c to check if a variable name is
a keyword.

Also added test case.
@DennisHeimbigner
Copy link
Collaborator Author

Ok, so the fix is in as a pull request. Closing issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant