34#ifndef __FLATZINC_PARSER_HH__
35#define __FLATZINC_PARSER_HH__
44extern "C" int isatty(
int);
64#include <gecode/flatzinc/parser.tab.hpp>
67namespace Gecode {
namespace FlatZinc {
69 typedef std::pair<std::string,Option<std::vector<int>* > >
intvartype;
72 typedef std::pair<std::string, VarSpec*>
varspec;
79 const std::pair<std::string,AST::Node*>&
y) {
80 return x.first <
y.first;
200 std::vector<std::pair<std::string,AST::Node*> >
_output;
221 int num = std::min(
length -
pos, lexBufSize);
222 memcpy(lexBuf,
buf+
pos,num);
228 _output.push_back(std::pair<std::string,AST::Node*>(
x,
n));
237 if (
_output[i].second->isArray()) {
239 for (
unsigned int j=0; j<oa->
a.size(); j++) {
240 a->a.push_back(oa->
a[j]);
struct Gecode::@603::NNF::@65::@66 b
For binary nodes (and, or, eqv)
int n
Number of negative literals for node type.
struct Gecode::@603::NNF::@65::@67 a
For atomic nodes.
int size(void) const
Return size of array (number of elements)
A node in a FlatZinc abstract syntax tree.
Array * getArray(void)
Cast this node to an array node.
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.
State of the FlatZinc parser
Gecode::FlatZinc::FlatZincSpace * fg
SymbolTable< SymbolEntry > symbols
AST::Array * getOutput(void)
std::vector< varspec > boolvars
ParserState(char *buf0, int length0, std::ostream &err0, Gecode::FlatZinc::FlatZincSpace *fg0)
std::vector< varspec > setvars
std::vector< double > floatvals
std::vector< varspec > floatvars
void output(std::string x, AST::Node *n)
std::vector< ConExpr * > constraints
std::vector< varspec > intvars
std::vector< int > arrays
std::vector< ConExpr * > domainConstraints
int fillBuffer(char *lexBuf, unsigned int lexBufSize)
std::vector< std::pair< std::string, AST::Node * > > _output
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.
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
Post propagator for SetVar SetOpType SetVar y
Post propagator for SetVar x