3 * This source code is part of
7 * GROningen MAchine for Chemical Simulations
9 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
10 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
11 * Copyright (c) 2001-2009, The GROMACS development team,
12 * check out http://www.gromacs.org for more information.
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * If you want to redistribute modifications, please consider that
20 * scientific software is very special. Version control is crucial -
21 * bugs must be traceable. We will be happy to consider code for
22 * inclusion in the official distribution, but derived work must not
23 * be called official GROMACS. Details are found in the README & COPYING
24 * files - if they are missing, get the official version at www.gromacs.org.
26 * To help us fund GROMACS development, we humbly ask that you cite
27 * the papers on the package - you can find them in the top README file.
29 * For more info, check our website at http://www.gromacs.org
33 * Parser/scanner interaction functions.
35 * This is an implementation header: there should be no need to use it outside
38 #ifndef SELECTION_SCANNER_H
39 #define SELECTION_SCANNER_H
43 struct gmx_ana_indexgrps_t
;
44 struct gmx_ana_selcollection_t
;
46 #ifndef YY_TYPEDEF_YY_SCANNER_T
47 #define YY_TYPEDEF_YY_SCANNER_T
48 typedef void *yyscan_t
;
51 /** Initializes the selection scanner. */
53 _gmx_sel_init_lexer(yyscan_t
*scannerp
, struct gmx_ana_selcollection_t
*sc
,
54 bool bInteractive
, int maxnr
,
55 struct gmx_ana_indexgrps_t
*grps
);
56 /** Frees memory allocated for the selection scanner. */
58 _gmx_sel_free_lexer(yyscan_t scanner
);
60 /** Returns TRUE if the scanner is interactive. */
62 _gmx_sel_is_lexer_interactive(yyscan_t scanner
);
63 /** Returns the selection collection for the scanner. */
64 struct gmx_ana_selcollection_t
*
65 _gmx_sel_lexer_selcollection(yyscan_t scanner
);
66 /** Returns the external index groups for the scanner. */
67 struct gmx_ana_indexgrps_t
*
68 _gmx_sel_lexer_indexgrps(yyscan_t scanner
);
69 /** Returns the number of selections after which the parser should stop. */
71 _gmx_sel_lexer_exp_selcount(yyscan_t scanner
);
73 /** Returns a pretty string of the current selection. */
75 _gmx_sel_lexer_pselstr(yyscan_t scanner
);
76 /** Clears the current selection string. */
78 _gmx_sel_lexer_clear_pselstr(yyscan_t scanner
);
79 /** Clears the method stack in the scanner in error situations. */
81 _gmx_sel_lexer_clear_method_stack(yyscan_t scanner
);
82 /** Notifies the scanner that a complete method expression has been parsed. */
84 _gmx_sel_finish_method(yyscan_t scanner
);
85 /** Initializes the scanner to scan a file. */
87 _gmx_sel_set_lex_input_file(yyscan_t scanner
, FILE *fp
);
88 /** Initializes the scanner to scan a string. */
90 _gmx_sel_set_lex_input_str(yyscan_t scanner
, const char *str
);
92 /** A wrapper for the actual scanner, used by the Bison parser. */
94 _gmx_sel_yyblex(YYSTYPE
*yylval
, yyscan_t yyscanner
);