Commit e4d30ee2 authored by Ghislain MARY's avatar Ghislain MARY

Add some symbol exports for build with Visual Studio.

parent 8e712341
......@@ -14,7 +14,7 @@ namespace belr{
class CoreRules : public Grammar{
public:
///Initialize a CoreRules grammar object.
CoreRules();
BELR_PUBLIC CoreRules();
private:
void alpha();
void bit();
......
......@@ -8,9 +8,15 @@
using namespace ::std;
#if defined(_MSC_VER)
#define BELR_PUBLIC __declspec(dllexport)
#else
#define BELR_PUBLIC
#endif
namespace belr{
string tolower(const string &str);
BELR_PUBLIC string tolower(const string &str);
class ParserContextBase;
......@@ -26,7 +32,7 @@ class Recognizer : public enable_shared_from_this<Recognizer>{
public:
void setName(const string &name);
const string &getName()const;
size_t feed(const shared_ptr<ParserContextBase> &ctx, const string &input, size_t pos);
BELR_PUBLIC size_t feed(const shared_ptr<ParserContextBase> &ctx, const string &input, size_t pos);
unsigned int getId()const{
return mId;
}
......@@ -193,7 +199,7 @@ public:
* @param name the name of the rule
* @return the recognizer implementing this rule. Is NULL if the rule doesn't exist in the grammar.
**/
shared_ptr<Recognizer> findRule(const string &name);
BELR_PUBLIC shared_ptr<Recognizer> findRule(const string &name);
/**
* Find a rule from the grammar, given its name.
* Unlike findRule(), getRule() never returns NULL.
......@@ -202,12 +208,12 @@ public:
* @param name the name of the rule to get
* @return the recognizer implementing the rule, or a RecognizerPointer if the rule isn't yet defined.
**/
shared_ptr<Recognizer> getRule(const string &name);
BELR_PUBLIC shared_ptr<Recognizer> getRule(const string &name);
/**
* Returns true if the grammar is complete, that is all rules are defined.
* In other words, a grammar is complete if no rule depends on another rule which is not defined.
**/
bool isComplete()const;
BELR_PUBLIC bool isComplete()const;
/**
* Optimize the grammar. This is required to obtain good performance of the recognizers implementing the rule.
* The optimization step consists in checking whether belr::Selector objects in the grammar are exclusive or not.
......
......@@ -134,7 +134,7 @@ public:
/**
* Initialize the builder.
**/
ABNFGrammarBuilder();
BELR_PUBLIC ABNFGrammarBuilder();
/**
* Create a grammar from an ABNF grammar defined in the string pointed by abnf.
* An optional Grammar argument corresponding to a grammar to include can be passed.
......@@ -145,7 +145,7 @@ public:
* @param grammar an optional grammar to include.
* @return the Grammar object corresponding to the text definition loaded, NULL if an error occured.
**/
shared_ptr<Grammar> createFromAbnf(const string &abnf, const shared_ptr<Grammar> &grammar=NULL);
BELR_PUBLIC shared_ptr<Grammar> createFromAbnf(const string &abnf, const shared_ptr<Grammar> &grammar=NULL);
/**
* Create a grammar from an ABNF grammar defined in the text file pointed by path.
* An optional Grammar argument corresponding to a grammar to include can be passed.
......@@ -156,7 +156,7 @@ public:
* @param grammar an optional grammar to include.
* @return the Grammar object corresponding to the text definition loaded, NULL if an error occured.
**/
shared_ptr<Grammar> createFromAbnfFile(const string &path, const shared_ptr<Grammar> &grammar=NULL);
BELR_PUBLIC shared_ptr<Grammar> createFromAbnfFile(const string &path, const shared_ptr<Grammar> &grammar=NULL);
private:
Parser<shared_ptr<ABNFBuilder>> mParser;
};
......
......@@ -120,7 +120,7 @@ public:
class HandlerContextBase : public enable_shared_from_this<HandlerContextBase>{
public:
virtual ~HandlerContextBase();
BELR_PUBLIC virtual ~HandlerContextBase();
};
template <typename _parserElementT>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment