[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
parsing template?
From: |
Alan Mead |
Subject: |
parsing template? |
Date: |
Sat, 30 May 2015 15:28:27 -0500 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
I filed a bug because CLUSTER hangs on unknown subcommands. It turns
out that (for reasons I don't fully understand) the main parsing loop
never terminates when an unsupported or invalid subcommand is used. I
don't understand how the parsing works with all the lex_*() functions.
It looks like when any unexpected subcommand is present that the rest of
the command is ignored and the "lex_token (lexer) != T_ENDCMD" condition
is never met.
Is there a working template of how parsing is supposed to occur?
I can fix the issue by adding a final else at the end of parser:
$ diff quick-cluster.c quick-cluster.c.original
579,584d578
< else
< {
< lex_error (lexer, _("Invalid or unsupported subcommand"));
< goto error;
< }
<
Is there a reason not to do this? One reason is that it will break any
SPSS syntax that uses unsupported subcommands but that seems better than
having PSPP hang.
-Alan
--
Alan D. Mead, Ph.D.
President, Talent Algorithms Inc.
science + technology = better workers
+815.588.3846 (Office)
+267.334.4143 (Mobile)
http://www.alanmead.org
Announcing the Journal of Computerized Adaptive Testing (JCAT), a
peer-reviewed electronic journal designed to advance the science and
practice of computerized adaptive testing: http://www.iacat.org/jcat
- parsing template?,
Alan Mead <=