Generated on for Gecode by doxygen 1.18.0
Gecode::FlatZinc::AST::Node Class Referenceabstract

A node in a FlatZinc abstract syntax tree. More...

#include <gecode/flatzinc/ast.hh>

Public Member Functions

virtual ~Node (void)
 Destructor.
virtual void release (void)
 Give up one owner's hold on this node.
void append (Node *n)
 Append n to an array node.
bool hasAtom (const std::string &id)
 Test if node has atom with id.
bool isInt (int &i)
 Test if node is int, if yes set i to the value.
bool isFloat (double &i)
 Test if node is float, if yes set d to the value.
bool isCall (const std::string &id)
 Test if node is function call with id.
Call * getCall (void)
 Return function call.
bool hasCall (const std::string &id)
 Test if node is function call or array containing function call id.
Call * getCall (const std::string &id)
 Return function call id.
Array * getArray (void)
 Cast this node to an array node.
Atom * getAtom (void)
 Cast this node to an Atom node.
std::string getVarName (void)
 Return name of variable represented by this node.
int getIntVar (void)
 Cast this node to an integer variable node.
int getBoolVar (void)
 Cast this node to a Boolean variable node.
int getFloatVar (void)
 Cast this node to a Float variable node.
int getSetVar (void)
 Cast this node to a set variable node.
int getInt (void)
 Cast this node to an integer node.
bool getBool (void)
 Cast this node to a Boolean node.
double getFloat (void)
 Cast this node to a Float node.
SetLit * getSet (void)
 Cast this node to a set literal node.
std::string getString (void)
 Cast this node to a string node.
bool isIntVar (void)
 Test if node is an integer variable node.
bool isBoolVar (void)
 Test if node is a Boolean variable node.
bool isSetVar (void)
 Test if node is a set variable node.
bool isFloatVar (void)
 Test if node is a float variable node.
bool isInt (void)
 Test if node is an integer node.
bool isFloat (void)
 Test if node is a float node.
bool isBool (void)
 Test if node is a Boolean node.
bool isString (void)
 Test if node is a string node.
bool isArray (void)
 Test if node is an array node.
bool isSet (void)
 Test if node is a set literal node.
bool isAtom (void)
 Test if node is an atom node.
virtual void print (std::ostream &)=0
 Output string representation.

Detailed Description

A node in a FlatZinc abstract syntax tree.

Definition at line 67 of file ast.hh.

Constructor & Destructor Documentation

◆ ~Node()

Gecode::FlatZinc::AST::Node::~Node ( void )
inlinevirtual

Destructor.

Definition at line 349 of file ast.hh.

Member Function Documentation

◆ release()

void Gecode::FlatZinc::AST::Node::release ( void )
inlinevirtual

Give up one owner's hold on this node.

A node normally has a single owner, and releasing it deletes it. A SharedArray has several owners and is deleted when the last one releases it. Owners release their child nodes through release_node instead of deleting them.

Reimplemented in Gecode::FlatZinc::AST::SharedArray.

Definition at line 352 of file ast.hh.

◆ append()

void Gecode::FlatZinc::AST::Node::append ( Node * n)
inline

Append n to an array node.

Definition at line 363 of file ast.hh.

◆ hasAtom()

bool Gecode::FlatZinc::AST::Node::hasAtom ( const std::string & id)
inline

Test if node has atom with id.

Definition at line 371 of file ast.hh.

◆ isInt() [1/2]

bool Gecode::FlatZinc::AST::Node::isInt ( int & i)
inline

Test if node is int, if yes set i to the value.

Definition at line 414 of file ast.hh.

◆ isFloat() [1/2]

bool Gecode::FlatZinc::AST::Node::isFloat ( double & i)
inline

Test if node is float, if yes set d to the value.

Definition at line 423 of file ast.hh.

◆ isCall()

bool Gecode::FlatZinc::AST::Node::isCall ( const std::string & id)
inline

Test if node is function call with id.

Definition at line 384 of file ast.hh.

◆ getCall() [1/2]

Call * Gecode::FlatZinc::AST::Node::getCall ( void )
inline

Return function call.

Definition at line 393 of file ast.hh.

◆ hasCall()

bool Gecode::FlatZinc::AST::Node::hasCall ( const std::string & id)
inline

Test if node is function call or array containing function call id.

Definition at line 400 of file ast.hh.

◆ getCall() [2/2]

Call * Gecode::FlatZinc::AST::Node::getCall ( const std::string & id)
inline

Return function call id.

Definition at line 432 of file ast.hh.

◆ getArray()

Array * Gecode::FlatZinc::AST::Node::getArray ( void )
inline

Cast this node to an array node.

Definition at line 446 of file ast.hh.

◆ getAtom()

Atom * Gecode::FlatZinc::AST::Node::getAtom ( void )
inline

Cast this node to an Atom node.

Definition at line 453 of file ast.hh.

◆ getVarName()

std::string Gecode::FlatZinc::AST::Node::getVarName ( void )
inline

Return name of variable represented by this node.

Definition at line 460 of file ast.hh.

◆ getIntVar()

int Gecode::FlatZinc::AST::Node::getIntVar ( void )
inline

Cast this node to an integer variable node.

Definition at line 466 of file ast.hh.

◆ getBoolVar()

int Gecode::FlatZinc::AST::Node::getBoolVar ( void )
inline

Cast this node to a Boolean variable node.

Definition at line 472 of file ast.hh.

◆ getFloatVar()

int Gecode::FlatZinc::AST::Node::getFloatVar ( void )
inline

Cast this node to a Float variable node.

Definition at line 478 of file ast.hh.

◆ getSetVar()

int Gecode::FlatZinc::AST::Node::getSetVar ( void )
inline

Cast this node to a set variable node.

Definition at line 484 of file ast.hh.

◆ getInt()

int Gecode::FlatZinc::AST::Node::getInt ( void )
inline

Cast this node to an integer node.

Definition at line 490 of file ast.hh.

◆ getBool()

bool Gecode::FlatZinc::AST::Node::getBool ( void )
inline

Cast this node to a Boolean node.

Definition at line 496 of file ast.hh.

◆ getFloat()

double Gecode::FlatZinc::AST::Node::getFloat ( void )
inline

Cast this node to a Float node.

Definition at line 502 of file ast.hh.

◆ getSet()

SetLit * Gecode::FlatZinc::AST::Node::getSet ( void )
inline

Cast this node to a set literal node.

Definition at line 508 of file ast.hh.

◆ getString()

std::string Gecode::FlatZinc::AST::Node::getString ( void )
inline

Cast this node to a string node.

Definition at line 514 of file ast.hh.

◆ isIntVar()

bool Gecode::FlatZinc::AST::Node::isIntVar ( void )
inline

Test if node is an integer variable node.

Definition at line 520 of file ast.hh.

◆ isBoolVar()

bool Gecode::FlatZinc::AST::Node::isBoolVar ( void )
inline

Test if node is a Boolean variable node.

Definition at line 524 of file ast.hh.

◆ isSetVar()

bool Gecode::FlatZinc::AST::Node::isSetVar ( void )
inline

Test if node is a set variable node.

Definition at line 528 of file ast.hh.

◆ isFloatVar()

bool Gecode::FlatZinc::AST::Node::isFloatVar ( void )
inline

Test if node is a float variable node.

Definition at line 532 of file ast.hh.

◆ isInt() [2/2]

bool Gecode::FlatZinc::AST::Node::isInt ( void )
inline

Test if node is an integer node.

Definition at line 536 of file ast.hh.

◆ isFloat() [2/2]

bool Gecode::FlatZinc::AST::Node::isFloat ( void )
inline

Test if node is a float node.

Definition at line 544 of file ast.hh.

◆ isBool()

bool Gecode::FlatZinc::AST::Node::isBool ( void )
inline

Test if node is a Boolean node.

Definition at line 540 of file ast.hh.

◆ isString()

bool Gecode::FlatZinc::AST::Node::isString ( void )
inline

Test if node is a string node.

Definition at line 552 of file ast.hh.

◆ isArray()

bool Gecode::FlatZinc::AST::Node::isArray ( void )
inline

Test if node is an array node.

Definition at line 556 of file ast.hh.

◆ isSet()

bool Gecode::FlatZinc::AST::Node::isSet ( void )
inline

Test if node is a set literal node.

Definition at line 548 of file ast.hh.

◆ isAtom()

bool Gecode::FlatZinc::AST::Node::isAtom ( void )
inline

Test if node is an atom node.

Definition at line 560 of file ast.hh.

◆ print()


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