Google OR-Tools: ortools/flatzinc/parser.cc Source File

1

2

3

4

5

6

7

8

9

10

11

12

13

15

16#include <cstdio>

17#include <string>

18

19#include "absl/log/log.h"

23

24

27 void* scanner);

30extern void orfz_set_in(FILE* in_str, void* yyscanner);

31

32

35 void* scanner);

37

39namespace fz {

40

41

43

44 FILE* const input = fopen(filename.c_str(), "r");

45 if (input == nullptr) {

46 LOG(INFO) << "Could not open file '" << filename << "'";

47 return false;

48 }

50

53 bool ok = true;

54 void* scanner = nullptr;

57

58 orfz_parse(&context, model, &ok, scanner);

59

60 if (scanner != nullptr) {

62 }

64 return ok;

65}

66

68

70

73 bool ok = true;

74 void* scanner = nullptr;

78

79 orfz_parse(&context, model, &ok, scanner);

80

81 if (string_buffer != nullptr) {

83 }

84 if (scanner != nullptr) {

86 }

87 return ok;

88}

89}

90}

bool ParseFlatzincString(const std::string &input, Model *model)

Definition parser.cc:67

bool ParseFlatzincFile(const std::string &filename, Model *model)

Definition parser.cc:42

int orfz_lex_destroy(void *scanner)

int orfz_parse(operations_research::fz::ParserContext *parser, operations_research::fz::Model *model, bool *ok, void *scanner)

yy_buffer_state * orfz__scan_bytes(const char *input, int size, void *scanner)

int orfz_lex_init(void **scanner)

void orfz_set_in(FILE *in_str, void *yyscanner)

void orfz__delete_buffer(yy_buffer_state *b, void *scanner)

static int input(yyscan_t yyscanner)

absl::flat_hash_map< std::string, int64_t > integer_map