/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 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
{
size_t i;
- if (dict_lookup_vector (dict, lex_tokid (lexer)))
+ if (dict_lookup_vector (dict, lex_tokcstr (lexer)))
{
msg (SE, _("A vector named %s already exists."),
- lex_tokid (lexer));
+ lex_tokcstr (lexer));
goto fail;
}
for (i = 0; i < vector_cnt; i++)
- if (!strcasecmp (vectors[i], lex_tokid (lexer)))
+ if (!strcasecmp (vectors[i], lex_tokcstr (lexer)))
{
msg (SE, _("Vector name %s is given twice."),
- lex_tokid (lexer));
+ lex_tokcstr (lexer));
goto fail;
}
if (vector_cnt == vector_cap)
vectors = pool_2nrealloc (pool,
vectors, &vector_cap, sizeof *vectors);
- vectors[vector_cnt++] = pool_strdup (pool, lex_tokid (lexer));
+ vectors[vector_cnt++] = pool_strdup (pool, lex_tokcstr (lexer));
lex_get (lexer);
- lex_match (lexer, ',');
+ lex_match (lexer, T_COMMA);
}
/* Now that we have the names it's time to check for the short
or long forms. */
- if (lex_match (lexer, '='))
+ if (lex_match (lexer, T_EQUALS))
{
/* Long form. */
struct variable **v;
dict_create_vector (dict, vectors[0], v, nv);
}
- else if (lex_match (lexer, '('))
+ else if (lex_match (lexer, T_LPAREN))
{
/* Short form. */
struct fmt_spec format;
var_cnt = 0;
format = fmt_for_output (FMT_F, 8, 2);
seen_format = false;
- while (!lex_match (lexer, ')'))
+ while (!lex_match (lexer, T_RPAREN))
{
if (lex_is_integer (lexer) && var_cnt == 0)
{
lex_error (lexer, NULL);
goto fail;
}
- lex_match (lexer, ',');
+ lex_match (lexer, T_COMMA);
}
if (var_cnt == 0)
{
goto fail;
}
}
- while (lex_match (lexer, '/'));
+ while (lex_match (lexer, T_SLASH));
pool_destroy (pool);
return lex_end_of_command (lexer);