Fixed memory handling issues in selections.
[gromacs/qmmm-gamess-us.git] / src / gmxlib / selection / scanner.h
blob1999f5021868dfb21c5ef845f62a50948d640f5e
1 /*
3 * This source code is part of
5 * G R O M A C S
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
31 /*! \internal \file
32 * \brief
33 * Parser/scanner interaction functions.
35 * This is an implementation header: there should be no need to use it outside
36 * this directory.
38 #ifndef SELECTION_SCANNER_H
39 #define SELECTION_SCANNER_H
41 #include "parser.h"
43 struct gmx_ana_selcollection_t;
45 #ifndef YY_TYPEDEF_YY_SCANNER_T
46 #define YY_TYPEDEF_YY_SCANNER_T
47 typedef void *yyscan_t;
48 #endif
50 /** Initializes the selection scanner. */
51 int
52 _gmx_sel_init_lexer(yyscan_t *scannerp, struct gmx_ana_selcollection_t *sc,
53 bool bInteractive);
54 /** Frees memory allocated for the selection scanner. */
55 void
56 _gmx_sel_free_lexer(yyscan_t scanner);
57 /** Returns TRUE if the scanner is interactive. */
58 bool
59 _gmx_sel_is_lexer_interactive(yyscan_t scanner);
60 /** Returns the selection collection for the scanner. */
61 struct gmx_ana_selcollection_t *
62 _gmx_sel_lexer_selcollection(yyscan_t scanner);
63 /** Returns a pretty string of the current selection. */
64 const char *
65 _gmx_sel_lexer_pselstr(yyscan_t scanner);
66 /** Clears the current selection string. */
67 void
68 _gmx_sel_lexer_clear_pselstr(yyscan_t scanner);
69 /** Notifies the scanner that a complete method expression has been parsed. */
70 void
71 _gmx_sel_finish_method(yyscan_t scanner);
72 /** Initializes the scanner to scan a file. */
73 void
74 _gmx_sel_set_lex_input_file(yyscan_t scanner, FILE *fp);
75 /** Initializes the scanner to scan a string. */
76 void
77 _gmx_sel_set_lex_input_str(yyscan_t scanner, const char *str);
79 /** The scanning function generated by Flex. */
80 int
81 _gmx_sel_yylex(YYSTYPE *yylval, yyscan_t yyscanner);
82 #define YY_DECL int _gmx_sel_yylex(YYSTYPE *yylval, yyscan_t yyscanner)
84 #endif