PLA parser

The header <lorina/pla.hpp> implements methods to parse the PLA format.

The class lorina::pla_reader provides the following public member functions.

Function

Description

on_number_of_inputs(number_of_inputs)

Callback method for parsed number of inputs

on_number_of_outputs(number_of_outputs)

Callback method for parsed number of outputs

on_number_of_terms(number_of_terms)

Callback method for parsed number of terms

on_keyword(keyword, value)

Callback method for parsed keyword-value pair

on_end()

Callback method for parsed end

on_term(term, out)

Callback method for parsed terms

The class lorina::pla_writer provides the following public member functions.

Function

Description

on_number_of_inputs(number_of_inputs)

Callback method for writing number of inputs

on_number_of_outputs(number_of_outputs)

Callback method for writing number of outputs

on_number_of_terms(number_of_terms)

Callback method for writing number of terms

on_keyword(keyword, value)

Callback method for writing keyword-value pair

on_end()

Callback method for writing end

on_term(term, out)

Callback method for writing terms

The following reader functions are available.

Function
Description

read_pla

Reader function for the PLA format.

read_pla

Reader function for PLA format.
inline return_code lorina::read_pla(std::istream &in, const pla_reader &reader, diagnostic_engine *diag = nullptr)

Reader function for the PLA format.

Reads PLA format from a stream and invokes a callback method for each parsed primitive and each detected parse error.

Parameters
  • in – Input stream

  • reader – A PLA reader with callback methods invoked for parsed primitives

  • diag – An optional diagnostic engine with callback methods for parse errors

Returns

Success if parsing has been successful, or parse error if parsing has failed

inline return_code lorina::read_pla(const std::string &filename, const pla_reader &reader, diagnostic_engine *diag = nullptr)

Reader function for PLA format.

Reads PLA format from a file and invokes a callback method for each parsed primitive and each detected parse error.

Parameters
  • filename – Name of the file

  • reader – A PLA reader with callback methods invoked for parsed primitives

  • diag – An optional diagnostic engine with callback methods for parse errors

Returns

Success if parsing has been successful, or parse error if parsing has failed