C++ parsing library for simple formats used in logic synthesis and formal verification
Switch branches/tags
Nothing to show
Clone or download
Latest commit 324db45 Oct 26, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs changelog. Oct 18, 2018
examples build system. Sep 30, 2018
include warnings. Sep 30, 2018
lib build system. Sep 30, 2018
test warnings. Sep 30, 2018
.gitignore initial commit. Mar 6, 2018
.gitmodules switched from submodule `rang` to header-only include. Mar 19, 2018
.travis.yml travis. May 14, 2018
CMakeLists.txt AppVeyor. Jun 18, 2018
LICENSE Initial commit Mar 6, 2018
README.md README. Oct 26, 2018
appveyor.yml AppVeyor. Jun 18, 2018
lorina.svg lorina logo Mar 7, 2018

README.md

Build Status Build status Documentation Status Latest release License: MIT

lorina

lorina is a C++ parsing library. It provides implementations of parsers for various simple file formats used in logic synthesis and formal verification.

Read the full documentation.

Example

The following code snippet parses the bench file "network.bench" and calls the methods on_input and on_gate for each input and gate declaration in the file, respectively.

#include <lorina/lorina.hpp>

class reader : public bench_reader
{
public:
  void on_input( const std::string& name ) const override
  {
    /* ... */
  }

  void on_gate( const std::vector<std::string>& inputs, const std::string& output,
                const std::string& type ) const override
  {
    /* ... */
  }
}; /* reader */

auto const result = read_bench( "network.bench", reader() );
assert( result == return_code::success );

Besides parsing, the reader supports a mechanism to react on parse errors.

#include <lorina/diagnostics.hpp>

class diagnostics : public diagnostic_engine
{
public:
  void emit( diagnostic_level level, const std::string& message ) const override
  {
    /* ... */
  }
}; /* diagnostics */

diagnostics diag;
auto const result = read_bench( "network.bench", reader(), &diag );
assert( result == return_code::success );

EPFL logic sythesis libraries

lorina is part of the EPFL logic synthesis libraries. The other libraries and several examples on how to use and integrate the libraries can be found in the logic synthesis tool showcase.