MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
json.cpp File Reference
#include "pbqp/json.h"
#include <cassert>
#include <charconv>
#include <cstdint>
#include <limits>
#include <optional>
#include <print>
#include <string_view>
#include <utility>
#include <fe/driver.h>
#include <fe/format.h>
#include <fe/lexer.h>
#include <fe/parser.h>
Include dependency graph for json.cpp:

Go to the source code of this file.

Namespaces

namespace  pbqp
namespace  pbqp::json

Macros

#define PBQP_JSON_KEY(m)
#define PBQP_JSON_VAL(m)
#define PBQP_JSON_TOK(m)
#define CODE(t, _)
#define CODE(t, str)
#define CODE(t, str)
#define CODE(t, _)
#define CODE(t, _)

Functions

void pbqp::read_json (std::istream &in, Instance &instance, const std::filesystem::path &path="<input>")
 Read a PBQP instance into the empty instance:
void pbqp::write_json (std::ostream &out, const Graph &graph, fe::View< size_t > rn_priority={})
 Write the format that read_json reads.

Macro Definition Documentation

◆ CODE [1/5]

#define CODE ( t,
_ )
Value:
case Tag::t:

Definition at line 48 of file json.cpp.

◆ CODE [2/5]

#define CODE ( t,
_ )
Value:
case Tag::t:

Definition at line 48 of file json.cpp.

◆ CODE [3/5]

#define CODE ( t,
_ )
Value:
t,

Definition at line 48 of file json.cpp.

◆ CODE [4/5]

#define CODE ( t,
str )
Value:
if (view() == str) return {loc_, Tag::t};

Definition at line 48 of file json.cpp.

◆ CODE [5/5]

#define CODE ( t,
str )
Value:
case Tag::t: return str;

Definition at line 48 of file json.cpp.

◆ PBQP_JSON_KEY

#define PBQP_JSON_KEY ( m)
Value:
m(K_true, "true") \
m(K_false, "false") \
m(K_null, "null") \

Definition at line 23 of file json.cpp.

◆ PBQP_JSON_TOK

#define PBQP_JSON_TOK ( m)
Value:
m(EoF, "<end of file>") \
m(D_brace_l, "{") \
m(D_brace_r, "}") \
m(D_bracket_l, "[") \
m(D_bracket_r, "]") \
m(T_colon, ":") \
m(T_comma, ",")

Definition at line 33 of file json.cpp.

◆ PBQP_JSON_VAL

#define PBQP_JSON_VAL ( m)
Value:
m(V_str, "<string>") \
m(V_int, "<integer>") \
m(V_num, "<number>") \

Definition at line 28 of file json.cpp.