Replace scoped_cptr with unique_cptr
[alexxy/gromacs.git] / src / gromacs / selection / parser.y
index c5b989885f0c1b35fa524408deaf600914c65aa0..5f8197db4741d9d3dff591e471f518618331f1b7 100644 (file)
 #include "gmxpre.h"
 }
 %{
-#include "gromacs/utility/scoped_cptr.h"
+#include "gromacs/utility/unique_cptr.h"
 
 #include "parser_internal.h"
 
-using gmx::scoped_guard_sfree;
+using gmx::sfree_guard;
 using gmx::SelectionParserValue;
 using gmx::SelectionParserValueList;
 using gmx::SelectionParserValueListPointer;
@@ -254,7 +254,7 @@ cmd_plain:   /* empty */
            | string
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree nameGuard($1);
+                 const sfree_guard nameGuard($1);
                  SelectionTreeElementPointer s
                         = _gmx_sel_init_group_by_name($1, scanner);
                  SelectionTreeElementPointer p
@@ -272,28 +272,28 @@ cmd_plain:   /* empty */
            | STR selection
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree nameGuard($1);
+                 const sfree_guard nameGuard($1);
                  set($$, _gmx_sel_init_selection($1, get($2), scanner));
                  END_ACTION;
              }
            | IDENTIFIER '=' sel_expr
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree nameGuard($1);
+                 const sfree_guard nameGuard($1);
                  set($$, _gmx_sel_assign_variable($1, get($3), scanner));
                  END_ACTION;
              }
            | IDENTIFIER '=' num_expr
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree nameGuard($1);
+                 const sfree_guard nameGuard($1);
                  set($$, _gmx_sel_assign_variable($1, get($3), scanner));
                  END_ACTION;
              }
            | IDENTIFIER '=' pos_expr
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree nameGuard($1);
+                 const sfree_guard nameGuard($1);
                  set($$, _gmx_sel_assign_variable($1, get($3), scanner));
                  END_ACTION;
              }
@@ -385,7 +385,7 @@ sel_expr:    NOT sel_expr
 sel_expr:    num_expr CMP_OP num_expr
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree opGuard($2);
+                 const sfree_guard opGuard($2);
                  set($$, _gmx_sel_init_comparison(get($1), get($3), $2, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -396,7 +396,7 @@ sel_expr:    num_expr CMP_OP num_expr
 sel_expr:    GROUP string
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree nameGuard($2);
+                 const sfree_guard nameGuard($2);
                  set($$, _gmx_sel_init_group_by_name($2, scanner));
                  END_ACTION;
              }
@@ -424,7 +424,7 @@ str_match_type:
 sel_expr:    pos_mod KEYWORD_GROUP
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard($1);
+                 const sfree_guard posmodGuard($1);
                  set($$, _gmx_sel_init_keyword($2, SelectionParserValueListPointer(), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -432,7 +432,7 @@ sel_expr:    pos_mod KEYWORD_GROUP
            | pos_mod KEYWORD_STR basic_value_list
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard($1);
+                 const sfree_guard posmodGuard($1);
                  set($$, _gmx_sel_init_keyword_strmatch($2, gmx::eStringMatchType_Auto, get($3), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -440,7 +440,7 @@ sel_expr:    pos_mod KEYWORD_GROUP
            | pos_mod KEYWORD_STR str_match_type basic_value_list
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard($1);
+                 const sfree_guard posmodGuard($1);
                  set($$, _gmx_sel_init_keyword_strmatch($2, $3, get($4), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -448,7 +448,7 @@ sel_expr:    pos_mod KEYWORD_GROUP
            | pos_mod KEYWORD_NUMERIC basic_value_list
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard($1);
+                 const sfree_guard posmodGuard($1);
                  set($$, _gmx_sel_init_keyword($2, get($3), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -459,7 +459,7 @@ sel_expr:    pos_mod KEYWORD_GROUP
 sel_expr:    pos_mod METHOD_GROUP method_params
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard($1);
+                 const sfree_guard posmodGuard($1);
                  set($$, _gmx_sel_init_method($2, get($3), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -499,7 +499,7 @@ num_expr:    TOK_INT
 num_expr:    pos_mod KEYWORD_NUMERIC    %prec NUM_REDUCT
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard($1);
+                 const sfree_guard posmodGuard($1);
                  set($$, _gmx_sel_init_keyword($2, SelectionParserValueListPointer(), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -507,7 +507,7 @@ num_expr:    pos_mod KEYWORD_NUMERIC    %prec NUM_REDUCT
            | pos_mod KEYWORD_NUMERIC OF pos_expr
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard($1);
+                 const sfree_guard posmodGuard($1);
                  set($$, _gmx_sel_init_keyword_of($2, get($4), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -515,7 +515,7 @@ num_expr:    pos_mod KEYWORD_NUMERIC    %prec NUM_REDUCT
            | pos_mod METHOD_NUMERIC method_params
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard($1);
+                 const sfree_guard posmodGuard($1);
                  set($$, _gmx_sel_init_method($2, get($3), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -580,7 +580,7 @@ str_expr:    string
            | pos_mod KEYWORD_STR
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard($1);
+                 const sfree_guard posmodGuard($1);
                  set($$, _gmx_sel_init_keyword($2, SelectionParserValueListPointer(), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -618,7 +618,7 @@ pos_expr:    METHOD_POS method_params
 pos_expr:    KEYWORD_POS OF sel_expr    %prec PARAM_REDUCT
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree keywordGuard($1);
+                 const sfree_guard keywordGuard($1);
                  set($$, _gmx_sel_init_position(get($3), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -685,7 +685,7 @@ method_param:
              PARAM value_list
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree nameGuard($1);
+                 const sfree_guard nameGuard($1);
                  set($$, SelectionParserParameter::create($1, get($2), @$));
                  END_ACTION;
              }
@@ -793,7 +793,7 @@ basic_value_item:
            | string              %prec PARAM_REDUCT
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree stringGuard($1);
+                 const sfree_guard stringGuard($1);
                  set($$, SelectionParserValue::createString($1, @$));
                  END_ACTION;
              }