34#ifndef FLATZINC_PARSER_HH
35#define FLATZINC_PARSER_HH
44extern "C" int isatty(
int);
65#include <gecode/flatzinc/parser.tab.hpp>
70 typedef std::pair<std::string,Option<std::vector<int>* > >
intvartype;
73 typedef std::pair<std::string, VarSpec*>
varspec;
80 const std::pair<std::string,AST::Node*>& y) {
81 return x.first < y.first;
201 std::vector<std::pair<std::string,AST::Node*> >
_output;
223#ifdef GECODE_HAS_SET_VARS
227#ifdef GECODE_HAS_FLOAT_VARS
239 int num = std::min(
length -
pos, lexBufSize);
240 memcpy(lexBuf,
buf+
pos,num);
246 _output.push_back(std::pair<std::string,AST::Node*>(x,n));
253 for (
unsigned int i=0; i<
_output.size(); i++) {
255 if (
_output[i].second->isArray()) {
257 for (
unsigned int j=0; j<oa->
a.size(); j++) {
258 a->
a.push_back(oa->
a[j]);
A node in a FlatZinc abstract syntax tree.
A space that can be initialized with a FlatZinc model.
Strict weak ordering for output items.
bool operator()(const std::pair< std::string, AST::Node * > &x, const std::pair< std::string, AST::Node * > &y)
Return if x is less than y, based on first component.
std::vector< std::array< int, 3 > > uniform_int
Gecode::FlatZinc::FlatZincSpace * fg
SymbolTable< SymbolEntry > symbols
AST::Array * getOutput(void)
std::vector< std::array< int, 2 > > last_val_bool
std::vector< varspec > boolvars
ParserState(char *buf0, int length0, std::ostream &err0, Gecode::FlatZinc::FlatZincSpace *fg0)
std::vector< varspec > setvars
std::vector< std::array< int, 2 > > sol_bool
std::vector< std::array< int, 2 > > last_val_float
std::vector< double > floatvals
std::vector< std::array< int, 2 > > last_val_set
std::vector< varspec > floatvars
void output(std::string x, AST::Node *n)
std::vector< std::array< int, 2 > > sol_set
std::vector< ConExpr * > constraints
std::vector< varspec > intvars
std::vector< std::array< int, 2 > > sol_float
std::vector< int > arrays
std::vector< ConExpr * > domainConstraints
int fillBuffer(char *lexBuf, unsigned int lexBufSize)
std::vector< std::pair< std::string, AST::Node * > > _output
std::vector< std::array< int, 2 > > last_val_int
std::vector< std::tuple< FloatVal, FloatVal, int > > uniform_float
std::vector< std::array< int, 2 > > sol_int
ParserState(const std::string &b, std::ostream &err0, Gecode::FlatZinc::FlatZincSpace *fg0)
std::vector< AST::SetLit > setvals
Entries in the symbol table.
SymbolEntry(void)
Default constructor.
SymbolEntry(SymbolType t0, int i0)
Constructor.
Symbol table mapping identifiers (strings) to values.
Base class for variable specifications.
Interpreter for the FlatZinc language.
SymbolEntry se_s(int i)
Construct set entry.
SymbolEntry se_fva(int i)
Construct float variable array entry.
SymbolType
Types of symbols.
SymbolEntry se_sv(int i)
Construct set variable entry.
SymbolEntry se_bv(int i)
Construct Boolean variable entry.
SymbolEntry se_b(bool b)
Construct Boolean entry.
SymbolEntry se_sa(int i)
Construct set array entry.
SymbolEntry se_bva(int i)
Construct Boolean variable array entry.
SymbolEntry se_iva(int i)
Construct integer variable array entry.
std::pair< std::string, Option< std::vector< int > * > > intvartype
SymbolEntry se_ba(int i)
Construct Boolean array entry.
std::pair< std::string, VarSpec * > varspec
SymbolEntry se_sva(int i)
Construct set variable array entry.
SymbolEntry se_i(int i)
Construct integer entry.
SymbolEntry se_iv(int i)
Construct integer variable entry.
SymbolEntry se_fa(int i)
Construct float array entry.
SymbolEntry se_ia(int i)
Construct integer array entry.
SymbolEntry se_f(int i)
Construct float entry.
SymbolEntry se_fv(int i)
Construct float variable entry.
Gecode toplevel namespace