1 /* PSPP - computes sample statistics.
2 Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 #include <libpspp/ll.h>
29 /* Syntax rules that apply to a given source line. */
32 /* Each line that begins in column 1 starts a new command. A
33 `+' or `-' in column 1 is ignored to allow visual
34 indentation of new commands. Continuation lines must be
35 indented from the left margin. A period at the end of a
36 line does end a command, but it is optional. */
39 /* Each command must end in a period or in a blank line. */
43 /* An abstract base class for objects which act as line buffers for the
44 PSPP. Ie anything which might contain content for the lexer */
47 /* Returns true if the interface is interactive, that is, if
48 it prompts a human user. This property is independent of
49 the syntax mode returned by the read member function. */
50 bool (*interactive) (const struct getl_interface *);
52 /* Read a line the intended syntax mode from the interface.
53 Returns true if succesful, false on failure or at end of
55 bool (*read) (struct getl_interface *,
56 struct string *, enum getl_syntax *);
58 /* Close and destroy the interface */
59 void (*close) (struct getl_interface *);
61 /* Filter for current and all included sources, which may
62 modify the line. Usually null. */
63 void (*filter) (struct getl_interface *,
64 struct string *line, enum getl_syntax);
66 /* Returns the name of the source */
67 const char * (*name) (const struct getl_interface *);
69 /* Returns the current location within the source */
70 int (*location) (const struct getl_interface *);
75 struct source_stream * create_source_stream (const char *);
76 void destroy_source_stream (struct source_stream *);
78 void getl_clear_include_path (struct source_stream *);
79 void getl_add_include_dir (struct source_stream *, const char *);
80 const char * getl_include_path (const struct source_stream *);
82 void getl_abort_noninteractive (struct source_stream *);
83 bool getl_is_interactive (const struct source_stream *);
85 bool getl_read_line (struct source_stream *, struct string *,
88 void getl_append_source (struct source_stream *, struct getl_interface *s) ;
89 void getl_include_source (struct source_stream *, struct getl_interface *s) ;
91 const char * getl_source_name (const struct source_stream *);
92 int getl_source_location (const struct source_stream *);
94 #endif /* line-buffer.h */