X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdata-io%2Fdata-parser.c;h=aea3bbd0374693ca6bd1846aaa96ce9cfb041ca3;hb=b401615e6db40bf74394839b96600afe3a868a95;hp=1e67c71345ad5c836092323a670801023af3c927;hpb=d8493b3b0617cc447446a70b031a69079bc19002;p=pspp-builds.git diff --git a/src/language/data-io/data-parser.c b/src/language/data-io/data-parser.c index 1e67c713..aea3bbd0 100644 --- a/src/language/data-io/data-parser.c +++ b/src/language/data-io/data-parser.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2007, 2009, 2010, 2011 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 @@ -16,24 +16,24 @@ #include -#include +#include "language/data-io/data-parser.h" #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "data/casereader-provider.h" +#include "data/data-in.h" +#include "data/dataset.h" +#include "data/dictionary.h" +#include "data/format.h" +#include "data/file-handle-def.h" +#include "data/settings.h" +#include "language/data-io/data-reader.h" +#include "libpspp/message.h" +#include "libpspp/str.h" +#include "output/tab.h" -#include "xalloc.h" +#include "gl/xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) @@ -508,10 +508,11 @@ parse_error (const struct dfm_reader *reader, const struct field *field, m.category = MSG_C_DATA; m.severity = MSG_S_WARNING; - m.where.file_name = CONST_CAST (char *, dfm_get_file_name (reader)); - m.where.line_number = dfm_get_line_number (reader); - m.where.first_column = first_column; - m.where.last_column = last_column; + m.file_name = CONST_CAST (char *, dfm_get_file_name (reader)); + m.first_line = dfm_get_line_number (reader); + m.last_line = m.first_line + 1; + m.first_column = first_column; + m.last_column = last_column; m.text = xasprintf (_("Data for variable %s is not valid as format %s: %s"), field->name, fmt_name (field->format.type), error); msg_emit (&m); @@ -761,7 +762,7 @@ struct data_parser_casereader static const struct casereader_class data_parser_casereader_class; -/* Replaces DS's active file by an input program that reads data +/* Replaces DS's active dataset by an input program that reads data from READER according to the rules in PARSER, using DICT as the underlying dictionary. Ownership of PARSER and READER is transferred to the input program, and ownership of DICT is @@ -781,7 +782,8 @@ data_parser_make_active_file (struct data_parser *parser, struct dataset *ds, casereader = casereader_create_sequential (NULL, r->proto, CASENUMBER_MAX, &data_parser_casereader_class, r); - proc_set_active_file (ds, casereader, dict); + dataset_set_dict (ds, dict); + dataset_set_source (ds, casereader); } static struct ccase *