spot 2.3.4

- Main Page
- Related Pages
- Modules
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Public Member Functions | Public Attributes | List of all members
spot::parsed_formula Struct Referencefinal
Temporal Logic » Input and Output of Formulas

The result of a formula parser. More...

`#include <spot/tl/parse.hh>`

Collaboration diagram for spot::parsed_formula:

## Public Member Functions
| parsed_formula (const std::string &str="")
bool | format_errors (std::ostream &os)
| Format diagnostics. More...
bool | format_errors (std::ostream &os, const std::string &input, unsigned shift)
| Format shifted diagnostics. More...

## Public Attributes
formula | f = nullptr
| The parsed formula. More...
std::string | input
| The input text, before parsing. More...
parse_error_list | errors
| Syntax errors that occurred during parsing. More...

## Detailed Description

The result of a formula parser.

## Member Function Documentation

bool spot::parsed_formula::format_errors | ( | std::ostream & | os | ) |

Format diagnostics.

Parameters

  os | Where diagnostics should be output.

Returns
  `true` iff any diagnostic was output.

bool spot::parsed_formula::format_errors | ( | std::ostream & | os,
|  | const std::string & | input,
|  | unsigned | shift
| ) |  |

Format shifted diagnostics.

If the user input was something like "formula = a U b;" but you only passed "a U b" to the parser, it might be convenient to display the diagnostic in the context of "formula = a U b;".

So pass the real input as input, and specify the number of character to skip before the actual text passed to the parser starts.

This procedure assumes that the text passed to the parser appears as-is in the input string. If you had to un-escape it in any way, the error locations will be wrong.

Parameters

  os | Where diagnostics should be output.
  input | the real input string
  shift | how many characters to add to the error locations

Returns
  `true` iff any diagnostic was output.

## Member Data Documentation

parse_error_list spot::parsed_formula::errors

Syntax errors that occurred during parsing.

Note that the parser does not print any diagnostic. Deciding how to output those errors is up to you.

See also
  format_errors

formula spot::parsed_formula::f = nullptr

The parsed formula.

This could be formula(nullptr) in case of a serious parse error.

std::string spot::parsed_formula::input

The input text, before parsing.

The documentation for this struct was generated from the following file:

- spot/tl/parse.hh

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.