Line data Source code
1 : // Author(s): Wieger Wesselink 2 : // Copyright: see the accompanying file COPYING or copy at 3 : // https://github.com/mCRL2org/mCRL2/blob/master/COPYING 4 : // 5 : // Distributed under the Boost Software License, Version 1.0. 6 : // (See accompanying file LICENSE_1_0.txt or copy at 7 : // http://www.boost.org/LICENSE_1_0.txt) 8 : // 9 : /// \file mcrl2/data/detail/is_untyped.h 10 : /// \brief add your file description here. 11 : 12 : #ifndef MCRL2_DATA_DETAIL_IS_UNTYPED_H 13 : #define MCRL2_DATA_DETAIL_IS_UNTYPED_H 14 : 15 : #include "mcrl2/data/traverser.h" 16 : 17 : namespace mcrl2 { 18 : 19 : namespace data { 20 : 21 : namespace detail { 22 : 23 : struct is_untyped_traverser: public sort_expression_traverser<is_untyped_traverser> 24 : { 25 : typedef sort_expression_traverser<is_untyped_traverser> super; 26 : using super::enter; 27 : using super::leave; 28 : using super::apply; 29 : 30 : bool result; 31 : 32 87 : is_untyped_traverser() 33 87 : : result(false) 34 87 : {} 35 : 36 290 : void apply(const data::untyped_identifier& ) 37 : { 38 290 : result = true; 39 290 : } 40 : 41 0 : void apply(const data::untyped_identifier_assignment& ) 42 : { 43 0 : result = true; 44 0 : } 45 : 46 17 : void apply(const data::untyped_sort& ) 47 : { 48 17 : result = true; 49 17 : } 50 : 51 0 : void apply(const data::untyped_possible_sorts& ) 52 : { 53 0 : result = true; 54 0 : } 55 : 56 0 : void apply(const data::untyped_set_or_bag_comprehension& ) 57 : { 58 0 : result = true; 59 0 : } 60 : 61 : void apply(const data::structured_sort_constructor_argument& ) 62 : { 63 : result = true; 64 : } 65 : 66 0 : void apply(const data::structured_sort_constructor& ) 67 : { 68 0 : result = true; 69 0 : } 70 : }; 71 : 72 : inline 73 87 : bool is_untyped(const data_expression& x) 74 : { 75 87 : is_untyped_traverser f; 76 87 : f.apply(x); 77 87 : return f.result; 78 : } 79 : 80 : } // namespace detail 81 : 82 : } // namespace data 83 : 84 : } // namespace mcrl2 85 : 86 : #endif // MCRL2_DATA_DETAIL_IS_UNTYPED_H