compiler.h
// Copyright (c) 1999-2018 David Muse
// See the COPYING file for more information.
#ifndef RUDIMENTS_COMPILER_H
#define RUDIMENTS_COMPILER_H
#include <rudiments/private/compilerincludes.h>
class compilermodule;
class compilerpreprocessor;
class compilerprocessor;
class compilerpostprocessor;
class RUDIMENTS_DLLSPEC compiler {
public:
compiler();
virtual ~compiler();
void appendModulePath(const char *path);
void clearModulePaths();
linkedlist< char * > *getModulePaths();
void appendPreProcessor(compilerpreprocessor *module);
bool appendPreProcessor(const char *filename,
const char *classname,
const char *id,
domnode *parameters);
bool appendPreProcessor(const char *filename,
const char *classname,
const char *id,
const char *parameters);
void clearPreProcessors();
linkedlist< compilermodule * > *getPreProcessors();
void appendProcessor(compilerprocessor *module);
bool appendProcessor(const char *filename,
const char *classname,
const char *id,
domnode *parameters);
bool appendProcessor(const char *filename,
const char *classname,
const char *id,
const char *parameters);
void clearProcessors();
linkedlist< compilermodule * > *getProcessors();
void appendPostProcessor(compilerpostprocessor *module);
bool appendPostProcessor(const char *filename,
const char *classname,
const char *id,
domnode *parameters);
bool appendPostProcessor(const char *filename,
const char *classname,
const char *id,
const char *parameters);
void clearPostProcessors();
linkedlist< compilermodule * > *getPostProcessors();
bool setInputGrammar(const char *grammar,
const char *startsymbol);
bool setOutputGrammar(const char *grammar);
void setMetaData(domnode *metadata);
bool compile(const char *input, stringbuffer *output);
bool process(domnode *root);
const char *getError();
void setDebugLevel(uint8_t debuglevel);
#include <rudiments/private/compiler.h>
};
class RUDIMENTS_DLLSPEC compilermodule {
public:
compilermodule();
virtual ~compilermodule();
void setId(const char *id);
bool setParameters(const char *parameters);
void setParameters(domnode *parameters);
const char *getId();
domnode *getParameters();
protected:
const char *id;
domnode *parameters;
private:
dom *xmld;
};
class RUDIMENTS_DLLSPEC compilerpreprocessor : public compilermodule {
public:
compilerpreprocessor();
virtual ~compilerpreprocessor();
virtual bool process(const char *input,
stringbuffer *output,
domnode *metadata)=0;
};
class RUDIMENTS_DLLSPEC compilerprocessor : public compilermodule {
public:
compilerprocessor();
virtual ~compilerprocessor();
virtual bool process(domnode *tree,
domnode *metadata)=0;
};
class RUDIMENTS_DLLSPEC compilerpostprocessor : public compilermodule {
public:
compilerpostprocessor();
virtual ~compilerpostprocessor();
virtual bool process(const char *input,
stringbuffer *output,
domnode *metadata)=0;
};
#endif
compiler
Definition: compiler.h:63
compiler::clearModulePaths
void clearModulePaths()
compiler::setMetaData
void setMetaData(domnode *metadata)
compiler::getPreProcessors
linkedlist< compilermodule * > * getPreProcessors()
compiler::setOutputGrammar
bool setOutputGrammar(const char *grammar)
compiler::getError
const char * getError()
compiler::clearPreProcessors
void clearPreProcessors()
compiler::appendPostProcessor
bool appendPostProcessor(const char *filename, const char *classname, const char *id, domnode *parameters)
compiler::appendPreProcessor
bool appendPreProcessor(const char *filename, const char *classname, const char *id, const char *parameters)
compiler::process
bool process(domnode *root)
compiler::appendPreProcessor
bool appendPreProcessor(const char *filename, const char *classname, const char *id, domnode *parameters)
compiler::getPostProcessors
linkedlist< compilermodule * > * getPostProcessors()
compiler::appendPostProcessor
bool appendPostProcessor(const char *filename, const char *classname, const char *id, const char *parameters)
compiler::clearPostProcessors
void clearPostProcessors()
compiler::~compiler
virtual ~compiler()
compiler::appendPostProcessor
void appendPostProcessor(compilerpostprocessor *module)
compiler::getModulePaths
linkedlist< char * > * getModulePaths()
compiler::appendProcessor
bool appendProcessor(const char *filename, const char *classname, const char *id, const char *parameters)
compiler::setDebugLevel
void setDebugLevel(uint8_t debuglevel)
compiler::clearProcessors
void clearProcessors()
compiler::appendProcessor
bool appendProcessor(const char *filename, const char *classname, const char *id, domnode *parameters)
compiler::appendProcessor
void appendProcessor(compilerprocessor *module)
compiler::setInputGrammar
bool setInputGrammar(const char *grammar, const char *startsymbol)
compiler::compile
bool compile(const char *input, stringbuffer *output)
compiler::appendModulePath
void appendModulePath(const char *path)
compiler::appendPreProcessor
void appendPreProcessor(compilerpreprocessor *module)
compiler::compiler
compiler()
compiler::getProcessors
linkedlist< compilermodule * > * getProcessors()
compilermodule
Definition: compiler.h:262
compilermodule::getParameters
domnode * getParameters()
compilermodule::setParameters
bool setParameters(const char *parameters)
compilermodule::getId
const char * getId()
compilermodule::~compilermodule
virtual ~compilermodule()
compilermodule::setId
void setId(const char *id)
compilermodule::compilermodule
compilermodule()
compilermodule::setParameters
void setParameters(domnode *parameters)
compilerpostprocessor
Definition: compiler.h:351
compilerpostprocessor::compilerpostprocessor
compilerpostprocessor()
compilerpostprocessor::process
virtual bool process(const char *input, stringbuffer *output, domnode *metadata)=0
compilerpostprocessor::~compilerpostprocessor
virtual ~compilerpostprocessor()
compilerpreprocessor
Definition: compiler.h:301
compilerpreprocessor::compilerpreprocessor
compilerpreprocessor()
compilerpreprocessor::~compilerpreprocessor
virtual ~compilerpreprocessor()
compilerpreprocessor::process
virtual bool process(const char *input, stringbuffer *output, domnode *metadata)=0
compilerprocessor
Definition: compiler.h:326
compilerprocessor::~compilerprocessor
virtual ~compilerprocessor()
compilerprocessor::process
virtual bool process(domnode *tree, domnode *metadata)=0
compilerprocessor::compilerprocessor
compilerprocessor()
dom
Definition: dom.h:10
domnode
Definition: domnode.h:122
input
Definition: input.h:9
linkedlist
Definition: linkedlist.h:60
output
Definition: output.h:9
stringbuffer
Definition: stringbuffer.h:13