34 #ifndef __FLATZINC_PARSER_HH__
35 #define __FLATZINC_PARSER_HH__
42 #define YY_NO_UNISTD_H
44 extern "C" int isatty(
int);
51 #define strdup _strdup
52 #define fileno _fileno
64 #include <gecode/flatzinc/parser.tab.hh>
67 namespace 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;
222 memcpy(lexBuf,
buf+
pos,num);
228 _output.push_back(std::pair<std::string,AST::Node*>(
x,
n));
235 for (
unsigned int i=0;
i<
_output.size();
i++) {
239 for (
unsigned int j=0; j<oa->
a.size(); j++) {
240 a->a.push_back(oa->
a[j]);
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
int n
Number of negative literals for node type.
Node * x
Pointer to corresponding Boolean expression node.
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
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.
State of the FlatZinc parser
Gecode::FlatZinc::FlatZincSpace * fg
AST::Array * getOutput(void)
SymbolTable< SymbolEntry > symbols
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.
Post propagator for SetVar SetOpType SetVar y
const FloatNum min
Smallest allowed float value.
void sort(TaskViewArray< TaskView > &t)
Sort task view array t according to sto and inc (increasing or decreasing)
unsigned int size(I &i)
Size of all ranges of range iterator i.
Gecode::IntArgs i({1, 2, 3, 4})
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.