msgstr ""
"Project-Id-Version: PSPP 0.4.2\n"
"Report-Msgid-Bugs-To: pspp-dev@gnu.org\n"
-"POT-Creation-Date: 2006-10-26 14:25+0800\n"
+"POT-Creation-Date: 2006-10-26 16:30+0800\n"
"PO-Revision-Date: 2006-05-26 17:49+0800\n"
"Last-Translator: John Darrington <john@darrington.wattle.id.au>\n"
"Language-Team: German <pspp-dev@gnu.org>\n"
#: src/language/command.c:802 src/language/data-io/matrix-data.c:539
#: src/language/data-io/print-space.c:75 src/language/dictionary/vector.c:203
-#: src/language/lexer/lexer.c:448 src/language/stats/autorecode.c:154
+#: src/language/lexer/lexer.c:456 src/language/stats/autorecode.c:154
#: src/language/xforms/select-if.c:62
msgid "expecting end of command"
msgstr ""
"specified."
msgstr ""
-#: src/language/control/repeat.c:393
+#: src/language/control/repeat.c:399
#, c-format
msgid "%ld TO %ld is an invalid range."
msgstr ""
-#: src/language/control/repeat.c:429
+#: src/language/control/repeat.c:435
msgid "String expected."
msgstr ""
-#: src/language/control/repeat.c:448
+#: src/language/control/repeat.c:454
msgid "No matching DO REPEAT."
msgstr ""
"by itself on a single line with exactly one space between words."
msgstr ""
-#: src/language/data-io/data-reader.c:206
-#: src/language/data-io/data-reader.c:218
+#: src/language/data-io/data-reader.c:207
+#: src/language/data-io/data-reader.c:219
#, c-format
msgid "Error reading file %s: %s."
msgstr ""
-#: src/language/data-io/data-reader.c:221
+#: src/language/data-io/data-reader.c:222
#, c-format
msgid "%s: Partial record at end of file."
msgstr ""
-#: src/language/data-io/data-reader.c:272
+#: src/language/data-io/data-reader.c:273
#, c-format
msgid "Attempt to read beyond end-of-file on file %s."
msgstr ""
-#: src/language/data-io/data-reader.c:275
+#: src/language/data-io/data-reader.c:276
msgid "Attempt to read beyond END DATA."
msgstr ""
-#: src/language/data-io/data-reader.c:433
+#: src/language/data-io/data-reader.c:434
msgid ""
"This command is not valid here since the current input program does not "
"access the inline file."
"s."
msgstr ""
-#: src/language/dictionary/value-labels.c:158 src/language/lexer/lexer.c:585
+#: src/language/dictionary/value-labels.c:158 src/language/lexer/lexer.c:593
msgid "expecting string"
msgstr ""
-#: src/language/dictionary/value-labels.c:167 src/language/lexer/lexer.c:599
+#: src/language/dictionary/value-labels.c:167 src/language/lexer/lexer.c:607
msgid "expecting integer"
msgstr ""
msgid "expecting format type"
msgstr ""
-#: src/language/lexer/lexer.c:259
+#: src/language/lexer/lexer.c:267
#, c-format
msgid "%s does not form a valid number."
msgstr ""
-#: src/language/lexer/lexer.c:363
+#: src/language/lexer/lexer.c:371
#, c-format
msgid "Bad character in input: `%c'."
msgstr ""
-#: src/language/lexer/lexer.c:365
+#: src/language/lexer/lexer.c:373
#, c-format
msgid "Bad character in input: `\\%o'."
msgstr ""
-#: src/language/lexer/lexer.c:396
+#: src/language/lexer/lexer.c:404
#, c-format
msgid "Subcommand %s may only be specified once."
msgstr ""
-#: src/language/lexer/lexer.c:404
+#: src/language/lexer/lexer.c:412
#, c-format
msgid "missing required subcommand %s"
msgstr ""
-#: src/language/lexer/lexer.c:433
+#: src/language/lexer/lexer.c:441
#, c-format
msgid "Syntax error %s at %s."
msgstr ""
-#: src/language/lexer/lexer.c:436
+#: src/language/lexer/lexer.c:444
#, c-format
msgid "Syntax error at %s."
msgstr ""
-#: src/language/lexer/lexer.c:554 src/language/lexer/lexer.c:571
+#: src/language/lexer/lexer.c:562 src/language/lexer/lexer.c:579
#, c-format
msgid "expecting `%s'"
msgstr ""
-#: src/language/lexer/lexer.c:613
+#: src/language/lexer/lexer.c:621
msgid "expecting number"
msgstr ""
-#: src/language/lexer/lexer.c:627
+#: src/language/lexer/lexer.c:635
msgid "expecting identifier"
msgstr ""
-#: src/language/lexer/lexer.c:1003
+#: src/language/lexer/lexer.c:1020
msgid "binary"
msgstr ""
-#: src/language/lexer/lexer.c:1008
+#: src/language/lexer/lexer.c:1025
msgid "octal"
msgstr ""
-#: src/language/lexer/lexer.c:1013
+#: src/language/lexer/lexer.c:1030
msgid "hex"
msgstr ""
-#: src/language/lexer/lexer.c:1023
+#: src/language/lexer/lexer.c:1040
#, c-format
msgid "String of %s digits has %d characters, which is not a multiple of %d."
msgstr ""
-#: src/language/lexer/lexer.c:1052
+#: src/language/lexer/lexer.c:1069
#, c-format
msgid "`%c' is not a valid %s digit."
msgstr ""
-#: src/language/lexer/lexer.c:1083
+#: src/language/lexer/lexer.c:1100
msgid "Unterminated string constant."
msgstr ""
-#: src/language/lexer/lexer.c:1137
+#: src/language/lexer/lexer.c:1154
msgid "Unexpected end of file in string concatenation."
msgstr ""
-#: src/language/lexer/lexer.c:1145
+#: src/language/lexer/lexer.c:1162
msgid "String expected following `+'."
msgstr ""
-#: src/language/lexer/lexer.c:1158
+#: src/language/lexer/lexer.c:1175
#, c-format
msgid "String exceeds 255 characters in length (%d characters)."
msgstr ""
-#: src/language/lexer/lexer.c:1173
+#: src/language/lexer/lexer.c:1190
msgid ""
"Sorry, literal strings may not contain null characters. Replacing with "
"spaces."
msgid "Closing `%s': %s."
msgstr ""
-#: src/language/line-buffer.c:447
+#: src/language/line-buffer.c:446
#, c-format
msgid "opening \"%s\" as syntax file"
msgstr ""
-#: src/language/line-buffer.c:452
+#: src/language/line-buffer.c:451
#, c-format
msgid "Opening `%s': %s."
msgstr ""
-#: src/language/line-buffer.c:465
+#: src/language/line-buffer.c:464
#, c-format
msgid "Reading `%s': %s."
msgstr ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: pspp-dev@gnu.org\n"
-"POT-Creation-Date: 2006-10-26 14:25+0800\n"
+"POT-Creation-Date: 2006-10-26 16:30+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
#: src/language/command.c:802 src/language/data-io/matrix-data.c:539
#: src/language/data-io/print-space.c:75 src/language/dictionary/vector.c:203
-#: src/language/lexer/lexer.c:448 src/language/stats/autorecode.c:154
+#: src/language/lexer/lexer.c:456 src/language/stats/autorecode.c:154
#: src/language/xforms/select-if.c:62
msgid "expecting end of command"
msgstr ""
"specified."
msgstr ""
-#: src/language/control/repeat.c:393
+#: src/language/control/repeat.c:399
#, c-format
msgid "%ld TO %ld is an invalid range."
msgstr ""
-#: src/language/control/repeat.c:429
+#: src/language/control/repeat.c:435
msgid "String expected."
msgstr ""
-#: src/language/control/repeat.c:448
+#: src/language/control/repeat.c:454
msgid "No matching DO REPEAT."
msgstr ""
"by itself on a single line with exactly one space between words."
msgstr ""
-#: src/language/data-io/data-reader.c:206
-#: src/language/data-io/data-reader.c:218
+#: src/language/data-io/data-reader.c:207
+#: src/language/data-io/data-reader.c:219
#, c-format
msgid "Error reading file %s: %s."
msgstr ""
-#: src/language/data-io/data-reader.c:221
+#: src/language/data-io/data-reader.c:222
#, c-format
msgid "%s: Partial record at end of file."
msgstr ""
-#: src/language/data-io/data-reader.c:272
+#: src/language/data-io/data-reader.c:273
#, c-format
msgid "Attempt to read beyond end-of-file on file %s."
msgstr ""
-#: src/language/data-io/data-reader.c:275
+#: src/language/data-io/data-reader.c:276
msgid "Attempt to read beyond END DATA."
msgstr ""
-#: src/language/data-io/data-reader.c:433
+#: src/language/data-io/data-reader.c:434
msgid ""
"This command is not valid here since the current input program does not "
"access the inline file."
"s."
msgstr ""
-#: src/language/dictionary/value-labels.c:158 src/language/lexer/lexer.c:585
+#: src/language/dictionary/value-labels.c:158 src/language/lexer/lexer.c:593
msgid "expecting string"
msgstr ""
-#: src/language/dictionary/value-labels.c:167 src/language/lexer/lexer.c:599
+#: src/language/dictionary/value-labels.c:167 src/language/lexer/lexer.c:607
msgid "expecting integer"
msgstr ""
msgid "expecting format type"
msgstr ""
-#: src/language/lexer/lexer.c:259
+#: src/language/lexer/lexer.c:267
#, c-format
msgid "%s does not form a valid number."
msgstr ""
-#: src/language/lexer/lexer.c:363
+#: src/language/lexer/lexer.c:371
#, c-format
msgid "Bad character in input: `%c'."
msgstr ""
-#: src/language/lexer/lexer.c:365
+#: src/language/lexer/lexer.c:373
#, c-format
msgid "Bad character in input: `\\%o'."
msgstr ""
-#: src/language/lexer/lexer.c:396
+#: src/language/lexer/lexer.c:404
#, c-format
msgid "Subcommand %s may only be specified once."
msgstr ""
-#: src/language/lexer/lexer.c:404
+#: src/language/lexer/lexer.c:412
#, c-format
msgid "missing required subcommand %s"
msgstr ""
-#: src/language/lexer/lexer.c:433
+#: src/language/lexer/lexer.c:441
#, c-format
msgid "Syntax error %s at %s."
msgstr ""
-#: src/language/lexer/lexer.c:436
+#: src/language/lexer/lexer.c:444
#, c-format
msgid "Syntax error at %s."
msgstr ""
-#: src/language/lexer/lexer.c:554 src/language/lexer/lexer.c:571
+#: src/language/lexer/lexer.c:562 src/language/lexer/lexer.c:579
#, c-format
msgid "expecting `%s'"
msgstr ""
-#: src/language/lexer/lexer.c:613
+#: src/language/lexer/lexer.c:621
msgid "expecting number"
msgstr ""
-#: src/language/lexer/lexer.c:627
+#: src/language/lexer/lexer.c:635
msgid "expecting identifier"
msgstr ""
-#: src/language/lexer/lexer.c:1003
+#: src/language/lexer/lexer.c:1020
msgid "binary"
msgstr ""
-#: src/language/lexer/lexer.c:1008
+#: src/language/lexer/lexer.c:1025
msgid "octal"
msgstr ""
-#: src/language/lexer/lexer.c:1013
+#: src/language/lexer/lexer.c:1030
msgid "hex"
msgstr ""
-#: src/language/lexer/lexer.c:1023
+#: src/language/lexer/lexer.c:1040
#, c-format
msgid "String of %s digits has %d characters, which is not a multiple of %d."
msgstr ""
-#: src/language/lexer/lexer.c:1052
+#: src/language/lexer/lexer.c:1069
#, c-format
msgid "`%c' is not a valid %s digit."
msgstr ""
-#: src/language/lexer/lexer.c:1083
+#: src/language/lexer/lexer.c:1100
msgid "Unterminated string constant."
msgstr ""
-#: src/language/lexer/lexer.c:1137
+#: src/language/lexer/lexer.c:1154
msgid "Unexpected end of file in string concatenation."
msgstr ""
-#: src/language/lexer/lexer.c:1145
+#: src/language/lexer/lexer.c:1162
msgid "String expected following `+'."
msgstr ""
-#: src/language/lexer/lexer.c:1158
+#: src/language/lexer/lexer.c:1175
#, c-format
msgid "String exceeds 255 characters in length (%d characters)."
msgstr ""
-#: src/language/lexer/lexer.c:1173
+#: src/language/lexer/lexer.c:1190
msgid ""
"Sorry, literal strings may not contain null characters. Replacing with "
"spaces."
msgid "Closing `%s': %s."
msgstr ""
-#: src/language/line-buffer.c:447
+#: src/language/line-buffer.c:446
#, c-format
msgid "opening \"%s\" as syntax file"
msgstr ""
-#: src/language/line-buffer.c:452
+#: src/language/line-buffer.c:451
#, c-format
msgid "Opening `%s': %s."
msgstr ""
-#: src/language/line-buffer.c:465
+#: src/language/line-buffer.c:464
#, c-format
msgid "Reading `%s': %s."
msgstr ""
+Sat Oct 28 16:15:56 WST 2006 John Darrington <john@darrington.wattle.id.au>
+
+ * linebuffer.c linebuffer.h: Moved getl_buf from here, into
+ lexer/lexer.c
+
Thu Oct 26 20:19:00 2006 Ben Pfaff <blp@gnu.org>
* command.def: Add DEBUG FLOAT FORMAT.
+Sat Oct 28 16:18:48 WST 2006 John Darrington <john@darrington.wattle.id.au>
+
+ * repeat.c: Eliminated references to extern variable getl_buf.
+
Sun May 7 18:18:33 2006 Ben Pfaff <blp@gnu.org>
Fix memory leaks.
const char *cur_file_name;
int cur_line_number;
struct line_list *line;
+ struct string cur_line_copy;
bool dot;
- if (!getl_read_line (NULL))
+ if (! lex_get_line_raw ())
return false;
/* If the current file has changed then record the fact. */
|| !strcmp (cur_file_name, previous_file_name))
previous_file_name = pool_strdup (block->pool, cur_file_name);
- ds_rtrim (&getl_buf, ss_cstr (CC_SPACES));
- dot = ds_chomp (&getl_buf, get_endcmd ());
- if (recognize_do_repeat (ds_cstr (&getl_buf)))
+ ds_init_string (&cur_line_copy, lex_entire_line_ds () );
+ ds_rtrim (&cur_line_copy, ss_cstr (CC_SPACES));
+ dot = ds_chomp (&cur_line_copy, get_endcmd ());
+
+ if (recognize_do_repeat (ds_cstr (&cur_line_copy)))
nesting_level++;
- else if (recognize_end_repeat (ds_cstr (&getl_buf), &block->print))
+ else if (recognize_end_repeat (ds_cstr (&cur_line_copy), &block->print))
{
if (nesting_level-- == 0)
{
lex_discard_line ();
+ ds_destroy (&cur_line_copy);
return true;
}
}
if (dot)
- ds_put_char (&getl_buf, get_endcmd ());
+ ds_put_char (&cur_line_copy, get_endcmd ());
line = *last_line = pool_alloc (block->pool, sizeof *line);
line->next = NULL;
line->file_name = previous_file_name;
line->line_number = cur_line_number;
- line->line = pool_strdup (block->pool, ds_cstr (&getl_buf));
+ line->line = pool_strdup (block->pool, ds_cstr (&cur_line_copy) );
last_line = &line->next;
+
+ ds_destroy (&cur_line_copy);
}
lex_discard_line ();
return NULL;
}
-/* Makes appropriate DO REPEAT macro substitutions within getl_buf. */
+/* Makes appropriate DO REPEAT macro substitutions within the
+ repeated lines. */
static void
do_repeat_filter (struct string *line, void *block_)
{
+Sat Oct 28 16:19:57 WST 2006 John Darrington <john@darrington.wattle.id.au>
+
+ * data-reader.c: Eliminated references to extern variable getl_buf
+
Sat Aug 5 08:25:07 2006 Ben Pfaff <blp@gnu.org>
Fix bug #17329 in REREAD parsing, reported by John Darrington.
getl_set_prompt_style (GETL_PROMPT_DATA);
}
- if (!getl_read_line (NULL))
+ if (!lex_get_line_raw ())
{
msg (SE, _("Unexpected end-of-file while reading data in BEGIN "
"DATA. This probably indicates "
return false;
}
- if (ds_length (&getl_buf) >= 8
- && !strncasecmp (ds_cstr (&getl_buf), "end data", 8))
+ if (ds_length (lex_entire_line_ds() ) >= 8
+ && !strncasecmp (lex_entire_line (), "end data", 8))
{
- lex_set_prog (ds_end (&getl_buf));
+ lex_discard_line ();
return false;
}
- ds_assign_string (&r->line, &getl_buf);
+ ds_assign_string (&r->line, lex_entire_line_ds () );
+
return true;
}
+Sat Oct 28 16:17:18 WST 2006 John Darrington <john@darrington.wattle.id.au>
+
+ * lexer.c lexer.h: Added a line_buffer (previously an external
+ reference called getl_buf).
+
Thu Oct 26 20:18:03 2006 Ben Pfaff <blp@gnu.org>
* lexer.c (parse_string): Make lexing of binary, hex, and octal
\f
/* Static variables. */
-/* Pointer to next token in getl_buf. */
+/* Pointer to next token in line_buffer. */
static char *prog;
/* True only if this line ends with a terminal dot. */
\f
/* Initialization. */
+static struct string line_buffer;
+
+static bool (*lex_read_line) (struct string *, bool *);
+
/* Initializes the lexer. */
void
-lex_init (void)
+lex_init (bool (*read_line_func) (struct string *, bool *))
{
ds_init_empty (&tokstr);
ds_init_empty (&put_tokstr);
+ ds_init_empty (&line_buffer);
+ lex_read_line = read_line_func;
+
if (!lex_get_line ())
eof = true;
}
{
ds_destroy (&put_tokstr);
ds_destroy (&tokstr);
+ ds_destroy (&line_buffer);
}
\f
const char *
lex_entire_line (void)
{
- return ds_cstr (&getl_buf);
+ return ds_cstr (&line_buffer);
+}
+
+const struct string *
+lex_entire_line_ds (void)
+{
+ return &line_buffer;
}
/* As lex_entire_line(), but only returns the part of the current line
void
lex_discard_line (void)
{
- prog = ds_end (&getl_buf);
+ ds_cstr (&line_buffer); /* Ensures ds_end points to something valid */
+ prog = ds_end (&line_buffer);
dot = false;
put_token = 0;
}
-/* Sets the current position in the current line to P, which must be
- in getl_buf. */
-void
-lex_set_prog (char *p)
-{
- prog = p;
-}
/* Discards the rest of the current command.
When we're reading commands from a file, we skip tokens until
}
}
+/* Reads a line, without performing any preprocessing */
+bool
+lex_get_line_raw (void)
+{
+ bool dummy;
+ return lex_read_line (&line_buffer, &dummy);
+}
+
/* Reads a line for use by the tokenizer, and preprocesses it by
removing comments, stripping trailing whitespace and the
terminal dot, and removing leading indentors. */
bool
lex_get_line (void)
{
- struct string *line = &getl_buf;
+ struct string *line = &line_buffer;
bool interactive;
- if (!getl_read_line (&interactive))
+ if (!lex_read_line (line, &interactive))
return false;
strip_comments (line);
if (put_token == '.')
break;
- prog = ds_end (&getl_buf);
+ ds_cstr (&line_buffer); /* Ensures ds_end will point to a valid char */
+ prog = ds_end (&line_buffer);
if (dot)
break;
}
#include <stddef.h>
/* Initialization. */
-void lex_init (void);
+void lex_init (bool (*)(struct string *, bool*));
void lex_done (void);
/* Common functions. */
/* Weird line processing functions. */
const char *lex_entire_line (void);
+const struct string *lex_entire_line_ds (void);
const char *lex_rest_of_line (int *end_dot);
void lex_discard_line (void);
-void lex_set_prog (char *p);
void lex_discard_rest_of_command (void);
/* Weird line reading functions. */
bool lex_get_line (void);
+bool lex_get_line_raw (void);
/* Token names. */
const char *lex_token_name (int);
static struct string getl_include_path;
-struct string getl_buf;
static void close_source (void);
static void uninit_prompts (void);
static enum getl_prompt_style get_prompt_style (void);
+
/* Initialize getl. */
void
getl_initialize (void)
{
ds_init_cstr (&getl_include_path,
fn_getenv_default ("STAT_INCLUDE_PATH", include_path));
- ds_init_empty (&getl_buf);
init_prompts ();
}
+
/* Delete everything from the include path. */
void
getl_clear_include_path (void)
{
while (cur_source != NULL)
close_source ();
- ds_destroy (&getl_buf);
ds_destroy (&getl_include_path);
free(file_loc);
file_loc = NULL;
If INTERACTIVE is non-null, then when true is returned
*INTERACTIVE will be set to true if the line was obtained
interactively, false otherwise. */
-static bool
+bool
do_read_line (struct string *line, bool *interactive)
{
while (cur_source != NULL)
return false;
}
-/* Reads a single line into getl_buf.
- Returns true when a line has been read, false at end of input.
- If INTERACTIVE is non-null, then when true is returned
- *INTERACTIVE will be set to true if the line was obtained
- interactively, false otherwise. */
-bool
-getl_read_line (bool *interactive)
-{
- return do_read_line (&getl_buf, interactive);
-}
\f
/* Current prompts in each style. */
static char *prompts[GETL_PROMPT_CNT];
GETL_PROMPT_CNT
};
-/* Current line. This line may be modified by modules other than
- getl.c, and by lexer.c in particular. (Ugh.) */
-extern struct string getl_buf;
void getl_initialize (void);
void getl_uninitialize (void);
void getl_location (const char **fn, int *ln);
+bool do_read_line (struct string *line, bool *interactive);
+
#endif /* line-buffer.h */
if (parse_command_line (argc, argv))
{
outp_read_devices ();
- lex_init ();
+ lex_init (do_read_line);
for (;;)
{
VECTOR v(6).
COMPUTE #idx = 0.
-DO REPEAT a = 1 TO 2.
- DO REPEAT b = 3 TO 5.
- COMPUTE #x = a + b.
+DO REPEAT i = 1 TO 2.
+ DO REPEAT j = 3 TO 5.
+ COMPUTE #x = i + j.
COMPUTE #idx = #idx + 1.
COMPUTE v(#idx) = #x.
END REPEAT.
if [ $? -ne 0 ] ; then no_result ; fi
activity="run program"
-$SUPERVISOR $PSPP --testing-mode -o raw-ascii $TESTFILE >/dev/null 2>&1
+$SUPERVISOR $PSPP --testing-mode -o raw-ascii $TESTFILE
if [ $? -ne 0 ] ; then no_result ; fi
activity="compare results"