LCOV - code coverage report
Current view: top level - pbes/include/mcrl2/pbes - txt2pbes.h (source / functions) Hit Total Coverage
Test: mcrl2_coverage.info.cleaned Lines: 11 12 91.7 %
Date: 2024-04-19 03:43:27 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : // Author(s): Aad Mathijssen, 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/pbes/txt2pbes.h
      10             : /// \brief Function for parsing a pbes specification.
      11             : 
      12             : #ifndef MCRL2_PBES_TXT2PBES_H
      13             : #define MCRL2_PBES_TXT2PBES_H
      14             : 
      15             : #include "mcrl2/pbes/algorithms.h"
      16             : #include "mcrl2/pbes/io.h"
      17             : #include "mcrl2/pbes/parse.h"
      18             : 
      19             : namespace mcrl2
      20             : {
      21             : 
      22             : namespace pbes_system
      23             : {
      24             : 
      25             : /// \brief Parses a PBES specification from an input stream
      26             : /// \param spec_stream A stream from which can be read
      27             : /// \param normalize  If true, the resulting PBES is normalized after reading.
      28             : /// \return The parsed PBES
      29             : inline
      30         181 : pbes txt2pbes(std::istream& spec_stream, bool normalize = true)
      31             : {
      32         181 :   pbes result;
      33         181 :   spec_stream >> result;
      34         181 :   if (normalize)
      35             :   {
      36         124 :     mCRL2log(log::verbose) << "normalizing the PBES ..." << std::endl;
      37         124 :     pbes_system::algorithms::normalize(result);
      38             :   }
      39         181 :   return result;
      40           0 : }
      41             : 
      42             : /// \brief Parses a PBES specification from a string
      43             : /// \param text A string
      44             : /// \param normalize  If true, the resulting PBES is normalized after reading.
      45             : /// \return The parsed PBES
      46             : inline
      47         181 : pbes txt2pbes(const std::string& text, bool normalize = true)
      48             : {
      49         181 :   std::stringstream from(text);
      50         362 :   return txt2pbes(from, normalize);
      51         181 : }
      52             : 
      53             : } // namespace pbes_system
      54             : 
      55             : } // namespace mcrl2
      56             : 
      57             : #endif // MCRL2_PBES_TXT2PBES_H

Generated by: LCOV version 1.14