Definition of the H5edit Command Language

1. Introduction

This section describes the command language (CL) of the h5edit tool. The description is in Backus-Naur Form.

2. Explanation of Symbols

This section contains a brief explanation of the symbols used in the CL.

    ::=           defined as

    <tname>       a token with the name tname

    <a> | <b>     one of <a> or <b>

    <a>opt         zero or one occurrence of <a>

    <a>*          zero or more occurrence of <a>

    <a>+          one or more occurrence of <a>

    [0-9]         an element in the range between 0 and 9

    ‘['           the token within the quotes (used for special characters)

    TBD           To Be Decided

    /* … */       Comments

3. The H5edit Command Language

<h5edit_command_file> ::= <h5edit_statement>+

 

<h5edit_statement> ::= <h5edit_command> ;

 

/* Commands */

<h5edit_command> ::= <attribute_create_command> | <attribute_copy_command> | <attribute_delete_command> | <attribute_rename_command>

 

<attribute_create_command> ::= CREATE <attribute_name_new> <attribute_definition>

 

<attribute_delete_command> ::= COPY <attribute_name_old> <attribute_name_new>

 

<attribute_delete_command> ::= DELETE <attribute_name_old>

 

<attribute_delete_command> ::= RENAME <attribute_name_old> <attribute_name_new>

 

<attribute_delete_command> ::= MODIFY <attribute_name_old> <attribute_data>

 

/* Attribute definition */

<attribute_name_old> ::= <attribute_name>

 

<attribute_name_new> ::= <attribute_name>

 

<attribute_name> ::= <target_object_name>/<name> | <target_object_name> <name>

 

< target_object_name> ::= <group_name> | <dataset_name>

 

<group_name> ::= GROUP opt <name>

 

<dataset_name> ::= DATASET opt <name>

 

/* Attribute Definition */

<attribute_definition> ::= { <attribute_datatype_definition> opt <attribute_dataspace_definition> opt <attribute_data> }

 

/* attribute_datatype_definition defaults to H5T_NATIVE_FLOAT if not given */

<attribute_datatype_definition> ::= DATATYPE opt <datatype_definition>

 

/* attribute_dataspace_definition defaults to SCALAR if not given */

<attribute_dataspace_definition> ::= DATASPACE opt <dataspace_definition>

 

<attribute_data> ::= DATA opt { <data> , <data>* }

 

/* Datatype Definition */

<datatype_definition> ::= <atomic_type> | <compound_type> | <variable_length_type> | <array_type>

 

<atomic_type> ::= <integer_type> | <float_type> | <string_type> | <time_type> | <bitfield_type> | <opaque_type> | <reference_type> | <enum_type>

 
<integer_type> ::= H5T_STD_I8BE     | H5T_STD_I8LE      |
             H5T_STD_I16BE    | H5T_STD_I16LE     |
             H5T_STD_I32BE    | H5T_STD_I32LE     |
             H5T_STD_I64BE    | H5T_STD_I64LE     |
             H5T_STD_U8BE     | H5T_STD_U8LE      |
             H5T_STD_U16BE    | H5T_STD_U16LE     |
             H5T_STD_U32BE    | H5T_STD_U32LE     |
             H5T_STD_U64BE    | H5T_STD_U64LE     |
             H5T_NATIVE_CHAR  | H5T_NATIVE_UCHAR  |
             H5T_NATIVE_SHORT | H5T_NATIVE_USHORT |
             H5T_NATIVE_INT   | H5T_NATIVE_UINT   |
             H5T_NATIVE_LONG  | H5T_NATIVE_ULONG  |
             H5T_NATIVE_LLONG | H5T_NATIVE_ULLONG
 
<float_type> ::= H5T_IEEE_F32BE   | H5T_IEEE_F32LE     |
           H5T_IEEE_F64BE   | H5T_IEEE_F64LE     |
           H5T_NATIVE_FLOAT | H5T_NATIVE_DOUBLE  |
           H5T_NATIVE_LDOUBLE
 
<string_type> ::= H5T_STRING { 
                  STRSIZE <strsize> ;
                  STRPAD <strpad> ;
                  CSET <cset> ;
                  CTYPE <ctype> ; 
             }  
 
<strsize> ::= <int_value>
 
<strpad>  ::= H5T_STR_NULLTERM | H5T_STR_NULLPAD | H5T_STR_SPACEPAD
 
<cset>    ::= H5T_CSET_ASCII
 
<ctype>   ::= H5T_C_S1 | H5T_FORTRAN_S1
                                  
<compound_type>   ::= H5T_COMPOUND { <member_type_def>+ }
 
<member_type_def> ::= <datatype_definition> <field_name> ;
 
<field_name> ::= <identifier>
 
<time_type> ::= <TBD>
 
<bitfield_type> ::= <TBD>
 
<opaque_type> ::= <TBD>
 
<reference_type> ::= <TBD>
 
<enum_type> ::= <TBD>
 
<variable_length_type> ::= <TBD>
 
<array_type> ::= <TBD>
 
/* Dataspace Definition */
<dataspace_definition> ::=
        <dataspace_scalar_definition> |
        <dataspace_null_definition> | 
        <dataspace_simple_definition> 
 
/* Scalar Dataspace definition */
<dataspace_simple_definition> ::= SCALAR
 
/* Null Dataspace definition */
<dataspace_simple_definition> ::= NULL
 
/* Simple Dataspace definition */
<dataspace_simple_definition> ::= SIMPLE opt <dataspace_dims_list>
 
/* Dataspace Dimension list definition */
< dataspace_dims_list> ::= ( <dim_size> , <dim_size>* )
 
<dim_size> ::= <int_value>
 
/* Integer value */
<int_value> ::= [0-9]+
 
/* Floating Point value */
<float_value> ::= [0-9]*.[0-9]+
 

4. Examples

CREATE /m1/Percentage_per_Volume 40;

 

CREATE /m2 GPS_Location {

DATATYPE H5T_IEEE_F32LE

DATASPACE SIMPLE {(2)/(2)}

DATA {0.0, 180.0}

};

 

DELETE /m1/“Temp Scale”;

 

CREATE GROUP /m1/“Temp Scale” {

DATATYPE H5T_C_S1

DATA {“Celsius”}

};

 

RENAME /m2/GPS_Location /m2/Geo_Location;

 

COPY /m1/“Temp Scale” /m2/“Temp Scale”;

 

MODIFY /m1/Percentage_per_Volume 42;

 

 


Revision History

Nov 2, 2010:

Version 0 draft for initial review

Jul 30, 2011:

Version 1.0.0 for first release of the h5edit tool

Oct 10, 2011:

Version 1.0.1 release of the h5edit tool

Mar 4, 2013:

Version 1.1.0 release of the h5edit tool

Aug 8, 2013:

Version 1.2.0 release of the h5edit tool

Jun 30, 2014:

Version 1.3.0 release of the h5edit tool

Nov 14, 2014:

Version 1.3.1 release of the h5edit tool