+ if (lex_match_id ("FILE"))
+ file->type = MTF_FILE;
+ else if (lex_match_id ("TABLE"))
+ {
+ file->type = MTF_TABLE;
+ saw_table = true;
+ }
+ else
+ assert (0);
+
+ file->by = NULL;
+ file->handle = NULL;
+ file->reader = NULL;
+ file->dict = NULL;
+ file->in_name = NULL;
+ file->in_var = NULL;
+ case_nullify (&file->input);
+
+ /* FILEs go first, then TABLEs. */
+ if (file->type == MTF_TABLE || first_table == NULL)
+ {
+ file->next = NULL;
+ file->prev = mtf.tail;
+ if (mtf.tail)
+ mtf.tail->next = file;
+ mtf.tail = file;
+ if (mtf.head == NULL)
+ mtf.head = file;
+ if (file->type == MTF_TABLE && first_table == NULL)
+ first_table = file;
+ }
+ else
+ {
+ assert (file->type == MTF_FILE);
+ file->next = first_table;
+ file->prev = first_table->prev;
+ if (first_table->prev)
+ first_table->prev->next = file;
+ else
+ mtf.head = file;
+ first_table->prev = file;
+ }
+
+ lex_match ('=');
+
+ if (lex_match ('*'))
+ {
+ file->handle = NULL;
+ file->reader = NULL;
+
+ if (used_active_file)
+ {
+ msg (SE, _("The active file may not be specified more "
+ "than once."));
+ goto error;
+ }
+ used_active_file = true;
+
+ assert (pgm_state != STATE_INPUT);
+ if (pgm_state == STATE_INIT)
+ {
+ msg (SE, _("Cannot specify the active file since no active "
+ "file has been defined."));
+ goto error;
+ }
+
+ if (temporary != 0)
+ {
+ msg (SE,
+ _("MATCH FILES may not be used after TEMPORARY when "
+ "the active file is an input source. "
+ "Temporary transformations will be made permanent."));
+ cancel_temporary ();
+ }
+
+ file->dict = default_dict;
+ }
+ else
+ {
+ file->handle = fh_parse ();
+ if (file->handle == NULL)
+ goto error;
+
+ file->reader = sfm_open_reader (file->handle, &file->dict, NULL);
+ if (file->reader == NULL)
+ goto error;
+
+ case_create (&file->input, dict_get_next_value_idx (file->dict));
+ }
+
+ while (lex_match ('/'))
+ if (lex_match_id ("RENAME"))
+ {
+ if (!rename_variables (file->dict))
+ goto error;
+ }
+ else if (lex_match_id ("IN"))
+ {
+ lex_match ('=');
+ if (token != T_ID)
+ {
+ lex_error (NULL);
+ goto error;
+ }
+
+ if (file->in_name != NULL)
+ {
+ msg (SE, _("Multiple IN subcommands for a single FILE or "
+ "TABLE."));
+ goto error;
+ }
+ file->in_name = xstrdup (tokid);
+ lex_get ();
+ saw_in = true;
+ }
+
+ mtf_merge_dictionary (mtf.dict, file);
+ }
+
+ while (token != '.')
+ {