+ {
+ free (tok);
+ return parse_get_psql (lexer, ds);
+ }
+ else if (lex_match_id (lexer, "GNM") ||
+ lex_match_id (lexer, "ODS"))
+ {
+ char *filename = NULL;
+ struct casereader *reader = NULL;
+ struct dictionary *dict = NULL;
+
+ if (!parse_spreadsheet (lexer, &filename, &opts))
+ goto error;
+
+ if ( gnm_read_support && 0 == strncasecmp (tok, "GNM", 3))
+ {
+ struct spreadsheet *spreadsheet = gnumeric_probe (filename, true);
+ if (spreadsheet == NULL)
+ goto error;
+ reader = gnumeric_make_reader (spreadsheet, &opts);
+ dict = spreadsheet->dict;
+ gnumeric_unref (spreadsheet);
+ }
+ else if ( odf_read_support && 0 == strncasecmp (tok, "ODS", 3))
+ {
+ struct spreadsheet *spreadsheet = ods_probe (filename, true);
+ if (spreadsheet == NULL)
+ goto error;
+ reader = ods_make_reader (spreadsheet, &opts);
+ dict = spreadsheet->dict;
+ ods_unref (spreadsheet);
+ }
+
+ free (filename);
+
+ if (reader)
+ {
+ dataset_set_dict (ds, dict);
+ dataset_set_source (ds, reader);
+ free (tok);
+ destroy_spreadsheet_read_info (&opts);
+ return CMD_SUCCESS;
+ }
+ }
+ else
+ msg (SE, _("Unsupported TYPE %s."), tok);