Geogram Version 1.10.2
A programming library of geometric algorithms
Loading...
Searching...
No Matches
GEO::BooleanExpression Class Reference

A simple parser for boolean expressions. More...

#include <geogram/basic/boolean_expression.h>

Classes

struct  Context
 Stores the state of a current parsing operation. More...

Public Member Functions

 BooleanExpression (const std::string &expr)
 Constructs a boolean expression.
bool operator() (index_t x) const
 Evaluates the boolean expression.

Protected Member Functions

bool parse_or (Context &C) const
bool parse_and (Context &C) const
bool parse_factor (Context &C) const
bool parse_variable (Context &C) const

Detailed Description

A simple parser for boolean expressions.

Definition at line 57 of file boolean_expression.h.

Constructor & Destructor Documentation

◆ BooleanExpression()

GEO::BooleanExpression::BooleanExpression ( const std::string & expr)

Constructs a boolean expression.

Parameters
[in]exprthe expression, with the following syntax:
  • Variables: A..Z or x0..x31
  • and: '&' or ''
  • or: '|' or '+'
  • xor: '^'
  • difference: '-'
  • special: '' for union
  • one can use '(' and ')' to group subexpression

Member Function Documentation

◆ operator()()

bool GEO::BooleanExpression::operator() ( index_t x) const

Evaluates the boolean expression.

Parameters
[in]xthe different bits of x correspond to the variables A..Z or x0..x31.

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