Apply clang-format to source tree
[alexxy/gromacs.git] / src / gromacs / selection / scanner_internal.h
index 6ee5a051b4a3f031e72f84b15519cfbdc8361452..3cae7ac609fff681342fdb62f1a89d0a9ff958aa 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2014,2015,2016,2018, by the GROMACS development team, led by
+ * Copyright (c) 2009-2018, The GROMACS development team.
+ * Copyright (c) 2019, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -50,21 +51,21 @@ namespace gmx
 {
 class SelectionParserSymbol;
 class TextWriter;
-}
+} // namespace gmx
 
 /* These need to be defined before including scanner_flex.h, because it
  * uses YY_EXTRA_TYPE. But we also need to include it before defining
  * gmx_sel_lexer_t; hence the forward declaration. */
 struct gmx_sel_lexer_t;
-#define YY_EXTRA_TYPE struct gmx_sel_lexer_t *
+#define YY_EXTRA_TYPE struct gmx_sel_lexer_t*
 
 /* We cannot include scanner_flex.h from the scanner itself, because it
  * seems to break everything. */
 /* And we need to define YY_NO_UNISTD_H here as well, otherwise unistd.h
  * gets included in other files than scanner.cpp... */
 #ifndef FLEX_SCANNER
-#define YY_NO_UNISTD_H
-#include "scanner_flex.h"
+#    define YY_NO_UNISTD_H
+#    include "scanner_flex.h"
 #endif
 
 /*! \internal \brief
@@ -73,76 +74,76 @@ struct gmx_sel_lexer_t;
 typedef struct gmx_sel_lexer_t
 {
     //! Selection collection to put parsed selections in.
-    struct gmx_ana_selcollection_t  *sc;
+    struct gmx_ana_selcollection_tsc;
     //! Stores an exception that occurred during parsing.
-    std::exception_ptr               exception;
+    std::exception_ptr exception;
     //! Whether external index groups have been set.
-    bool                             bGroups;
+    bool bGroups;
     //! External index groups for resolving \c group keywords.
-    struct gmx_ana_indexgrps_t      *grps;
+    struct gmx_ana_indexgrps_tgrps;
     //! Number of selections at which the parser should stop.
-    int                              nexpsel;
+    int nexpsel;
 
     //! Writer to use for status output (if not NULL, parser is interactive).
-    gmx::TextWriter                 *statusWriter;
+    gmx::TextWriterstatusWriter;
 
     //! Pretty-printed version of the string parsed since last clear.
-    std::string                      pselstr;
+    std::string pselstr;
     /*! \brief
      * Position of the result of the current Bison action.
      *
      * This identifies the part of \a pselstr that corresponds to the
      * subselection that is currently being reduced by Bison.
      */
-    gmx::SelectionLocation           currentLocation;
+    gmx::SelectionLocation currentLocation;
 
     //! Stack of methods in which parameters should be looked up.
-    struct gmx_ana_selmethod_t     **mstack;
+    struct gmx_ana_selmethod_t** mstack;
     //! Index of the top of the stack in \a mstack.
-    int                              msp;
+    int msp;
     //! Number of elements allocated for \a mstack.
-    int                              mstack_alloc;
+    int mstack_alloc;
 
     //! Number of END_OF_METHOD tokens to return before \a nextparam.
-    int                              neom;
+    int neom;
     //! Parameter symbol to return before resuming scanning.
-    struct gmx_ana_selparam_t       *nextparam;
+    struct gmx_ana_selparam_tnextparam;
     //! Whether \a nextparam was a boolean parameter with a 'no' prefix.
-    bool                             bBoolNo;
+    bool bBoolNo;
     /*! \brief
      * Method symbol to return before resuming scanning
      *
      * Only used when \p nextparam is NULL.
      */
-    const gmx::SelectionParserSymbol *nextMethodSymbol;
+    const gmx::SelectionParserSymbolnextMethodSymbol;
     //! Used to track whether the previous token was a position modifier.
-    int                               prev_pos_kw;
+    int prev_pos_kw;
 
     //! Whether the 'of' keyword is acceptable as the next token.
-    bool                             bMatchOf;
+    bool bMatchOf;
     //! Whether boolean values (yes/no/on/off) are acceptable as the next token.
-    bool                             bMatchBool;
+    bool bMatchBool;
     //! Whether the next token starts a new selection.
-    bool                             bCmdStart;
+    bool bCmdStart;
 
     //! Whether an external buffer is set for the scanner.
-    bool                             bBuffer;
+    bool bBuffer;
     //! The current buffer for the scanner.
-    YY_BUFFER_STATE                  buffer;
+    YY_BUFFER_STATE buffer;
 } gmx_sel_lexer_t;
 
 /* Because Flex defines yylval, yytext, and yyleng as macros,
  * and this file is included from scanner.l,
  * we cannot have them here as parameter names... */
 /** Internal function for cases where several tokens need to be returned. */
-int
-_gmx_sel_lexer_process_pending(YYSTYPE * /*yylval*/, YYLTYPE *, gmx_sel_lexer_t *state);
+int _gmx_sel_lexer_process_pending(YYSTYPE* /*yylval*/, YYLTYPE*, gmx_sel_lexer_t* state);
 /** Internal function that processes identifier tokens. */
-int
-    _gmx_sel_lexer_process_identifier(YYSTYPE * /*yylval*/, YYLTYPE *, char * /*yytext*/, size_t /*yyleng*/,
-                                      gmx_sel_lexer_t *state);
+int _gmx_sel_lexer_process_identifier(YYSTYPE* /*yylval*/,
+                                      YYLTYPE*,
+                                      char* /*yytext*/,
+                                      size_t /*yyleng*/,
+                                      gmx_sel_lexer_t* state);
 /** Internal function to add a token to the pretty-printed selection text. */
-void
-_gmx_sel_lexer_add_token(YYLTYPE *, const char *str, int len, gmx_sel_lexer_t *state);
+void _gmx_sel_lexer_add_token(YYLTYPE*, const char* str, int len, gmx_sel_lexer_t* state);
 
 #endif