- Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
if (lex_match_id (lexer, "GNM"))
return parse_get_gnm (lexer, ds);
if (lex_match_id (lexer, "GNM"))
return parse_get_gnm (lexer, ds);
else if (lex_match_id (lexer, "PSQL"))
return parse_get_psql (lexer, ds);
else if (lex_match_id (lexer, "PSQL"))
return parse_get_psql (lexer, ds);
psql.str_width = lex_integer (lexer);
lex_get (lexer);
}
else if ( lex_match_id (lexer, "BSIZE"))
{
psql.str_width = lex_integer (lexer);
lex_get (lexer);
}
else if ( lex_match_id (lexer, "BSIZE"))
{
{
struct gnumeric_read_info gri = {NULL, NULL, NULL, 1, true, -1};
{
struct gnumeric_read_info gri = {NULL, NULL, NULL, 1, true, -1};
gri.asw = lex_integer (lexer);
}
else if (lex_match_id (lexer, "SHEET"))
{
gri.asw = lex_integer (lexer);
}
else if (lex_match_id (lexer, "SHEET"))
{
if (lex_match_id (lexer, "NAME"))
{
if ( ! lex_force_string (lexer) )
goto error;
if (lex_match_id (lexer, "NAME"))
{
if ( ! lex_force_string (lexer) )
goto error;
if (lex_match_id (lexer, "FIXED"))
ok = set_type (parser, "ARRANGEMENT=FIXED", DP_FIXED, &has_type);
else if (lex_match_id (lexer, "DELIMITED"))
if (lex_match_id (lexer, "FIXED"))
ok = set_type (parser, "ARRANGEMENT=FIXED", DP_FIXED, &has_type);
else if (lex_match_id (lexer, "DELIMITED"))
{
if (!set_type (parser, "DELCASE", DP_DELIMITED, &has_type))
goto error;
{
if (!set_type (parser, "DELCASE", DP_DELIMITED, &has_type))
goto error;
if (lex_match_id (lexer, "LINE"))
data_parser_set_span (parser, false);
else if (lex_match_id (lexer, "VARIABLES"))
if (lex_match_id (lexer, "LINE"))
data_parser_set_span (parser, false);
else if (lex_match_id (lexer, "VARIABLES"))
{
if (!set_type (parser, "FIXCASE", DP_FIXED, &has_type))
goto error;
{
if (!set_type (parser, "FIXCASE", DP_FIXED, &has_type))
goto error;
if (lex_match (lexer, T_ALL))
{
data_parser_set_case_limit (parser, -1);
if (lex_match (lexer, T_ALL))
{
data_parser_set_case_limit (parser, -1);
if (!set_type (parser, "DELIMITERS", DP_DELIMITED, &has_type))
goto error;
if (!set_type (parser, "DELIMITERS", DP_DELIMITED, &has_type))
goto error;
if (ss_match_string (&s, ss_cstr ("\\t")))
ds_put_cstr (&hard_seps, "\t");
if (ss_match_string (&s, ss_cstr ("\\\\")))
ds_put_cstr (&hard_seps, "\\");
if (ss_match_string (&s, ss_cstr ("\\t")))
ds_put_cstr (&hard_seps, "\t");
if (ss_match_string (&s, ss_cstr ("\\\\")))
ds_put_cstr (&hard_seps, "\\");
data_parser_set_soft_delimiters (parser, ss_cstr (soft_seps));
data_parser_set_hard_delimiters (parser, ds_ss (&hard_seps));
ds_destroy (&hard_seps);
data_parser_set_soft_delimiters (parser, ss_cstr (soft_seps));
data_parser_set_hard_delimiters (parser, ds_ss (&hard_seps));
ds_destroy (&hard_seps);
{
if (!set_type (parser, "QUALIFIERS", DP_DELIMITED, &has_type))
goto error;
{
if (!set_type (parser, "QUALIFIERS", DP_DELIMITED, &has_type))
goto error;
{
msg (SE, _("In compatible syntax mode, the QUALIFIER string "
"must contain exactly one character."));
goto error;
}
{
msg (SE, _("In compatible syntax mode, the QUALIFIER string "
"must contain exactly one character."));
goto error;
}
data_parser_add_fixed_field (parser, &input, var_get_case_index (v),
name, record, fc);
}
data_parser_add_fixed_field (parser, &input, var_get_case_index (v),
name, record, fc);
}