Skip to content
Snippets Groups Projects
Commit 6c76152d authored by Paweł Kędzia's avatar Paweł Kędzia
Browse files

(swig) Added wrapper for Wccl::Lexicons

parent e11d00b8
No related merge requests found
...@@ -40,6 +40,7 @@ CBIN=libcclvalue.o \ ...@@ -40,6 +40,7 @@ CBIN=libcclvalue.o \
libcclmatchrulesequence.o \ libcclmatchrulesequence.o \
libcclfunctionalopsequence.o \ libcclfunctionalopsequence.o \
libccllexicon.o \ libccllexicon.o \
libccllexicons.o \
libcclwcclfileopsections.o \ libcclwcclfileopsections.o \
libcclwcclfile.o \ libcclwcclfile.o \
wccl.o wccl.o
...@@ -69,6 +70,7 @@ CBINOUT=_libcclvalue.so \ ...@@ -69,6 +70,7 @@ CBINOUT=_libcclvalue.so \
_libcclmatchrulesequence.so \ _libcclmatchrulesequence.so \
_libcclfunctionalopsequence.so \ _libcclfunctionalopsequence.so \
_libccllexicon.so \ _libccllexicon.so \
_libccllexicons.so \
_libcclwcclfileopsections.so \ _libcclwcclfileopsections.so \
_wccl.so \ _wccl.so \
_boost_shared_ptr.so _boost_shared_ptr.so
...@@ -98,6 +100,7 @@ CWRAP=libcclvalue_wrap.cxx \ ...@@ -98,6 +100,7 @@ CWRAP=libcclvalue_wrap.cxx \
libcclmatchrulesequence_wrap.cxx \ libcclmatchrulesequence_wrap.cxx \
libcclfunctionalopsequence_wrap.cxx \ libcclfunctionalopsequence_wrap.cxx \
libccllexicon_wrap.cxx \ libccllexicon_wrap.cxx \
libccllexicons_wrap.cxx \
libcclwcclfileopsections_wrap.cxx \ libcclwcclfileopsections_wrap.cxx \
wccl_wrap.cxx \ wccl_wrap.cxx \
boost_shared_ptr_wrap.cxx boost_shared_ptr_wrap.cxx
...@@ -127,6 +130,7 @@ CWRAPBIN=libcclvalue_wrap.o \ ...@@ -127,6 +130,7 @@ CWRAPBIN=libcclvalue_wrap.o \
libcclmatchrulesequence_wrap.o \ libcclmatchrulesequence_wrap.o \
libcclfunctionalopsequence_wrap.o \ libcclfunctionalopsequence_wrap.o \
libccllexicon_wrap.o \ libccllexicon_wrap.o \
libccllexicons_wrap.o \
libcclwcclfileopsections_wrap.o \ libcclwcclfileopsections_wrap.o \
wccl_wrap.o \ wccl_wrap.o \
boost_shared_ptr_wrap.o boost_shared_ptr_wrap.o
...@@ -156,6 +160,7 @@ PYMODULES=libcclvalue.py \ ...@@ -156,6 +160,7 @@ PYMODULES=libcclvalue.py \
libcclmatchrulesequence.py \ libcclmatchrulesequence.py \
libcclfunctionalopsequence.py \ libcclfunctionalopsequence.py \
libccllexicon.py \ libccllexicon.py \
libccllexicons.py \
libcclwcclfileopsections.py \ libcclwcclfileopsections.py \
wccl.py \ wccl.py \
boost_shared_ptr.py boost_shared_ptr.py
...@@ -185,6 +190,7 @@ PYCBIN=libcclvalue.pyc \ ...@@ -185,6 +190,7 @@ PYCBIN=libcclvalue.pyc \
libcclmatchrulesequence.pyc \ libcclmatchrulesequence.pyc \
libcclfunctionalopsequence.pyc \ libcclfunctionalopsequence.pyc \
libccllexicon.pyc \ libccllexicon.pyc \
libccllexicons.pyc \
libcclwcclfileopsections.pyc \ libcclwcclfileopsections.pyc \
wccl.pyc \ wccl.pyc \
boost_shared_ptr.pyc boost_shared_ptr.pyc
...@@ -387,6 +393,13 @@ libccllexicon.o: ...@@ -387,6 +393,13 @@ libccllexicon.o:
$(CPP) -shared libccllexicon_wrap.o \ $(CPP) -shared libccllexicon_wrap.o \
$(CCLBIN) $(ANTLRLIB) -o _libccllexicon.so $(CCLBIN) $(ANTLRLIB) -o _libccllexicon.so
# Lexicons
libccllexicons.o:
$(SWIG) $(SWIGOPTS_LANG) libccllexicons.i
$(CPP) -c libccllexicons_wrap.cxx -I$(PYTHONDIR) -I$(WCCLDIR) $(CPPFLAGS)
$(CPP) -shared libccllexicons_wrap.o \
$(CCLBIN) $(ANTLRLIB) -o _libccllexicons.so
# WcclFileOpSections # WcclFileOpSections
libcclwcclfileopsections.o: libcclwcclfileopsections.o:
$(SWIG) $(SWIGOPTS_LANG) libcclwcclfileopsections.i $(SWIG) $(SWIGOPTS_LANG) libcclwcclfileopsections.i
......
#ifndef SWIG_LIBWCCL_LEXICONS_I
#define SWIG_LIBWCCL_LEXICONS_I
%module libccllexicons
%{
#include <libwccl/lexicon/lexicons.h>
%}
%include "libccllexicon.i"
%include "std_string.i"
%include "boost_shared_ptr.i"
%rename(map_t) boost::unordered_map<std::string, boost::shared_ptr<Lexicon> >;
namespace Wccl {
class Lexicons {
public:
typedef boost::unordered_map<std::string, boost::shared_ptr<Lexicon> > map_t;
/* --------------------------------------------------------------------- */
Lexicons();
/* --------------------------------------------------------------------- */
bool has_lexicon(const std::string& name) const;
/* --------------------------------------------------------------------- */
const Lexicon& get(const std::string& name) const;
boost::shared_ptr<const Lexicon> get_ptr(const std::string& name) const;
/* --------------------------------------------------------------------- */
void insert(const boost::shared_ptr<Lexicon>& lexicon);
/* --------------------------------------------------------------------- */
const map_t& get_lexicons() const;
};
}
using namespace boost;
using namespace Wccl;
using namespace std;
#endif /* SWIG_LIBWCCL_LEXICONS_I */
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