Mescal
Loading...
Searching...
No Matches
shell_keywords.h
Go to the documentation of this file.
1
6
7#ifndef SHELL_KEYWORDS_H
8#define SHELL_KEYWORDS_H
9
10#include "shell_languages.h"
11#include "type_basic.h"
12#include <stdbool.h>
13#include <string.h>
14
19typedef enum {
20
21 // Interface
22 KY_INTERFACE,
23
24 // General commands
25 KY_SAVESESSION,
26 KY_LOADSESSION,
27 KY_OPEN,
28 KY_SAVE,
29 KY_DELETE,
30 KY_CLEAR,
31 KY_SORT,
32 KY_INFO,
33 KY_EXSEARCH,
34 KY_EXINIT,
35 KY_EXINITFP,
36 KY_EXINITNEG,
37 KY_EXCONTINUE,
38 KY_EXRETRIEVE,
39 KY_EXALL,
40 KY_NEXALL,
41 KY_FPEXALL,
42 KY_BUGSEARCH,
43 KY_INSIDE,
44 KY_OUTSIDE,
45 KY_LIST,
46 KY_AUTOMATA,
47 KY_MORPHISMS,
48 KY_GROUPS,
49 KY_REGEXPS,
50 KY_RECDEFS,
51 KY_TOGGLE,
52 KY_TOGGLEMEMB,
53 KY_TIMESTATS,
54 KY_LATEX,
55
56
57 // Automata commands
58 KY_MINI,
59 KY_THOMPSON,
60 KY_GLUSHKOV,
61 KY_HOPCROFT,
62 KY_BMCK,
63 KY_INTERSEC,
64 KY_ELIMEPS,
65 KY_BRZOZO,
66 KY_KLEENE,
67 KY_MIRROR,
68 KY_CONCAT,
69 KY_RESET,
70 KY_TRIMNFA,
71 KY_UNION,
72 KY_RUN,
73 KY_RNFA,
74 KY_RDFA,
75 KY_INVTRANS,
76 KY_DYCKTRANS,
77 KY_RECDEF,
78 KY_PERMUT,
79 KY_COUNTER,
80 KY_AUTODA,
81 KY_CYCLETRIV,
82 KY_DETERMINIZE,
83 KY_COMPLEMENT,
84 KY_NOSIMC,
85 KY_FOLDING,
86 KY_DIRECTPRODUCT,
87
88 // Morphisms commands
89 KY_SYNT,
90 KY_RCAY,
91 KY_LCAY,
92 KY_MULT,
93 KY_IDEMS,
94 KY_ORDER,
95 KY_IMAGE,
96 KY_GKER,
97 KY_MKER,
98 KY_AKER,
99 KY_ORB,
100
101 // Shared commands
102 KY_COMMUT,
103 KY_LETTERIND,
104
105 // Recursive
106 KY_RECINIT,
107
108 // Tests
109 KY_SEPAR,
110 KY_MEMB,
111 KY_CHIERA,
112 KY_NAVHIERA,
113 KY_NHIERA,
114 KY_FPHIERA,
115
116 //Filtering
117 KY_RSIZE,
118 KY_LSIZE,
119 KY_JSIZE,
120 KY_HSIZE,
121 KY_RNUM,
122 KY_LNUM,
123 KY_JNUM,
124 KY_HNUM,
125 KY_RMAXSIZE,
126 KY_LMAXSIZE,
127 KY_JMAXSIZE,
128 KY_HMAXSIZE,
129 KY_NOT,
130 KY_FILTER,
131 KY_NOSMALLCOUNTER,
132
133 // End of commands
134 KY_COMEND,
135
136 // Classes
137 KY_HTGEN,
138 KY_AT,
139 KY_ATT,
140 KY_SF,
141 KY_UL,
142 KY_TLX,
143 KY_PPT,
144 KY_PT,
145 KY_LT,
146 KY_LTT,
147 KY_ST,
148 KY_DD,
149 KY_MOD,
150 KY_MODP,
151 KY_AMT,
152 KY_AMTP,
153 KY_GR,
154 KY_GRP,
155 KY_REG,
156 KY_EMPTY,
157
158 // Operators
159
160 KY_POL,
161 KY_POL2,
162 KY_BPOL,
163 KY_BPOL2,
164 KY_UBPOL,
165 KY_UBPOL2,
166 KY_UPOL,
167 KY_LPOL,
168 KY_RPOL,
169 KY_MPOL,
170 KY_TLC,
171 KY_TLC2,
172 KY_FLC,
173 KY_FLC2,
174 KY_PLC,
175 KY_PLC2,
176 KY_JORB,
177 KY_KNAST,
178
179 // Dummy keyword
180 KY_NULL
182
183
184
185
186
187
197
206
216
227
228/***************************/
229/*+ Array of all keywords +*/
230/**************************/
231
237 const char* str
238);
239
244void keywords_add_all_keys(void);
245
246/******************************/
247/*+ Generic display commands +*/
248/******************************/
249
254void print_string_chain(const string_chain* stchain,
255 FILE* out
256);
257
262void print_command(com_command* com,
263 FILE* out
264);
265
266/**************************************/
267/*+ Converting a string to a keyword +*/
268/**************************************/
269
277const char* keywordtostring(com_keyword key
278);
279
291com_keyword string_to_keyword(const char* str
292);
293
301bool check_varname(const char* str
302);
303
304/*******************************/
305/*+ Informations on a command +*/
306/*******************************/
307
315bool com_isclass(com_command* com
316);
317
318
319
320
328bool com_israw(const com_command* com
329);
330
338bool com_single(const com_command* com
339);
340
348bool com_single_par(const com_command* com
349);
350
358int com_nbparams(const com_parameters* pars
359);
360
369 int i
370);
371
372
373
374
375
376
385);
386
398);
399
400
401
402
403
404
405/*****************************/
406/* Construction of a command */
407/*****************************/
408
418);
419
429);
430
440);
441
451);
452
461);
462
471 char*
472);
473
479);
480
486);
487
493);
494
495#endif
com_parameters * com_make_parameters(com_command *, com_parameters *)
Adds a new parameter to a parameters chain.
Definition shell_keywords.c:435
string_chain * com_make_string_chain(char *, string_chain *)
Adds another link to a string chain.
Definition shell_keywords.c:427
bool check_varname(const char *str)
Check if a variable name is valid: it is not a keyword.
Definition shell_keywords.c:278
bool com_israw(const com_command *com)
Check if a command is raw text.
Definition shell_keywords.c:354
com_keyword key_from_string_chain_single(const string_chain *strchain)
Get the keyword associated with a single link string chain.
Definition shell_keywords.c:414
com_type
The two kinds of commands.
Definition shell_keywords.h:192
@ CMT_KEY
Standard command (with parameters, with chain).
Definition shell_keywords.h:195
@ CMT_RAW
Raw text command (no parameters, no chain)
Definition shell_keywords.h:193
@ CMT_IND
Indexed command (no parameters, with chain).
Definition shell_keywords.h:194
com_keyword key_from_string_chain(const string_chain *strchain)
Get the keyword associated with the first link in a string chain.
Definition shell_keywords.c:403
com_command * com_make_command(char *, com_command *)
Adds a new link to a command.
Definition shell_keywords.c:449
com_keyword string_to_keyword(const char *str)
Convert a string to a keyword.
Definition shell_keywords.c:269
com_keyword
The keywords.
Definition shell_keywords.h:19
com_command * com_init_command(char *, com_parameters *)
Initializes a single link command.
Definition shell_keywords.c:462
bool com_isclass(com_command *com)
Check if a command is a class.
Definition shell_keywords.c:294
com_command * com_getparam(const com_parameters *com, int i)
Gets the n-th parameter of a command.
Definition shell_keywords.c:384
void com_free_string_chain(string_chain *)
Frees a string chain.
Definition shell_keywords.c:509
com_command * com_init_rawcommand(char *)
Initializes a raw text command.
Definition shell_keywords.c:475
void com_free_command(com_command *)
Frees a command.
Definition shell_keywords.c:525
bool com_single(const com_command *com)
Check if a command is a single link without parameters.
Definition shell_keywords.c:361
void keywords_add_all_keys(void)
Initialization of all the keywords.
Definition shell_keywords.c:27
int com_nbparams(const com_parameters *pars)
Computes the number of parameters of a command.
Definition shell_keywords.c:375
bool com_single_par(const com_command *com)
Check if a command is a single link with or without parameters.
Definition shell_keywords.c:368
const char * keywordtostring(com_keyword key)
Convert a keyword to the associated string.
Definition shell_keywords.c:260
void print_string_chain(const string_chain *stchain, FILE *out)
Display a string chain.
Definition shell_keywords.c:190
void keywords_add_key(com_keyword key, const char *str)
Initialization of a single keyword.
Definition shell_keywords.c:18
com_command * com_init_indexing(char *, char *)
Initializes an indexed command.
Definition shell_keywords.c:488
void com_free_parameters(com_parameters *)
Frees the parameters of a command.
Definition shell_keywords.c:517
void print_command(com_command *com, FILE *out)
Display a command.
Definition shell_keywords.c:204
A command.
Definition shell_keywords.h:221
uint ind
The index of the command (when it is of indexed type).
Definition shell_keywords.h:224
string_chain * main
The string chain of the command.
Definition shell_keywords.h:223
com_parameters * params
The parameters of the command.
Definition shell_keywords.h:225
com_type thetype
The type of the command.
Definition shell_keywords.h:222
Parameters of a command.
Definition shell_keywords.h:211
struct com_parameters * next
The next parameters.
Definition shell_keywords.h:214
struct com_command * param
The first parameter.
Definition shell_keywords.h:213
uchar count
Number of parameters.
Definition shell_keywords.h:212
Chain of strings in a command.
Definition shell_keywords.h:202
char * string
The string.
Definition shell_keywords.h:203
struct string_chain * next
The next link in the chain.
Definition shell_keywords.h:204
Basic types.