Mescal
Loading...
Searching...
No Matches
files.h
Go to the documentation of this file.
1
13
14#ifndef FILES_H
15#define FILES_H
16
17 // clang-format off
18 /* __ __ _ ____ */
19 /* | \/ | __ _ _ __ __ _ __ _(_)_ __ __ _ / ___| __ ___ _____ ___ */
20 /* | |\/| |/ _` | '_ \ / _` |/ _` | | '_ \ / _` | \___ \ / _` \ \ / / _ \/ __| */
21 /* | | | | (_| | | | | (_| | (_| | | | | | (_| | ___) | (_| |\ V / __/\__ \ */
22 /* |_| |_|\__,_|_| |_|\__,_|\__, |_|_| |_|\__, | |____/ \__,_| \_/ \___||___/ */
23 /* |___/ |___/ */
24 // clang-format on
25
26#include "main.h"
27#include "nfa.h"
28#include "parser.h"
29#include "regexp.h"
30#include "shell_languages.h"
31#include "shell_memb.h"
32#include "type_basic.h"
33#include "shell_memb.h"
34#include <json-c/json.h>
35
36#define OUTPUT_DIR "./outputs"
37
38
39/************************/
40/*+ Example Generation +*/
41/************************/
42
50int files_save_exall(const char* filename,
51 exall_profile* profile
52);
53
54
55int files_read_exall(const char* filename,
56 exall_profile* profile
57);
58
59
60
61/***********************/
62/* Regular expressions */
63/***********************/
64
69#define EXPSIZE 2048
70
80 char*
82);
83
91json_object* files_regexp_to_json(regexp*
92);
93
94/************/
95/* Automata */
96/************/
97
105json_object* files_nfa_to_json(nfa*
106);
107
115json_object* files_dfa_to_json(dfa*
116);
117
118
119
120// /**
121// * @brief
122// * Reads a json object encoding an automaton and extracts this automaton.
123// *
124// * @return
125// * The automaton (or NULL is the json object does not encode an automaton).
126// */
127// nfa* files_json_to_nfa(json_object* //!< The json object.
128// );
129
141void* files_json_to_automaton(json_object*,
142 bool*
143);
144
145/***********************/
146/* Save/Load in a file */
147/***********************/
148
154 object*,
155 char*
156);
157
165int files_read_object(char*,
166 char*
167);
168
174 char*
175);
176
181void files_load_session(char*
182);
183
184#endif
void files_save_object(object *, char *)
Saves a shell object into a file.
Definition files.c:1236
void * files_json_to_automaton(json_object *, bool *)
Reads a json object encoding an automaton and extracts this automaton.
Definition files.c:837
int files_read_exall(const char *filename, exall_profile *profile)
Definition files.c:110
void files_load_session(char *)
Loads a complete session from a file.
Definition files.c:1367
json_object * files_nfa_to_json(nfa *)
Converts a NFA into a json object.
Definition files.c:391
int files_save_exall(const char *filename, exall_profile *profile)
Initializes the json description for example generation.
Definition files.c:11
json_object * files_dfa_to_json(dfa *)
Converts a DFA into a json object.
Definition files.c:484
void files_save_session(char *)
Saves a complete session in a file.
Definition files.c:1320
void reg_to_string(regexp *, char *)
Converts a regular expression into a string.
Definition files.c:376
json_object * files_regexp_to_json(regexp *)
Converts a regular expression into a json object.
Definition files.c:547
int files_read_object(char *, char *)
Reads a shell object from a file and assigns it to a variable name.
Definition files.c:1309
The main file of the program.
Implementation of NFAs.
Implementation of regular expressions.
Type used to represent a complete DFA.
Definition nfa.h:61
Definition shell_memb.h:1596
Type used to represent a NFA.
Definition nfa.h:43
Type used to represent a single node in a regular expression.
Definition regexp.h:123
Basic types.