Generated on for Gecode by doxygen 1.18.0
Gecode::Instance::Expr Class Reference

Expression. More...

#include <gecode/instance/impl.hpp>

Public Types

enum class  Kind {
  INT , FLOAT , STR , NAME ,
  BINARY , UNARY , CALL , INDEX ,
  FIELD , COMPREHENSION
}
 Kind of expression. More...
enum class  Op {
  OR , AND , EQ , NE ,
  LT , GT , LE , GE ,
  ADD , SUB , MUL , DIV ,
  MOD , POW , NEG , NOT
}
 Operator of unary and binary expressions. More...

Public Member Functions

 Expr (Kind k)
 Initialize with kind k.

Public Attributes

enum Gecode::Instance::Expr::Kind kind
enum Gecode::Instance::Expr::Op op
long long int i
 Integer literal.
double f
 Float literal.
std::string s
 String literal, name, operator, or function.
std::string var
 Name bound by a comprehension.
int record
 Index of a record name among the records of its check (-1 if none).
const Stmt * records
 The repeat whose records or lists of records this is, or null.
int open
 1 for a list of records of records, 0 for a record
const Stmt * elements
 For a comprehension, the repeat whose records are the elements of its array, or null.
Seq< std::unique_ptr< Expr > > args
 Operands or arguments.

Detailed Description

Expression.

An index expression a[i] has the operands a and i, a field r.f the operand r and the name f in s. A comprehension such as all(x in a: e) has the function in s, the bound name in var, and the operands a and e.

The parser finds the expressions that are records or lists of records of a repeat (see Stmt::list and Stmt::each): records is the repeat.

Definition at line 453 of file impl.hpp.

Member Enumeration Documentation

◆ Kind

enum class Gecode::Instance::Expr::Kind
strong

Kind of expression.

Enumerator
INT 
FLOAT 
STR 
NAME 
BINARY 
UNARY 
CALL 
INDEX 
FIELD 
COMPREHENSION 

Definition at line 456 of file impl.hpp.

◆ Op

enum class Gecode::Instance::Expr::Op
strong

Operator of unary and binary expressions.

Enumerator
OR 
AND 
EQ 
NE 
LT 
GT 
LE 
GE 
ADD 
SUB 
MUL 
DIV 
MOD 
POW 
NEG 
NOT 

Definition at line 458 of file impl.hpp.

Constructor & Destructor Documentation

◆ Expr()

Gecode::Instance::Expr::Expr ( Kind k)
inlineexplicit

Initialize with kind k.

Definition at line 481 of file impl.hpp.

Member Data Documentation

◆ kind

enum Gecode::Instance::Expr::Kind Gecode::Instance::Expr::kind

◆ op

enum Gecode::Instance::Expr::Op Gecode::Instance::Expr::op

◆ i

long long int Gecode::Instance::Expr::i

Integer literal.

Definition at line 462 of file impl.hpp.

◆ f

double Gecode::Instance::Expr::f

Float literal.

Definition at line 464 of file impl.hpp.

◆ s

std::string Gecode::Instance::Expr::s

String literal, name, operator, or function.

Definition at line 466 of file impl.hpp.

◆ var

std::string Gecode::Instance::Expr::var

Name bound by a comprehension.

Definition at line 468 of file impl.hpp.

◆ record

int Gecode::Instance::Expr::record

Index of a record name among the records of its check (-1 if none).

Definition at line 470 of file impl.hpp.

◆ records

const Stmt* Gecode::Instance::Expr::records

The repeat whose records or lists of records this is, or null.

Definition at line 472 of file impl.hpp.

◆ open

int Gecode::Instance::Expr::open

1 for a list of records of records, 0 for a record

Definition at line 474 of file impl.hpp.

◆ elements

const Stmt* Gecode::Instance::Expr::elements

For a comprehension, the repeat whose records are the elements of its array, or null.

Definition at line 477 of file impl.hpp.

◆ args

Seq<std::unique_ptr<Expr> > Gecode::Instance::Expr::args

Operands or arguments.

Definition at line 479 of file impl.hpp.


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