Rudiments
include
rudiments
compiler.h
1
// Copyright (c) 2015 David Muse
2
// See the COPYING file for more information.
3
4
#ifndef RUDIMENTS_COMPILER_H
5
#define RUDIMENTS_COMPILER_H
6
7
#include <rudiments/private/compilerincludes.h>
8
9
class
compilermodule
;
10
class
compilerpreprocessor
;
11
class
compilerprocessor
;
12
class
compilerpostprocessor
;
13
63
class
RUDIMENTS_DLLSPEC
compiler
{
64
public
:
65
67
compiler
();
68
70
virtual
~
compiler
();
71
72
75
void
appendModulePath(
const
char
*path);
76
78
void
clearModulePaths();
79
81
linkedlist< char * >
*getModulePaths();
82
83
86
void
appendPreProcessor(
compilerpreprocessor
*module);
87
94
bool
appendPreProcessor(
const
char
*filename,
95
const
char
*classname,
96
const
char
*
id
,
97
domnode
*parameters);
98
105
bool
appendPreProcessor(
const
char
*filename,
106
const
char
*classname,
107
const
char
*
id
,
108
const
char
*parameters);
109
111
void
clearPreProcessors();
112
114
linkedlist< compilermodule * >
*getPreProcessors();
115
116
117
120
void
appendProcessor(
compilerprocessor
*module);
121
128
bool
appendProcessor(
const
char
*filename,
129
const
char
*classname,
130
const
char
*
id
,
131
domnode
*parameters);
132
139
bool
appendProcessor(
const
char
*filename,
140
const
char
*classname,
141
const
char
*
id
,
142
const
char
*parameters);
143
145
void
clearProcessors();
146
148
linkedlist< compilermodule * >
*getProcessors();
149
150
151
154
void
appendPostProcessor(
compilerpostprocessor
*module);
155
162
bool
appendPostProcessor(
const
char
*filename,
163
const
char
*classname,
164
const
char
*
id
,
165
domnode
*parameters);
166
173
bool
appendPostProcessor(
const
char
*filename,
174
const
char
*classname,
175
const
char
*
id
,
176
const
char
*parameters);
177
179
void
clearPostProcessors();
180
182
linkedlist< compilermodule * >
*getPostProcessors();
183
184
185
189
bool
setInputGrammar(
const
char
*grammar,
190
const
char
*startsymbol);
191
194
bool
setOutputGrammar(
const
char
*grammar);
195
196
197
212
void
setMetaData(
domnode
*metadata);
213
214
230
bool
compile(
const
char
*
input
,
stringbuffer
*
output
);
231
232
244
bool
process
(
domnode
*root);
245
246
248
const
char
*getError();
249
250
252
void
setDebugLevel(uint8_t debuglevel);
253
254
#include <rudiments/private/compiler.h>
255
};
256
257
258
262
class
RUDIMENTS_DLLSPEC
compilermodule
{
263
public
:
265
compilermodule
();
266
268
virtual
~
compilermodule
();
269
271
void
setId(
const
char
*
id
);
272
274
bool
setParameters(
const
char
*parameters);
275
277
void
setParameters(
domnode
*parameters);
278
280
const
char
*getId();
281
283
domnode
*getParameters();
284
285
protected
:
286
const
char
*id;
287
domnode
*parameters;
288
289
private
:
290
dom
*xmld;
291
};
292
293
301
class
RUDIMENTS_DLLSPEC
compilerpreprocessor
:
public
compilermodule
{
302
public
:
304
compilerpreprocessor
();
305
307
virtual
~
compilerpreprocessor
();
308
313
virtual
bool
process
(
const
char
*
input
,
314
stringbuffer
*
output
,
315
domnode
*metadata)=0;
316
};
317
318
326
class
RUDIMENTS_DLLSPEC
compilerprocessor
:
public
compilermodule
{
327
public
:
329
compilerprocessor
();
330
332
virtual
~
compilerprocessor
();
333
338
virtual
bool
process
(
domnode
*tree,
339
domnode
*metadata)=0;
340
};
341
342
351
class
RUDIMENTS_DLLSPEC
compilerpostprocessor
:
public
compilermodule
{
352
public
:
355
compilerpostprocessor
();
356
358
virtual
~
compilerpostprocessor
();
359
364
virtual
bool
process
(
const
char
*
input
,
365
stringbuffer
*
output
,
366
domnode
*metadata)=0;
367
};
368
369
#endif
dom
Definition:
dom.h:10
input
Definition:
input.h:9
linkedlist
Definition:
linkedlist.h:60
stringbuffer
Definition:
stringbuffer.h:13
compilerprocessor
Definition:
compiler.h:326
process
Definition:
process.h:19
compilerpostprocessor
Definition:
compiler.h:351
compiler
Definition:
compiler.h:63
domnode
Definition:
domnode.h:122
compilermodule
Definition:
compiler.h:262
compilerpreprocessor
Definition:
compiler.h:301
output
Definition:
output.h:9
Generated on Tue Sep 11 2018 11:36:50 for Rudiments by
1.8.13