this repo has no description
1/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2
3/*
4 * Main authors:
5 * Jip J. Dekker <jip.dekker@monash.edu>
6 */
7
8/* This Source Code Form is subject to the terms of the Mozilla Public
9 * License, v. 2.0. If a copy of the MPL was not distributed with this
10 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
11
12#ifndef __MINIZINC_REGEX_HH__
13#define __MINIZINC_REGEX_HH__
14#ifdef HAS_GECODE
15
16// Regex Parser Requirements
17#include <minizinc/values.hh>
18
19#include <memory>
20#include <unordered_map>
21#include <unordered_set>
22
23#include <gecode/minimodel.hh>
24
25// This is a workaround for a bug in flex that only shows up
26// with the Microsoft C++ compiler
27#if defined(_MSC_VER)
28#define YY_NO_UNISTD_H
29#ifdef __cplusplus
30extern "C" int isatty(int);
31#endif
32#endif
33
34// The Microsoft C++ compiler marks certain functions as deprecated,
35// so let's take the alternative definitions
36#if defined(_MSC_VER)
37#define strdup _strdup
38#define fileno _fileno
39#endif
40
41// Anonymous struct for when yyparse is exported
42typedef struct REContext REContext;
43// Parser generated header
44#include <minizinc/support/regex_parser.tab.hh>
45
46using namespace Gecode;
47using namespace MiniZinc;
48
49// Parsing function
50std::unique_ptr<REG> regex_from_string(const std::string& expression, const IntSetVal& domain,
51 const std::unordered_map<std::string, int>& identifiers);
52
53#endif // HAS_GECODE
54#endif //__MINIZINC_REGEX_HH__