Fixing copyright issues and code contributors
[alexxy/gromacs.git] / src / gmxlib / selection / scanner.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5  * Copyright (c) 2001-2009, The GROMACS development team,
6  * check out http://www.gromacs.org for more information.
7  * Copyright (c) 2012,2013, by the GROMACS development team, led by
8  * David van der Spoel, Berk Hess, Erik Lindahl, and including many
9  * others, as listed in the AUTHORS file in the top-level source
10  * directory and at http://www.gromacs.org.
11  *
12  * GROMACS is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public License
14  * as published by the Free Software Foundation; either version 2.1
15  * of the License, or (at your option) any later version.
16  *
17  * GROMACS is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with GROMACS; if not, see
24  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
26  *
27  * If you want to redistribute modifications to GROMACS, please
28  * consider that scientific software is very special. Version
29  * control is crucial - bugs must be traceable. We will be happy to
30  * consider code for inclusion in the official distribution, but
31  * derived work must not be called official GROMACS. Details are found
32  * in the README & COPYING files - if they are missing, get the
33  * official version at http://www.gromacs.org.
34  *
35  * To help us fund GROMACS development, we humbly ask that you cite
36  * the research papers on the package. Check out http://www.gromacs.org.
37  */
38 /*! \internal \file
39  * \brief
40  * Parser/scanner interaction functions.
41  *
42  * This is an implementation header: there should be no need to use it outside
43  * this directory.
44  */
45 #ifndef SELECTION_SCANNER_H
46 #define SELECTION_SCANNER_H
47
48 #include "parser.h"
49
50 struct gmx_ana_indexgrps_t;
51 struct gmx_ana_selcollection_t;
52
53 #ifndef YY_TYPEDEF_YY_SCANNER_T
54 #define YY_TYPEDEF_YY_SCANNER_T
55 typedef void *yyscan_t;
56 #endif
57
58 /** Initializes the selection scanner. */
59 int
60 _gmx_sel_init_lexer(yyscan_t *scannerp, struct gmx_ana_selcollection_t *sc,
61                     gmx_bool bInteractive, int maxnr,
62                     struct gmx_ana_indexgrps_t *grps);
63 /** Frees memory allocated for the selection scanner. */
64 void
65 _gmx_sel_free_lexer(yyscan_t scanner);
66
67 /** Returns TRUE if the scanner is interactive. */
68 gmx_bool
69 _gmx_sel_is_lexer_interactive(yyscan_t scanner);
70 /** Returns the selection collection for the scanner. */
71 struct gmx_ana_selcollection_t *
72 _gmx_sel_lexer_selcollection(yyscan_t scanner);
73 /** Returns the external index groups for the scanner. */
74 struct gmx_ana_indexgrps_t *
75 _gmx_sel_lexer_indexgrps(yyscan_t scanner);
76 /** Returns the number of selections after which the parser should stop. */
77 int
78 _gmx_sel_lexer_exp_selcount(yyscan_t scanner);
79
80 /** Returns a pretty string of the current selection.  */
81 const char *
82 _gmx_sel_lexer_pselstr(yyscan_t scanner);
83 /** Clears the current selection string.  */
84 void
85 _gmx_sel_lexer_clear_pselstr(yyscan_t scanner);
86 /** Clears the method stack in the scanner in error situations. */
87 void
88 _gmx_sel_lexer_clear_method_stack(yyscan_t scanner);
89 /** Notifies the scanner that a complete method expression has been parsed. */
90 void
91 _gmx_sel_finish_method(yyscan_t scanner);
92 /** Initializes the scanner to scan a file. */
93 void
94 _gmx_sel_set_lex_input_file(yyscan_t scanner, FILE *fp);
95 /** Initializes the scanner to scan a string. */
96 void
97 _gmx_sel_set_lex_input_str(yyscan_t scanner, const char *str);
98
99 /** A wrapper for the actual scanner, used by the Bison parser. */
100 int
101 _gmx_sel_yyblex(YYSTYPE *yylval, yyscan_t yyscanner);
102
103 #endif