summaryrefslogtreecommitdiffstats
path: root/hl/src/H5LT.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2005-11-03 14:11:09 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2005-11-03 14:11:09 (GMT)
commit47b0c3b356cca31ffae47c86dc4ebd649ce6bef6 (patch)
tree1306b6407ab049d50ffbcfbfc9b450924d7e5713 /hl/src/H5LT.c
parent7fd6ff2413d3ecf65e77c9474f410a7acb9f4e52 (diff)
downloadhdf5-47b0c3b356cca31ffae47c86dc4ebd649ce6bef6.zip
hdf5-47b0c3b356cca31ffae47c86dc4ebd649ce6bef6.tar.gz
hdf5-47b0c3b356cca31ffae47c86dc4ebd649ce6bef6.tar.bz2
[svn-r11676] Purpose: New feature
Description: Adding the new function H5LTtext_to_dtype() for converting text description to data type. The next step will be H5LTdtype_to_text(). Solution: Use Lex and Yacc to do parsing of the text. H5LTanalyze.l is the lexer for analyzing the input; H5LTparse.y is the parser. They are not part of HL library, but are used to generate lex.yy.c (from H5LTanalyze.l) as well as y.tab.c and y.tab.h (from H5LTparse.y). The tools used to create these source files are GNU FLEX and YACC on a Linux machine (fuss). The commands are "lex H5LTanalyze.l" and "yacc -d H5LTparse.y". Detailed document will be added later. Platforms tested: h5committest and fuss. Misc. update: MANIFEST
Diffstat (limited to 'hl/src/H5LT.c')
-rw-r--r--hl/src/H5LT.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c
index 2eaa2bc..0a694d9 100644
--- a/hl/src/H5LT.c
+++ b/hl/src/H5LT.c
@@ -1978,9 +1978,42 @@ out:
return -1;
}
+/*-------------------------------------------------------------------------
+ * Function: H5LTtext_to_dtype
+ *
+ * Purpose: Convert DDL description to HDF5 data type.
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: Raymond Lu, slu@ncsa.uiuc.edu
+ *
+ * Date: October 6, 2004
+ *
+ * Comments:
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+hid_t H5LTtext_to_dtype(const char *text)
+{
+
+ hid_t type_id;
+ hsize_t i;
+
+ input_len = strlen(text);
+ myinput = strdup(text);
+
+ type_id = yyparse();
+ free(myinput);
+ input_len = 0;
+ return type_id;
+out:
+ return -1;
+}
/*-------------------------------------------------------------------------
* Function: H5LTrepack