[DEV] update to the new licence MPL2 and new ETK and ...

This commit is contained in:
Edouard DUPIN 2017-10-25 22:19:39 +02:00
parent db109fe7a5
commit d36572e9c3
36 changed files with 471 additions and 554 deletions

4
README
View File

@ -1,11 +1,11 @@
ECI : Ewol C Interpreter ECI : Ewol C Interpreter
----- -----
Eci is a fork of PicoC... ECI is a stipid interpreter of C language or C++, a good question ==> need rename the lib ...
Copyright Copyright
--------- ---------
BSD 3 clauses MPL-2

View File

@ -1,11 +1,9 @@
/** /**
* @author Edouard DUPIN * @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved * @copyright 2014, Edouard DUPIN, all right reserved
* * @license MPL-2 (see license file)
* @license APACHE-2 (see license file)
*/ */
#include <eci/Class.h> #include <eci/Class.hpp>
#include <eci/debug.h> #include <eci/debug.hpp>

View File

@ -1,15 +1,12 @@
/** /**
* @author Edouard DUPIN * @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved * @copyright 2014, Edouard DUPIN, all right reserved
* * @license MPL-2 (see license file)
* @license APACHE-2 (see license file)
*/ */
#ifndef __ECI_CLASS_H__ #pragma once
#define __ECI_CLASS_H__
#include <etk/types.h> #include <etk/types.hpp>
namespace eci { namespace eci {
class Class { class Class {
@ -18,5 +15,3 @@ namespace eci {
~Class() {}; ~Class() {};
}; };
} }
#endif

View File

@ -1,17 +1,15 @@
/** /**
* @author Edouard DUPIN * @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved * @copyright 2014, Edouard DUPIN, all right reserved
* * @license MPL-2 (see license file)
* @license APACHE-2 (see license file)
*/ */
#include <eci/Enum.h> #include <eci/Enum.hpp>
#include <eci/debug.h> #include <eci/debug.hpp>
void eci::Enum::addValue(const std::string& _name) { void eci::Enum::addValue(const etk::String& _name) {
if (m_values.size() == 0) { if (m_values.size() == 0) {
m_values.push_back(std::make_pair(_name, 0)); m_values.pushBack(etk::makePair(_name, 0));
return; return;
} }
int32_t lastValue = 0; int32_t lastValue = 0;
@ -22,12 +20,12 @@ void eci::Enum::addValue(const std::string& _name) {
} }
lastValue = m_values[iii].second; lastValue = m_values[iii].second;
} }
m_values.push_back(std::make_pair(_name, lastValue+1)); m_values.pushBack(etk::makePair(_name, lastValue+1));
} }
void eci::Enum::addValue(const std::string& _name, int32_t _value) { void eci::Enum::addValue(const etk::String& _name, int32_t _value) {
if (m_values.size() == 0) { if (m_values.size() == 0) {
m_values.push_back(std::make_pair(_name, _value)); m_values.pushBack(etk::makePair(_name, _value));
return; return;
} }
for (size_t iii=0; iii<m_values.size(); ++iii) { for (size_t iii=0; iii<m_values.size(); ++iii) {
@ -36,10 +34,10 @@ void eci::Enum::addValue(const std::string& _name, int32_t _value) {
return; return;
} }
} }
m_values.push_back(std::make_pair(_name, _value)); m_values.pushBack(etk::makePair(_name, _value));
} }
int32_t eci::Enum::getValue(const std::string& _name) const { int32_t eci::Enum::getValue(const etk::String& _name) const {
for (size_t iii=0; iii<m_values.size(); ++iii) { for (size_t iii=0; iii<m_values.size(); ++iii) {
if (m_values[iii].first == _name) { if (m_values[iii].first == _name) {
return m_values[iii].second; return m_values[iii].second;
@ -49,14 +47,14 @@ int32_t eci::Enum::getValue(const std::string& _name) const {
return 0; return 0;
} }
const std::string& eci::Enum::getName(int32_t _value) const { const etk::String& eci::Enum::getName(int32_t _value) const {
for (size_t iii=0; iii<m_values.size(); ++iii) { for (size_t iii=0; iii<m_values.size(); ++iii) {
if (m_values[iii].second == _value) { if (m_values[iii].second == _value) {
return m_values[iii].first; return m_values[iii].first;
} }
} }
ECI_ERROR("Enum name does not exist ... : '" << _value << "'"); ECI_ERROR("Enum name does not exist ... : '" << _value << "'");
static const std::string errorValue = "---UnknowName---"; static const etk::String errorValue = "---UnknowName---";
return errorValue; return errorValue;
} }

View File

@ -1,29 +0,0 @@
/**
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license APACHE-2 (see license file)
*/
#ifndef __ECI_ENUM_H__
#define __ECI_ENUM_H__
#include <etk/types.h>
namespace eci {
class Enum {
public:
Enum() {};
~Enum() {};
protected:
std::vector<std::pair<std::string, int32_t>> m_values;
public:
void addValue(const std::string& _name);
void addValue(const std::string& _name, int32_t _value);
int32_t getValue(const std::string& _name) const;
const std::string& getName(int32_t _value) const;
};
}
#endif

26
eci/Enum.hpp Normal file
View File

@ -0,0 +1,26 @@
/**
* @author Edouard DUPIN
* @copyright 2014, Edouard DUPIN, all right reserved
* @license MPL-2 (see license file)
*/
#pragma once
#include <etk/types.hpp>
#include <etk/Pair.hpp>
#include <etk/Vector.hpp>
namespace eci {
class Enum {
public:
Enum() {};
~Enum() {};
protected:
etk::Vector<etk::Pair<etk::String, int32_t>> m_values;
public:
void addValue(const etk::String& _name);
void addValue(const etk::String& _name, int32_t _value);
int32_t getValue(const etk::String& _name) const;
const etk::String& getName(int32_t _value) const;
};
}

View File

@ -1,23 +1,21 @@
/** /**
* @author Edouard DUPIN * @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved * @copyright 2014, Edouard DUPIN, all right reserved
* * @license MPL-2 (see license file)
* @license APACHE-2 (see license file)
*/ */
#include <eci/File.h> #include <eci/File.hpp>
#include <eci/debug.h> #include <eci/debug.hpp>
#include <etk/os/FSNode.h> #include <etk/os/FSNode.hpp>
#include <eci/lang/ParserCpp.h> #include <eci/lang/ParserCpp.hpp>
#include <eci/lang/ParserJS.h> #include <eci/lang/ParserJS.hpp>
static std::string getValue(const std::string& _file, const std::shared_ptr<eci::LexerNode>& _it) { static etk::String getValue(const etk::String& _file, const ememory::SharedPtr<eci::LexerNode>& _it) {
return std::string(_file, _it->getStartPos(), _it->getStopPos()-_it->getStartPos()); return etk::String(_file, _it->getStartPos(), _it->getStopPos()-_it->getStartPos());
} }
eci::Variable getVariableWithType(const std::string& _value) { eci::Variable getVariableWithType(const etk::String& _value) {
eci::Variable ret; eci::Variable ret;
if (_value == "void") { if (_value == "void") {
@ -59,7 +57,7 @@ eci::Variable getVariableWithType(const std::string& _value) {
return ret; return ret;
} }
eci::File::File(const std::string& _filename) { eci::File::File(const etk::String& _filename) {
m_fileName = _filename; m_fileName = _filename;
m_fileData = etk::FSNodeReadAllData(m_fileName); m_fileData = etk::FSNodeReadAllData(m_fileName);
if ( etk::end_with(m_fileName, "cpp", false) == true if ( etk::end_with(m_fileName, "cpp", false) == true
@ -72,13 +70,13 @@ eci::File::File(const std::string& _filename) {
tmpParser.parse(m_fileData); tmpParser.parse(m_fileData);
// all we need all the time: // all we need all the time:
std::vector<eci::Variable> returnList; etk::Vector<eci::Variable> returnList;
std::vector<eci::Variable> argumentList; etk::Vector<eci::Variable> argumentList;
std::string name; etk::String name;
std::string value; etk::String value;
std::shared_ptr<eci::Class> lastClass; ememory::SharedPtr<eci::Class> lastClass;
std::shared_ptr<eci::Function> lastFunction; ememory::SharedPtr<eci::Function> lastFunction;
std::shared_ptr<eci::Variable> lastVariable; ememory::SharedPtr<eci::Variable> lastVariable;
enum eci::visibility lastVisibility = eci::visibilityPublic; enum eci::visibility lastVisibility = eci::visibilityPublic;
for (auto &it : tmpParser.m_result.m_list) { for (auto &it : tmpParser.m_result.m_list) {
@ -115,7 +113,7 @@ eci::File::File(const std::string& _filename) {
case tokenCppType: case tokenCppType:
ECI_INFO("get type : " << value << "'" ); ECI_INFO("get type : " << value << "'" );
if (name == "") { if (name == "") {
returnList.push_back(getVariableWithType(value)); returnList.pushBack(getVariableWithType(value));
} else { } else {
ECI_ERROR(" get type : " << value << "' after name !!!" ); ECI_ERROR(" get type : " << value << "' after name !!!" );
} }

View File

@ -1,32 +0,0 @@
/**
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license APACHE-2 (see license file)
*/
#ifndef __ECI_FILE_H__
#define __ECI_FILE_H__
#include <etk/types.h>
#include <eci/Class.h>
#include <eci/Enum.h>
#include <eci/Variable.h>
#include <eci/Function.h>
namespace eci {
class File {
public:
File(const std::string& _filename);
~File() {};
protected:
std::string m_fileName; //!< Name of the file.
std::string m_fileData; //!< Data of the file.
std::vector<std::shared_ptr<eci::Function>> m_listFunction; // all function in the file
std::vector<std::shared_ptr<eci::Class>> m_listClass; // all class in the file
std::vector<std::shared_ptr<eci::Variable>> m_listVariable; // all variable in the file
};
}
#endif

28
eci/File.hpp Normal file
View File

@ -0,0 +1,28 @@
/**
* @author Edouard DUPIN
* @copyright 2014, Edouard DUPIN, all right reserved
* @license MPL-2 (see license file)
*/
#pragma once
#include <etk/types.hpp>
#include <eci/Class.hpp>
#include <eci/Enum.hpp>
#include <eci/Variable.hpp>
#include <eci/Function.hpp>
namespace eci {
class File {
public:
File(const etk::String& _filename);
~File() {};
protected:
etk::String m_fileName; //!< Name of the file.
etk::String m_fileData; //!< Data of the file.
etk::Vector<ememory::SharedPtr<eci::Function>> m_listFunction; // all function in the file
etk::Vector<ememory::SharedPtr<eci::Class>> m_listClass; // all class in the file
etk::Vector<ememory::SharedPtr<eci::Variable>> m_listVariable; // all variable in the file
};
}

View File

@ -1,13 +1,11 @@
/** /**
* @author Edouard DUPIN * @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved * @copyright 2014, Edouard DUPIN, all right reserved
* * @license MPL-2 (see license file)
* @license APACHE-2 (see license file)
*/ */
#include <eci/Function.h> #include <eci/Function.hpp>
#include <eci/debug.h> #include <eci/debug.hpp>
eci::Function::Function() : eci::Function::Function() :
@ -21,8 +19,8 @@ eci::Function::~Function() {
} }
std::vector<std::shared_ptr<eci::Value>> eci::Function::call(const std::vector<std::shared_ptr<eci::Value>>& _input) { etk::Vector<ememory::SharedPtr<eci::Value>> eci::Function::call(const etk::Vector<ememory::SharedPtr<eci::Value>>& _input) {
return std::vector<std::shared_ptr<eci::Value>>(); return etk::Vector<ememory::SharedPtr<eci::Value>>();
} }

View File

@ -1,19 +1,16 @@
/** /**
* @author Edouard DUPIN * @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved * @copyright 2014, Edouard DUPIN, all right reserved
* * @license MPL-2 (see license file)
* @license APACHE-2 (see license file)
*/ */
#ifndef __ECI_FUNCTION_H__ #pragma once
#define __ECI_FUNCTION_H__
#include <etk/types.h> #include <etk/types.hpp>
#include <eci/visibility.h> #include <eci/visibility.hpp>
#include <eci/Variable.h> #include <eci/Variable.hpp>
#include <eci/Value.h> #include <eci/Value.hpp>
#include <memory> #include <ememory/memory.hpp>
namespace eci { namespace eci {
class Function { class Function {
@ -21,14 +18,14 @@ namespace eci {
Function(); Function();
~Function(); ~Function();
protected: protected:
std::string m_name; //!< Function Name. etk::String m_name; //!< Function Name.
bool m_const; //!< The function is const. bool m_const; //!< The function is const.
bool m_static; //!< function is static. bool m_static; //!< function is static.
enum eci::visibility m_visibility; //!< Visibility of the function enum eci::visibility m_visibility; //!< Visibility of the function
std::vector<eci::Variable> m_return; //!< return value. etk::Vector<eci::Variable> m_return; //!< return value.
std::vector<eci::Variable> m_arguments; //!< return value. etk::Vector<eci::Variable> m_arguments; //!< return value.
std::vector<std::shared_ptr<eci::Value>> call(const std::vector<std::shared_ptr<eci::Value>>& _input); etk::Vector<ememory::SharedPtr<eci::Value>> call(const etk::Vector<ememory::SharedPtr<eci::Value>>& _input);
// 3 step: // 3 step:
// - first get Tockens (returns , names, const, parameters, codes // - first get Tockens (returns , names, const, parameters, codes
@ -37,4 +34,3 @@ namespace eci {
}; };
} }
#endif

View File

@ -1,13 +1,11 @@
/** /**
* @author Edouard DUPIN * @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved * @copyright 2014, Edouard DUPIN, all right reserved
* * @license MPL-2 (see license file)
* @license APACHE-2 (see license file)
*/ */
#include <eci/Interpreter.h> #include <eci/Interpreter.hpp>
#include <eci/debug.h> #include <eci/debug.hpp>
eci::Interpreter::Interpreter() { eci::Interpreter::Interpreter() {
@ -17,9 +15,9 @@ eci::Interpreter::~Interpreter() {
} }
void eci::Interpreter::addFile(const std::string& _filename) { void eci::Interpreter::addFile(const etk::String& _filename) {
// TODO : Check if file is not previously loaded ... // TODO : Check if file is not previously loaded ...
m_files.push_back(eci::File(_filename)); m_files.pushBack(eci::File(_filename));
} }
void eci::Interpreter::main() { void eci::Interpreter::main() {

View File

@ -1,17 +1,14 @@
/** /**
* @author Edouard DUPIN * @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved * @copyright 2014, Edouard DUPIN, all right reserved
* * @license MPL-2 (see license file)
* @license APACHE-2 (see license file)
*/ */
#ifndef __ECI_INTERPRETER_H__ #pragma once
#define __ECI_INTERPRETER_H__
#include <etk/types.h> #include <etk/types.hpp>
#include <eci/Library.h> #include <eci/Library.hpp>
#include <eci/File.h> #include <eci/File.hpp>
namespace eci { namespace eci {
namespace interpreter { namespace interpreter {
@ -29,7 +26,7 @@ namespace eci {
typeOperator, //!< Call operator "xx" ex : "*" "++" "=" "==" typeOperator, //!< Call operator "xx" ex : "*" "++" "=" "=="
typeReserveId = 5000, typeReserveId = 5000,
}; };
class Element : public std::enable_shared_from_this<Element> { class Element : public ememory::EnableSharedFromThis<Element> {
protected: protected:
int32_t m_tockenId; int32_t m_tockenId;
public: public:
@ -45,7 +42,7 @@ namespace eci {
}; };
class Block : public Element { class Block : public Element {
protected: protected:
std::vector<std::shared_ptr<Element>> m_actions; etk::Vector<ememory::SharedPtr<Element>> m_actions;
public: public:
Block() : Block() :
Element(interpreter::typeBlock) { Element(interpreter::typeBlock) {
@ -115,9 +112,9 @@ namespace eci {
}; };
class Condition : public Element { class Condition : public Element {
protected: protected:
std::shared_ptr<Element> m_condition; ememory::SharedPtr<Element> m_condition;
std::shared_ptr<Block> m_block; ememory::SharedPtr<Block> m_block;
std::shared_ptr<Block> m_blockElse; ememory::SharedPtr<Block> m_blockElse;
public: public:
Condition() : Condition() :
Element(interpreter::typeCondition) { Element(interpreter::typeCondition) {
@ -128,10 +125,10 @@ namespace eci {
}; };
class For : public Element { class For : public Element {
protected: protected:
std::shared_ptr<Element> m_init; ememory::SharedPtr<Element> m_init;
std::shared_ptr<Element> m_condition; ememory::SharedPtr<Element> m_condition;
std::shared_ptr<Element> m_increment; ememory::SharedPtr<Element> m_increment;
std::shared_ptr<Block> m_block; ememory::SharedPtr<Block> m_block;
public: public:
For() : For() :
Element(interpreter::typeFor) { Element(interpreter::typeFor) {
@ -143,8 +140,8 @@ namespace eci {
class While : public Element { class While : public Element {
protected: protected:
bool m_conditionAtStart; bool m_conditionAtStart;
std::shared_ptr<Element> m_condition; ememory::SharedPtr<Element> m_condition;
std::shared_ptr<Element> m_action; ememory::SharedPtr<Element> m_action;
public: public:
While() : While() :
Element(interpreter::typeWhile) { Element(interpreter::typeWhile) {
@ -154,7 +151,7 @@ namespace eci {
}; };
class Operator : public Element { class Operator : public Element {
protected: protected:
std::string m_operator; etk::String m_operator;
public: public:
Operator() : Operator() :
Element(interpreter::typeOperator) { Element(interpreter::typeOperator) {
@ -169,12 +166,10 @@ namespace eci {
Interpreter(); Interpreter();
~Interpreter(); ~Interpreter();
protected: protected:
std::vector<eci::Library> m_libraries; //!< list of all loaded libraries. etk::Vector<eci::Library> m_libraries; //!< list of all loaded libraries.
std::vector<eci::File> m_files; //!< List of all files in the current program. etk::Vector<eci::File> m_files; //!< List of all files in the current program.
public: public:
void addFile(const std::string& _filename); void addFile(const etk::String& _filename);
void main(); void main();
}; };
} }
#endif

View File

@ -1,14 +1,12 @@
/** /**
* @author Edouard DUPIN * @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved * @copyright 2014, Edouard DUPIN, all right reserved
* * @license MPL-2 (see license file)
* @license APACHE-2 (see license file)
*/ */
#include <memory> #include <memory>
#include <eci/Lexer.h> #include <eci/Lexer.hpp>
#include <eci/debug.h> #include <eci/debug.hpp>
eci::Lexer::Lexer() { eci::Lexer::Lexer() {
@ -18,44 +16,44 @@ eci::Lexer::~Lexer() {
} }
void eci::Lexer::append(int32_t _tokenId, const std::string& _regularExpression) { void eci::Lexer::append(int32_t _tokenId, const etk::String& _regularExpression) {
ECI_INFO("CPP lexer add : [" << _tokenId << "] '" << _regularExpression << "'"); ECI_INFO("CPP lexer add : [" << _tokenId << "] '" << _regularExpression << "'");
try { try {
m_searchList.push_back(std::make_shared<eci::Lexer::TypeBase>(_tokenId, _regularExpression)); m_searchList.pushBack(ememory::makeShared<eci::Lexer::TypeBase>(_tokenId, _regularExpression));
} catch (std::exception e){ } catch (etk::Exception e){
ECI_ERROR(" create reg exp : '" << _regularExpression << "' : what:" << e.what()); ECI_ERROR(" create reg exp : '" << _regularExpression << "' : what:" << e.what());
} }
} }
void eci::Lexer::appendSection(int32_t _tokenId, int32_t _tockenStart, int32_t _tockenStop, const std::string& _type) { void eci::Lexer::appendSection(int32_t _tokenId, int32_t _tockenStart, int32_t _tockenStop, const etk::String& _type) {
ECI_INFO("CPP lexer add section [" << _tokenId << "] : '" << _tockenStart << "' .. '" << _tockenStop << "'"); ECI_INFO("CPP lexer add section [" << _tokenId << "] : '" << _tockenStart << "' .. '" << _tockenStop << "'");
try { try {
m_searchList.push_back(std::make_shared<eci::Lexer::TypeSection>(_tokenId, _tockenStart, _tockenStop, _type)); m_searchList.pushBack(ememory::makeShared<eci::Lexer::TypeSection>(_tokenId, _tockenStart, _tockenStop, _type));
} catch (std::exception e){ } catch (etk::Exception e){
ECI_ERROR(" create reg exp : '" << _tockenStart << "' .. '" << _tockenStop << "' : what:" << e.what()); ECI_ERROR(" create reg exp : '" << _tockenStart << "' .. '" << _tockenStop << "' : what:" << e.what());
} }
} }
void eci::Lexer::appendSub(int32_t _tokenIdParrent, int32_t _tokenId, const std::string& _regularExpression) { void eci::Lexer::appendSub(int32_t _tokenIdParrent, int32_t _tokenId, const etk::String& _regularExpression) {
ECI_INFO("CPP lexer add sub : [" << _tokenId << "] [" << _tokenIdParrent << "] '" << _regularExpression << "'"); ECI_INFO("CPP lexer add sub : [" << _tokenId << "] [" << _tokenIdParrent << "] '" << _regularExpression << "'");
try { try {
m_searchList.push_back(std::make_shared<eci::Lexer::TypeSubBase>(_tokenId, _tokenIdParrent, _regularExpression)); m_searchList.pushBack(ememory::makeShared<eci::Lexer::TypeSubBase>(_tokenId, _tokenIdParrent, _regularExpression));
} catch (std::exception e){ } catch (etk::Exception e){
ECI_ERROR(" create reg exp : '" << _regularExpression << "' : what:" << e.what()); ECI_ERROR(" create reg exp : '" << _regularExpression << "' : what:" << e.what());
} }
} }
void eci::Lexer::appendSubSection(int32_t _tokenIdParrent, int32_t _tokenId, int32_t _tockenStart, int32_t _tockenStop, const std::string& _type) { void eci::Lexer::appendSubSection(int32_t _tokenIdParrent, int32_t _tokenId, int32_t _tockenStart, int32_t _tockenStop, const etk::String& _type) {
ECI_INFO("CPP lexer add section sub : [" << _tokenId << "] [" << _tokenIdParrent << "] '" << _tockenStart << "' .. '" << _tockenStop << "'"); ECI_INFO("CPP lexer add section sub : [" << _tokenId << "] [" << _tokenIdParrent << "] '" << _tockenStart << "' .. '" << _tockenStop << "'");
try { try {
m_searchList.push_back(std::make_shared<eci::Lexer::TypeSubSection>(_tokenId, _tokenIdParrent, _tockenStart, _tockenStop, _type)); m_searchList.pushBack(ememory::makeShared<eci::Lexer::TypeSubSection>(_tokenId, _tokenIdParrent, _tockenStart, _tockenStop, _type));
} catch (std::exception e){ } catch (etk::Exception e){
ECI_ERROR(" create reg exp : '" << _tockenStart << "' .. '" << _tockenStop << "' : what:" << e.what()); ECI_ERROR(" create reg exp : '" << _tockenStart << "' .. '" << _tockenStop << "' : what:" << e.what());
} }
} }
eci::LexerResult eci::Lexer::interprete(const std::string& _data) { eci::LexerResult eci::Lexer::interprete(const etk::String& _data) {
eci::LexerResult result(_data); eci::LexerResult result(_data);
ECI_INFO("Parse : \n" << _data); ECI_INFO("Parse : \n" << _data);
for (auto &it : m_searchList) { for (auto &it : m_searchList) {
@ -84,21 +82,27 @@ eci::LexerResult eci::Lexer::interprete(const std::string& _data) {
++itList; ++itList;
continue; continue;
} }
std::vector<std::shared_ptr<eci::LexerNode>> res = it->parse(_data, start, (*itList)->getStartPos()); etk::Vector<ememory::SharedPtr<eci::LexerNode>> res = it->parse(_data, start, (*itList)->getStartPos());
// append it in the buffer: // append it in the buffer:
if (res.size() > 0) { if (res.size() > 0) {
int32_t currentPos = std::distance(result.m_list.begin(), itList) + res.size() ; int32_t currentPos = etk::distance(result.m_list.begin(), itList) + res.size();
for (auto &it: res) {
result.m_list.insert(itList, it);
++itList;
}
/*
result.m_list.insert(itList, res.begin(), res.end()); result.m_list.insert(itList, res.begin(), res.end());
itList = result.m_list.begin() + currentPos; itList = result.m_list.begin() + currentPos;
*/
} }
start = (*itList)->getStopPos(); start = (*itList)->getStopPos();
++itList; ++itList;
} }
// Do the last element : // Do the last element :
if (start < _data.size()) { if (start < _data.size()) {
std::vector<std::shared_ptr<eci::LexerNode>> res = it->parse(_data, start, _data.size()); etk::Vector<ememory::SharedPtr<eci::LexerNode>> res = it->parse(_data, start, _data.size());
for (auto &itRes : res) { for (auto &itRes : res) {
result.m_list.push_back(itRes); result.m_list.pushBack(itRes);
} }
} }
} }
@ -111,52 +115,59 @@ eci::LexerResult eci::Lexer::interprete(const std::string& _data) {
} }
return result; return result;
} }
/*
static std::regex_constants::match_flag_type createFlags(const std::string& _data, int32_t _start, int32_t _stop) { static etk::RegEx_constants::match_flag_type createFlags(const etk::String& _data, int32_t _start, int32_t _stop) {
std::regex_constants::match_flag_type flags = std::regex_constants::match_any; etk::RegEx_constants::match_flag_type flags = etk::RegEx_constants::match_any;
//ECI_DEBUG("find data at : start=" << _start << " stop=" << _stop << " regex='" << m_regexValue << "'"); //ECI_DEBUG("find data at : start=" << _start << " stop=" << _stop << " regex='" << m_regexValue << "'");
if ((int64_t)_stop <= (int64_t)_data.size()) { if ((int64_t)_stop <= (int64_t)_data.size()) {
char val = _data[_stop]; char val = _data[_stop];
if ( val != '\n' if ( val != '\n'
&& val != '\r') { && val != '\r') {
//after last char ==> not end of line ($ would not work)) //after last char ==> not end of line ($ would not work))
flags |= std::regex_constants::match_not_eol; flags |= etk::RegEx_constants::match_not_eol;
} }
if (!( ('a' <= val && val <= 'z') if (!( ('a' <= val && val <= 'z')
|| ('A' <= val && val <= 'Z') || ('A' <= val && val <= 'Z')
|| ('0' <= val && val <= '9') || ('0' <= val && val <= '9')
|| val == '_')) { || val == '_')) {
flags |= std::regex_constants::match_not_eow; flags |= etk::RegEx_constants::match_not_eow;
} }
} }
if (_start>0) { if (_start>0) {
flags |= std::regex_constants::match_prev_avail; flags |= etk::RegEx_constants::match_prev_avail;
} }
return flags; return flags;
} }
*/
std::vector<std::shared_ptr<eci::LexerNode>> eci::Lexer::TypeBase::parse(const std::string& _data, int32_t _start, int32_t _stop) { etk::Vector<ememory::SharedPtr<eci::LexerNode>> eci::Lexer::TypeBase::parse(const etk::String& _data, int32_t _start, int32_t _stop) {
std::vector<std::shared_ptr<eci::LexerNode>> result; etk::Vector<ememory::SharedPtr<eci::LexerNode>> result;
ECI_VERBOSE("parse : " << getValue()); ECI_VERBOSE("parse : " << getValue());
while (true) { while (true) {
std::smatch resultMatch; if (m_regex.parse(_data, _start, _stop) == true) {
std::regex_constants::match_flag_type flags = createFlags(_data, _start, _stop); result.pushBack(ememory::makeShared<eci::LexerNode>(m_tockenId, m_regex.start(), m_regex.stop()));
std::regex_search(_data.begin()+_start, _data.begin()+_stop, resultMatch, regex, flags);
if (resultMatch.size() > 0) {
int32_t start = std::distance(_data.begin(), resultMatch[0].first);
int32_t stop = std::distance(_data.begin(), resultMatch[0].second);
ECI_VERBOSE(" find data at : start=" << start << " stop=" << stop << " data='" <<std::string(_data, start, stop-start) << "'" );
_start = stop;
result.push_back(std::make_shared<eci::LexerNode>(m_tockenId, start, stop));
} else { } else {
break; break;
} }
/*
std::smatch resultMatch;
etk::RegEx_constants::match_flag_type flags = createFlags(_data, _start, _stop);
etk::RegEx_search(_data.begin()+_start, _data.begin()+_stop, resultMatch, regex, flags);
if (resultMatch.size() > 0) {
int32_t start = etk::distance(_data.begin(), resultMatch[0].first);
int32_t stop = etk::distance(_data.begin(), resultMatch[0].second);
ECI_VERBOSE(" find data at : start=" << start << " stop=" << stop << " data='" <<etk::String(_data, start, stop-start) << "'" );
_start = stop;
result.pushBack(ememory::makeShared<eci::LexerNode>(m_tockenId, start, stop));
} else {
break;
}
*/
} }
return result; return result;
} }
void eci::Lexer::TypeSection::parseSectionCurrent(std::vector<std::shared_ptr<eci::LexerNode>>& _data) { void eci::Lexer::TypeSection::parseSectionCurrent(etk::Vector<ememory::SharedPtr<eci::LexerNode>>& _data) {
std::vector<size_t> posList; etk::Vector<size_t> posList;
for (size_t iii=0; iii<_data.size(); ++iii) { for (size_t iii=0; iii<_data.size(); ++iii) {
if (_data[iii] == nullptr) { if (_data[iii] == nullptr) {
ECI_TODO("remove null shared_ptr"); ECI_TODO("remove null shared_ptr");
@ -164,7 +175,7 @@ void eci::Lexer::TypeSection::parseSectionCurrent(std::vector<std::shared_ptr<ec
} }
if (_data[iii]->getTockenId() == tockenStart) { if (_data[iii]->getTockenId() == tockenStart) {
ECI_VERBOSE("Detect start TOCKEN " << iii); ECI_VERBOSE("Detect start TOCKEN " << iii);
posList.push_back(iii); posList.pushBack(iii);
} }
if (_data[iii]->getTockenId() == tockenStop) { if (_data[iii]->getTockenId() == tockenStop) {
if (posList.size() == 0) { if (posList.size() == 0) {
@ -173,44 +184,44 @@ void eci::Lexer::TypeSection::parseSectionCurrent(std::vector<std::shared_ptr<ec
} }
size_t startId = posList.back(); size_t startId = posList.back();
ECI_VERBOSE("Detect stop TOCKEN " << startId << " => " << iii << " list size=" << posList.size()); ECI_VERBOSE("Detect stop TOCKEN " << startId << " => " << iii << " list size=" << posList.size());
posList.pop_back(); posList.popBack();
// agragate the subtoken : // agragate the subtoken :
int32_t startPos = _data[startId]->getStartPos(); int32_t startPos = _data[startId]->getStartPos();
int32_t stopPos = _data[iii]->getStopPos(); int32_t stopPos = _data[iii]->getStopPos();
std::shared_ptr<eci::LexerNodeContainer> newContainer = std::make_shared<eci::LexerNodeContainer>(m_tockenId, startPos, stopPos, type); ememory::SharedPtr<eci::LexerNodeContainer> newContainer = ememory::makeShared<eci::LexerNodeContainer>(m_tockenId, startPos, stopPos, type);
ECI_VERBOSE(" Agregate: " << startId << " -> " << iii); ECI_VERBOSE(" Agregate: " << startId << " -> " << iii);
newContainer->m_list.insert(newContainer->m_list.begin(), _data.begin()+startId+1, _data.begin()+iii); newContainer->m_list.insert(0, &_data[startId+1], iii-(startId+1));
ECI_VERBOSE(" list size=" << newContainer->m_list.size() << " old=" << _data.size()); ECI_VERBOSE(" list size=" << newContainer->m_list.size() << " old=" << _data.size());
_data.erase(_data.begin()+startId, _data.begin()+iii+1); _data.erase(startId, iii+1);
ECI_VERBOSE(" list size=" << newContainer->m_list.size() << " old=" << _data.size()); ECI_VERBOSE(" list size=" << newContainer->m_list.size() << " old=" << _data.size());
_data.insert(_data.begin()+startId, newContainer); _data.insert(startId, newContainer);
ECI_VERBOSE(" list size=" << newContainer->m_list.size() << " old=" << _data.size()); ECI_VERBOSE(" list size=" << newContainer->m_list.size() << " old=" << _data.size());
iii = startId-1; iii = startId-1;
} }
} }
} }
void eci::Lexer::TypeSection::parseSection(std::vector<std::shared_ptr<eci::LexerNode>>& _data) { void eci::Lexer::TypeSection::parseSection(etk::Vector<ememory::SharedPtr<eci::LexerNode>>& _data) {
ECI_VERBOSE("parse section : " << getValue()); ECI_VERBOSE("parse section : " << getValue());
for (auto &it : _data) { for (auto &it : _data) {
if (it == nullptr) { if (it == nullptr) {
continue; continue;
} }
if (it->isNodeContainer() == true) { if (it->isNodeContainer() == true) {
std::shared_ptr<eci::LexerNodeContainer> sec = std::dynamic_pointer_cast<eci::LexerNodeContainer>(it); ememory::SharedPtr<eci::LexerNodeContainer> sec = ememory::dynamicPointerCast<eci::LexerNodeContainer>(it);
parseSection(sec->m_list); parseSection(sec->m_list);
} }
} }
parseSectionCurrent(_data); parseSectionCurrent(_data);
} }
std::vector<std::shared_ptr<eci::LexerNode>> eci::Lexer::TypeSubBase::parse(const std::string& _data, int32_t _start, int32_t _stop) { etk::Vector<ememory::SharedPtr<eci::LexerNode>> eci::Lexer::TypeSubBase::parse(const etk::String& _data, int32_t _start, int32_t _stop) {
std::vector<std::shared_ptr<eci::LexerNode>> result; etk::Vector<ememory::SharedPtr<eci::LexerNode>> result;
ECI_TODO("later 2"); ECI_TODO("later 2");
return result; return result;
} }
std::vector<std::shared_ptr<eci::LexerNode>> eci::Lexer::TypeSubSection::parse(const std::string& _data, int32_t _start, int32_t _stop) { etk::Vector<ememory::SharedPtr<eci::LexerNode>> eci::Lexer::TypeSubSection::parse(const etk::String& _data, int32_t _start, int32_t _stop) {
std::vector<std::shared_ptr<eci::LexerNode>> result; etk::Vector<ememory::SharedPtr<eci::LexerNode>> result;
ECI_TODO("later 3"); ECI_TODO("later 3");
return result; return result;
} }

View File

@ -1,20 +1,17 @@
/** /**
* @author Edouard DUPIN * @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved * @copyright 2014, Edouard DUPIN, all right reserved
* * @license MPL-2 (see license file)
* @license APACHE-2 (see license file)
*/ */
#ifndef __ECI_LEXER_H__ #pragma once
#define __ECI_LEXER_H__
#include <etk/types.h> #include <etk/types.hpp>
#include <etk/stdTools.h> #include <etk/stdTools.hpp>
#include <regex> #include <etk/RegEx.hpp>
#include <map> #include <etk/Map.hpp>
#include <vector> #include <etk/Vector.hpp>
#include <eci/Interpreter.h> #include <eci/Interpreter.hpp>
namespace eci { namespace eci {
@ -28,44 +25,44 @@ namespace eci {
} }
virtual ~LexerNode() {}; virtual ~LexerNode() {};
int32_t m_startPos; int32_t m_startPos;
int32_t getStartPos() { int32_t getStartPos() const {
return m_startPos; return m_startPos;
} }
int32_t m_stopPos; int32_t m_stopPos;
int32_t getStopPos() { int32_t getStopPos() const {
return m_stopPos; return m_stopPos;
} }
virtual bool isNodeContainer() { virtual bool isNodeContainer() const {
return false; return false;
} }
}; };
class LexerNodeContainer : public LexerNode { class LexerNodeContainer : public LexerNode {
private: private:
std::string m_type; etk::String m_type;
public: public:
LexerNodeContainer(int32_t _tockenId=-1, int32_t _startPos=-1, int32_t _stopPos=-1, const std::string& _type="") : LexerNodeContainer(int32_t _tockenId=-1, int32_t _startPos=-1, int32_t _stopPos=-1, const etk::String& _type="") :
LexerNode(_tockenId, _startPos, _stopPos) { LexerNode(_tockenId, _startPos, _stopPos) {
m_type = _type; m_type = _type;
} }
virtual ~LexerNodeContainer() {}; virtual ~LexerNodeContainer() {};
std::vector<std::shared_ptr<eci::LexerNode>> m_list; etk::Vector<ememory::SharedPtr<eci::LexerNode>> m_list;
virtual bool isNodeContainer() { virtual bool isNodeContainer() const {
return true; return true;
} }
const std::string& getType() const { const etk::String& getType() const {
return m_type; return m_type;
} }
}; };
class LexerResult { class LexerResult {
private: private:
std::string m_data; etk::String m_data;
public: public:
LexerResult(const std::string& _data="") : LexerResult(const etk::String& _data="") :
m_data(_data) { m_data(_data) {
} }
~LexerResult() {}; ~LexerResult() {};
std::vector<std::shared_ptr<eci::LexerNode>> m_list; etk::Vector<ememory::SharedPtr<eci::LexerNode>> m_list;
}; };
class Lexer { class Lexer {
@ -78,7 +75,7 @@ namespace eci {
class Type { class Type {
protected: protected:
int32_t m_tockenId; int32_t m_tockenId;
std::string m_regexValue; etk::String m_regexValue;
public: public:
Type(int32_t _tockenId) : Type(int32_t _tockenId) :
m_tockenId(_tockenId) {} m_tockenId(_tockenId) {}
@ -89,14 +86,14 @@ namespace eci {
int32_t getTockenId() { int32_t getTockenId() {
return m_tockenId; return m_tockenId;
} }
virtual std::vector<std::shared_ptr<eci::LexerNode>> parse(const std::string& _data, int32_t _start, int32_t _stop) { virtual etk::Vector<ememory::SharedPtr<eci::LexerNode>> parse(const etk::String& _data, int32_t _start, int32_t _stop) {
return std::vector<std::shared_ptr<eci::LexerNode>>(); return etk::Vector<ememory::SharedPtr<eci::LexerNode>>();
}; };
virtual void parseSection(std::vector<std::shared_ptr<eci::LexerNode>>& _data) { virtual void parseSection(etk::Vector<ememory::SharedPtr<eci::LexerNode>>& _data) {
// nothing to do ... // nothing to do ...
}; };
std::string getValue() { etk::String getValue() {
return m_regexValue; return m_regexValue;
}; };
virtual bool isSubParse() { virtual bool isSubParse() {
@ -108,28 +105,28 @@ namespace eci {
}; };
class TypeBase : public Type { class TypeBase : public Type {
public: public:
std::regex regex; etk::RegEx<etk::String> m_regex;
TypeBase(int32_t _tockenId, const std::string& _regex="") : TypeBase(int32_t _tockenId, const etk::String& _regex="") :
Type(_tockenId), Type(_tockenId),
regex(_regex, std::regex_constants::optimize | std::regex_constants::ECMAScript) { m_regex(_regex) {
m_regexValue = _regex; m_regexValue = _regex;
} }
virtual int32_t getType() { virtual int32_t getType() {
return TYPE_BASE; return TYPE_BASE;
} }
std::vector<std::shared_ptr<eci::LexerNode>> parse(const std::string& _data, int32_t _start, int32_t _stop); etk::Vector<ememory::SharedPtr<eci::LexerNode>> parse(const etk::String& _data, int32_t _start, int32_t _stop);
}; };
class TypeSection : public Type { class TypeSection : public Type {
public: public:
int32_t tockenStart; int32_t tockenStart;
int32_t tockenStop; int32_t tockenStop;
std::string type; etk::String type;
TypeSection(int32_t _tockenId, int32_t _tockenStart=-1, int32_t _tockenStop=-1, const std::string& _type="") : TypeSection(int32_t _tockenId, int32_t _tockenStart=-1, int32_t _tockenStop=-1, const etk::String& _type="") :
Type(_tockenId), Type(_tockenId),
tockenStart(_tockenStart), tockenStart(_tockenStart),
tockenStop(_tockenStop), tockenStop(_tockenStop),
type(_type) { type(_type) {
m_regexValue = "tok=" + etk::to_string(tockenStart) + " -> tok=" + etk::to_string(tockenStop); m_regexValue = "tok=" + etk::toString(tockenStart) + " -> tok=" + etk::toString(tockenStop);
} }
virtual int32_t getType() { virtual int32_t getType() {
return TYPE_SECTION; return TYPE_SECTION;
@ -137,19 +134,19 @@ namespace eci {
virtual bool isSection() { virtual bool isSection() {
return true; return true;
} }
void parseSectionCurrent(std::vector<std::shared_ptr<eci::LexerNode>>& _data); void parseSectionCurrent(etk::Vector<ememory::SharedPtr<eci::LexerNode>>& _data);
void parseSection(std::vector<std::shared_ptr<eci::LexerNode>>& _data); void parseSection(etk::Vector<ememory::SharedPtr<eci::LexerNode>>& _data);
}; };
class TypeSubBase : public TypeBase { class TypeSubBase : public TypeBase {
public: public:
int32_t parrent; int32_t parrent;
TypeSubBase(int32_t _tockenId, int32_t _tokenIdParrent=-1, const std::string& _regex="") : TypeSubBase(int32_t _tockenId, int32_t _tokenIdParrent=-1, const etk::String& _regex="") :
TypeBase(_tockenId, _regex), TypeBase(_tockenId, _regex),
parrent(_tokenIdParrent) {} parrent(_tokenIdParrent) {}
virtual int32_t getType() { virtual int32_t getType() {
return TYPE_SUB_BASE; return TYPE_SUB_BASE;
} }
std::vector<std::shared_ptr<eci::LexerNode>> parse(const std::string& _data, int32_t _start, int32_t _stop); etk::Vector<ememory::SharedPtr<eci::LexerNode>> parse(const etk::String& _data, int32_t _start, int32_t _stop);
bool isSubParse() { bool isSubParse() {
return true; return true;
} }
@ -157,18 +154,18 @@ namespace eci {
class TypeSubSection : public TypeSection { class TypeSubSection : public TypeSection {
public: public:
int32_t parrent; int32_t parrent;
TypeSubSection(int32_t _tockenId, int32_t _tokenIdParrent=-1, int32_t _tockenStart=-1, int32_t _tockenStop=-1, const std::string& _type="") : TypeSubSection(int32_t _tockenId, int32_t _tokenIdParrent=-1, int32_t _tockenStart=-1, int32_t _tockenStop=-1, const etk::String& _type="") :
TypeSection(_tockenId, _tockenStart, _tockenStop, _type), TypeSection(_tockenId, _tockenStart, _tockenStop, _type),
parrent(_tokenIdParrent) {} parrent(_tokenIdParrent) {}
virtual int32_t getType() { virtual int32_t getType() {
return TYPE_SUB_SECTION; return TYPE_SUB_SECTION;
} }
std::vector<std::shared_ptr<eci::LexerNode>> parse(const std::string& _data, int32_t _start, int32_t _stop); etk::Vector<ememory::SharedPtr<eci::LexerNode>> parse(const etk::String& _data, int32_t _start, int32_t _stop);
bool isSubParse() { bool isSubParse() {
return true; return true;
} }
}; };
std::vector<std::shared_ptr<eci::Lexer::Type>> m_searchList; etk::Vector<ememory::SharedPtr<eci::Lexer::Type>> m_searchList;
public: public:
Lexer(); Lexer();
~Lexer(); ~Lexer();
@ -177,7 +174,7 @@ namespace eci {
* @param[in] _tokenId Tocken id value. * @param[in] _tokenId Tocken id value.
* @param[in] _regularExpression reconise regular expression. * @param[in] _regularExpression reconise regular expression.
*/ */
void append(int32_t _tokenId, const std::string& _regularExpression); void append(int32_t _tokenId, const etk::String& _regularExpression);
/** /**
* @brief Append a Token recognition (section reconise start and stop with counting the number of start and stop). * @brief Append a Token recognition (section reconise start and stop with counting the number of start and stop).
* @param[in] _tokenId Tocken id value. * @param[in] _tokenId Tocken id value.
@ -185,14 +182,14 @@ namespace eci {
* @param[in] _tockenStop Tocken stop. * @param[in] _tockenStop Tocken stop.
* @param[in] _type register type when we parse it ... * @param[in] _type register type when we parse it ...
*/ */
void appendSection(int32_t _tokenId, int32_t _tockenStart, int32_t _tockenStop, const std::string& _type); void appendSection(int32_t _tokenId, int32_t _tockenStart, int32_t _tockenStop, const etk::String& _type);
/** /**
* @brief Append a Token recognition (sub parsing). * @brief Append a Token recognition (sub parsing).
* @param[in] _tokenIdParrent parrent Tocken id value. * @param[in] _tokenIdParrent parrent Tocken id value.
* @param[in] _tokenId Tocken id value. * @param[in] _tokenId Tocken id value.
* @param[in] _regularExpression reconise regular expression. * @param[in] _regularExpression reconise regular expression.
*/ */
void appendSub(int32_t _tokenIdParrent, int32_t _tokenId, const std::string& _regularExpression); void appendSub(int32_t _tokenIdParrent, int32_t _tokenId, const etk::String& _regularExpression);
/** /**
* @brief Append a Token recognition (sub parsing) (section reconise start and stop with counting the number of start and stop). * @brief Append a Token recognition (sub parsing) (section reconise start and stop with counting the number of start and stop).
* @param[in] _tokenIdParrent parrent Tocken id value. * @param[in] _tokenIdParrent parrent Tocken id value.
@ -201,10 +198,8 @@ namespace eci {
* @param[in] _tockenStop Tocken stop. * @param[in] _tockenStop Tocken stop.
* @param[in] _type register type when we parse it ... * @param[in] _type register type when we parse it ...
*/ */
void appendSubSection(int32_t _tokenIdParrent, int32_t _tokenId, int32_t _tockenStart, int32_t _tockenStop, const std::string& _type); void appendSubSection(int32_t _tokenIdParrent, int32_t _tokenId, int32_t _tockenStart, int32_t _tockenStop, const etk::String& _type);
LexerResult interprete(const std::string& _data); LexerResult interprete(const etk::String& _data);
}; };
} }
#endif

View File

@ -1,11 +1,9 @@
/** /**
* @author Edouard DUPIN * @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved * @copyright 2014, Edouard DUPIN, all right reserved
* * @license MPL-2 (see license file)
* @license APACHE-2 (see license file)
*/ */
#include <eci/Library.h> #include <eci/Library.hpp>
#include <eci/debug.h> #include <eci/debug.hpp>

View File

@ -1,15 +1,13 @@
/** /**
* @author Edouard DUPIN * @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved * @copyright 2014, Edouard DUPIN, all right reserved
* * @license MPL-2 (see license file)
* @license APACHE-2 (see license file)
*/ */
#ifndef __ECI_LIBRARY_H__ #pragma once
#define __ECI_LIBRARY_H__
#include <etk/types.h> #include <etk/types.hpp>
#include <etk/String.hpp>
namespace eci { namespace eci {
class Library { class Library {
@ -17,8 +15,7 @@ namespace eci {
Library() {}; Library() {};
~Library() {}; ~Library() {};
protected: protected:
std::string m_name; //!< library name (just for debug) etk::String m_name; //!< library name (just for debug)
}; };
} }
#endif

View File

@ -1,11 +1,10 @@
/** /**
* @author Edouard DUPIN * @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved * @copyright 2014, Edouard DUPIN, all right reserved
* * @license MPL-2 (see license file)
* @license APACHE-2 (see license file)
*/ */
#include <eci/Type.h>
#include <eci/debug.h> #include <eci/Type.hpp>
#include <eci/debug.hpp>

View File

@ -1,77 +0,0 @@
/**
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license APACHE-2 (see license file)
*/
#ifndef __ECI_TYPE_H__
#define __ECI_TYPE_H__
#include <etk/types.h>
#include <map>
#include <memory>
#include <eci/debug.h>
namespace eci {
class Variable;
class Type : public std::enable_shared_from_this<eci::Type> {
protected:
std::string m_signature; // !!! <== specific au language ...
public:
Type() {};
virtual ~Type() {};
virtual std::shared_ptr<eci::Variable> callOperator(const std::shared_ptr<eci::Variable>& _this,
const std::string& _operatorName,
const std::shared_ptr<eci::Variable>& _obj) {
ECI_ERROR("call unknow operator : '" << _operatorName << "'");
return nullptr;
}
virtual std::vector<std::shared_ptr<eci::Variable>> callFunction(const std::shared_ptr<eci::Variable>& _this,
const std::string& _name,
const std::vector<std::shared_ptr<eci::Variable>>& _objList) {
ECI_ERROR("call unknow function : '" << _name << "' with _input.size()=" << _objList.size());
return std::vector<std::shared_ptr<eci::Variable>>();
};
virtual std::shared_ptr<eci::Variable> getVariable(std::shared_ptr<eci::Variable> _this,
const std::string& _name) {
ECI_ERROR("try get unknow Variable : '" << _name << "'");
return nullptr;
};
virtual std::shared_ptr<eci::Variable> create(const std::vector<std::shared_ptr<eci::Variable>>& _objList) {
return nullptr;
}
virtual void destroy(std::shared_ptr<eci::Variable>& _obj) {
if (_obj != nullptr) {
// TODO : mark as destroyed ...
}
}
virtual std::shared_ptr<eci::Variable> clone(const std::shared_ptr<eci::Variable>& _obj) {
return nullptr;
}
virtual std::shared_ptr<eci::Variable> cast(const std::shared_ptr<eci::Variable>& _obj, const eci::Type& _type) {
return nullptr;
}
};
class TypeNatif : public Type {
protected:
// name , opertor * / += / ++ ...
std::map<std::string, std::function<std::shared_ptr<eci::Variable>(const std::shared_ptr<eci::Variable>&)>> m_operatorList;
// name , function to call
std::map<std::string, std::function<std::vector<std::shared_ptr<eci::Variable>>(const std::vector<std::shared_ptr<eci::Variable>>&)>> m_functionList;
//
};
template<typename T> class TypeBase : public Type {
};
template<> class TypeBase<int32_t> {
};
}
#endif

73
eci/Type.hpp Normal file
View File

@ -0,0 +1,73 @@
/**
* @author Edouard DUPIN
* @copyright 2014, Edouard DUPIN, all right reserved
* @license MPL-2 (see license file)
*/
#pragma once
#include <etk/types.hpp>
#include <etk/Map.hpp>
#include <ememory/memory.hpp>
#include <eci/debug.hpp>
namespace eci {
class Variable;
class Type : public ememory::EnableSharedFromThis<eci::Type> {
protected:
etk::String m_signature; // !!! <== specific au language ...
public:
Type() {};
virtual ~Type() {};
virtual ememory::SharedPtr<eci::Variable> callOperator(const ememory::SharedPtr<eci::Variable>& _this,
const etk::String& _operatorName,
const ememory::SharedPtr<eci::Variable>& _obj) {
ECI_ERROR("call unknow operator : '" << _operatorName << "'");
return nullptr;
}
virtual etk::Vector<ememory::SharedPtr<eci::Variable>> callFunction(const ememory::SharedPtr<eci::Variable>& _this,
const etk::String& _name,
const etk::Vector<ememory::SharedPtr<eci::Variable>>& _objList) {
ECI_ERROR("call unknow function : '" << _name << "' with _input.size()=" << _objList.size());
return etk::Vector<ememory::SharedPtr<eci::Variable>>();
};
virtual ememory::SharedPtr<eci::Variable> getVariable(ememory::SharedPtr<eci::Variable> _this,
const etk::String& _name) {
ECI_ERROR("try get unknow Variable : '" << _name << "'");
return nullptr;
};
virtual ememory::SharedPtr<eci::Variable> create(const etk::Vector<ememory::SharedPtr<eci::Variable>>& _objList) {
return nullptr;
}
virtual void destroy(ememory::SharedPtr<eci::Variable>& _obj) {
if (_obj != nullptr) {
// TODO : mark as destroyed ...
}
}
virtual ememory::SharedPtr<eci::Variable> clone(const ememory::SharedPtr<eci::Variable>& _obj) {
return nullptr;
}
virtual ememory::SharedPtr<eci::Variable> cast(const ememory::SharedPtr<eci::Variable>& _obj, const eci::Type& _type) {
return nullptr;
}
};
class TypeNatif : public Type {
protected:
// name , opertor * / += / ++ ...
etk::Map<etk::String, etk::Function<ememory::SharedPtr<eci::Variable>(const ememory::SharedPtr<eci::Variable>&)>> m_operatorList;
// name , function to call
etk::Map<etk::String, etk::Function<etk::Vector<ememory::SharedPtr<eci::Variable>>(const etk::Vector<ememory::SharedPtr<eci::Variable>>&)>> m_functionList;
//
};
template<typename T> class TypeBase : public Type {
};
template<> class TypeBase<int32_t> {
};
}

View File

@ -1,26 +0,0 @@
/**
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license APACHE-2 (see license file)
*/
#ifndef __ECI_VALUE_H__
#define __ECI_VALUE_H__
#include <etk/types.h>
#include <eci/Type.h>
#include <memory>
namespace eci {
class Value : public std::enable_shared_from_this<Value>{
public:
Value() {};
~Value() {};
protected:
};
}
#endif

22
eci/Value.hpp Normal file
View File

@ -0,0 +1,22 @@
/**
* @author Edouard DUPIN
* @copyright 2014, Edouard DUPIN, all right reserved
* @license MPL-2 (see license file)
*/
#pragma once
#include <etk/types.hpp>
#include <eci/Type.hpp>
#include <ememory/memory.hpp>
namespace eci {
class Value : public ememory::EnableSharedFromThis<Value>{
public:
Value() {};
~Value() {};
protected:
};
}

View File

@ -1,13 +1,12 @@
/** /**
* @author Edouard DUPIN * @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved * @copyright 2014, Edouard DUPIN, all right reserved
* * @license MPL-2 (see license file)
* @license APACHE-2 (see license file)
*/ */
#include <eci/Variable.h> #include <etk/types.hpp>
#include <eci/debug.h> #include <eci/Variable.hpp>
#include <eci/debug.hpp>
eci::Variable::Variable() : eci::Variable::Variable() :
m_visibility(eci::visibilityPublic), m_visibility(eci::visibilityPublic),

View File

@ -1,31 +0,0 @@
/**
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license APACHE-2 (see license file)
*/
#ifndef __ECI_VARIABLE_H__
#define __ECI_VARIABLE_H__
#include <etk/types.h>
#include <eci/visibility.h>
#include <eci/Type.h>
#include <memory>
namespace eci {
class Variable : public std::enable_shared_from_this<Variable> {
public:
Variable();
virtual ~Variable();
private:
enum eci::visibility m_visibility;
bool m_const;
std::string m_name;
std::shared_ptr<eci::Type> m_type;
};
}
#endif

26
eci/Variable.hpp Normal file
View File

@ -0,0 +1,26 @@
/**
* @author Edouard DUPIN
* @copyright 2014, Edouard DUPIN, all right reserved
* @license MPL-2 (see license file)
*/
#pragma once
#include <etk/types.hpp>
#include <eci/visibility.hpp>
#include <eci/Type.hpp>
#include <ememory/memory.hpp>
namespace eci {
class Variable : public ememory::EnableSharedFromThis<Variable> {
public:
Variable();
virtual ~Variable();
private:
enum eci::visibility m_visibility;
bool m_const;
etk::String m_name;
ememory::SharedPtr<eci::Type> m_type;
};
}

View File

@ -1,14 +1,12 @@
/** /**
* @author Edouard DUPIN * @author Edouard DUPIN
* * @copyright 2014, Edouard DUPIN, all right reserved
* @copyright 2011, Edouard DUPIN, all right reserved * @license MPL-2 (see license file)
*
* @license APACHE-2 (see license file)
*/ */
#include <eci/debug.h> #include <eci/debug.hpp>
int32_t eci::getLogId() { int32_t eci::getLogId() {
static int32_t g_val = etk::log::registerInstance("eci"); static int32_t g_val = elog::registerInstance("eci");
return g_val; return g_val;
} }

View File

@ -1,21 +1,19 @@
/** /**
* @author Edouard DUPIN * @author Edouard DUPIN
* * @copyright 2014, Edouard DUPIN, all right reserved
* @copyright 2011, Edouard DUPIN, all right reserved * @license MPL-2 (see license file)
*
* @license APACHE-2 (see license file)
*/ */
#ifndef __ECI_DEBUG_H__ #pragma once
#define __ECI_DEBUG_H__
#include <etk/log.h> #include <elog/log.hpp>
namespace eci { namespace eci {
int32_t getLogId(); int32_t getLogId();
}; };
#define ECI_BASE(info,data) TK_LOG_BASE(eci::getLogId(),info,data) #define ECI_BASE(info,data) ELOG_BASE(eci::getLogId(),info,data)
#define ECI_PRINT(data) ECI_BASE(-1, data)
#define ECI_CRITICAL(data) ECI_BASE(1, data) #define ECI_CRITICAL(data) ECI_BASE(1, data)
#define ECI_ERROR(data) ECI_BASE(2, data) #define ECI_ERROR(data) ECI_BASE(2, data)
#define ECI_WARNING(data) ECI_BASE(3, data) #define ECI_WARNING(data) ECI_BASE(3, data)
@ -39,5 +37,4 @@ namespace eci {
} \ } \
} while (0) } while (0)
#endif

View File

@ -1,39 +1,38 @@
/** /**
* @author Edouard DUPIN * @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved * @copyright 2014, Edouard DUPIN, all right reserved
* * @license MPL-2 (see license file)
* @license APACHE-2 (see license file)
*/ */
#include <eci/eci.h> #include <eci/eci.hpp>
#include <eci/debug.h> #include <eci/debug.hpp>
#include <eci/lang/ParserCpp.h> #include <eci/lang/ParserCpp.hpp>
#include <etk/os/FSNode.h> #include <etk/os/FSNode.hpp>
#include <eci/Interpreter.h> #include <eci/Interpreter.hpp>
#include <etk/etk.hpp>
void run_interactive() { void run_interactive() {
ECI_CRITICAL("TODO ... create interactive interface"); ECI_CRITICAL("TODO ... create interactive interface");
} }
bool run_test(const std::string& _filename) { bool run_test(const etk::String& _filename) {
eci::Interpreter::Interpreter virtualMachine; eci::Interpreter virtualMachine;
virtualMachine.addFile(_filename); virtualMachine.addFile(_filename);
virtualMachine.main(); virtualMachine.main();
return false; return false;
} }
void run_test(const std::vector<std::string>& _listFileToTest) { void run_test(const etk::Vector<etk::String>& _listFileToTest) {
int32_t test_num = 1; int32_t test_num = 1;
int32_t count = 0; int32_t count = 0;
int32_t passed = 0; int32_t passed = 0;
for (auto &it : _listFileToTest) { for (auto &it : _listFileToTest) {
enum etk::typeNode type = etk::FSNode(it).getNodeType(); enum etk::typeNode type = etk::FSNode(it).getNodeType();
if (type == etk::FSN_FOLDER) { if (type == etk::typeNode_folder) {
etk::FSNode node(it); etk::FSNode node(it);
std::vector<std::string> list; etk::Vector<etk::String> list;
node.folderGetRecursiveFiles(list, false); node.folderGetRecursiveFiles(list, false);
for (auto &it2 : list) { for (auto &it2 : list) {
if (run_test(it2)) { if (run_test(it2)) {
@ -42,7 +41,7 @@ void run_test(const std::vector<std::string>& _listFileToTest) {
count++; count++;
test_num++; test_num++;
} }
} else if (type == etk::FSN_FILE) { } else if (type == etk::typeNode_file) {
if (run_test(it)) { if (run_test(it)) {
passed++; passed++;
} }
@ -54,47 +53,24 @@ void run_test(const std::vector<std::string>& _listFileToTest) {
} }
int main(int argc, char** argv) { int main(int _argc, const char** _argv) {
etk::init(_argc, _argv);
// the only one init for etk: // the only one init for etk:
std::vector<std::string> listFileToTest; etk::Vector<etk::String> listFileToTest;
for (int32_t iii=1; iii<argc ; ++iii) { for (int32_t iii=1; iii<_argc ; ++iii) {
std::string data = argv[iii]; etk::String data = _argv[iii];
if (data == "-l0") { if ( data == "-h"
etk::log::setLevel(etk::log::logLevelNone); || data == "--help") {
} else if (data == "-l1") { ECI_PRINT("Help : ");
etk::log::setLevel(etk::log::logLevelCritical); ECI_PRINT(" ./xxx [options]");
} else if (data == "-l2") { ECI_PRINT(" No option for now");
etk::log::setLevel(etk::log::logLevelError);
} else if (data == "-l3") {
etk::log::setLevel(etk::log::logLevelWarning);
} else if (data == "-l4") {
etk::log::setLevel(etk::log::logLevelInfo);
} else if (data == "-l5") {
etk::log::setLevel(etk::log::logLevelDebug);
} else if (data == "-l6") {
etk::log::setLevel(etk::log::logLevelVerbose);
} else if ( data == "-h"
|| data == "--help") {
etk::log::setLevel(etk::log::logLevelVerbose);
ECI_INFO("Help : ");
ECI_INFO(" ./xxx [options]");
ECI_INFO(" -l0: debug None");
ECI_INFO(" -l1: debug Critical");
ECI_INFO(" -l2: debug Error");
ECI_INFO(" -l3: debug Warning");
ECI_INFO(" -l4: debug Info");
ECI_INFO(" -l5: debug Debug");
ECI_INFO(" -l6: debug Verbose");
ECI_INFO(" -h/--help: this help");
exit(0); exit(0);
} else { } else if ( data.startWith("--elog-") == false
listFileToTest.push_back(data); && data.startWith("--etk-") == false) {
listFileToTest.pushBack(data);
} }
} }
etk::setArgZero(argv[0]); ECI_INFO("input elements: " << listFileToTest);
etk::initDefaultFolder("exml_test");
ECI_INFO("input elements : " << listFileToTest);
// Cocal parse : // Cocal parse :
if (listFileToTest.size() == 0) { if (listFileToTest.size() == 0) {
run_interactive(); run_interactive();

View File

@ -1,12 +0,0 @@
/**
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license APACHE-2 (see license file)
*/
#ifndef __ECI_H__
#define __ECI_H__
#endif

10
eci/eci.hpp Normal file
View File

@ -0,0 +1,10 @@
/**
* @author Edouard DUPIN
* @copyright 2014, Edouard DUPIN, all right reserved
* @license MPL-2 (see license file)
*/
#pragma once
#include <etk/types.hpp>

View File

@ -1,13 +1,11 @@
/** /**
* @author Edouard DUPIN * @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved * @copyright 2014, Edouard DUPIN, all right reserved
* * @license MPL-2 (see license file)
* @license APACHE-2 (see license file)
*/ */
#include <eci/lang/ParserCpp.h> #include <eci/lang/ParserCpp.hpp>
#include <eci/debug.h> #include <eci/debug.hpp>
eci::ParserCpp::ParserCpp() { eci::ParserCpp::ParserCpp() {
@ -57,25 +55,25 @@ eci::ParserCpp::~ParserCpp() {
} }
static void printNode(const std::string& _data, const std::vector<std::shared_ptr<eci::LexerNode>>& _nodes, int32_t _level=0) { static void printNode(const etk::String& _data, const etk::Vector<ememory::SharedPtr<eci::LexerNode>>& _nodes, int32_t _level=0) {
std::string offset; etk::String offset;
for (int32_t iii=0; iii<_level; ++iii) { for (int32_t iii=0; iii<_level; ++iii) {
offset += " "; offset += " ";
} }
for (auto &it : _nodes) { for (auto &it : _nodes) {
if (it->isNodeContainer() == true) { if (it->isNodeContainer() == true) {
std::shared_ptr<eci::LexerNodeContainer> sec = std::dynamic_pointer_cast<eci::LexerNodeContainer>(it); ememory::SharedPtr<eci::LexerNodeContainer> sec = ememory::dynamicPointerCast<eci::LexerNodeContainer>(it);
if (sec != nullptr) { if (sec != nullptr) {
ECI_INFO(offset << " " << sec->getStartPos() << "->" << sec->getStopPos() << " container: " << sec->getType()); ECI_INFO(offset << " " << sec->getStartPos() << "->" << sec->getStopPos() << " container: " << sec->getType());
printNode(_data, sec->m_list, _level+1); printNode(_data, sec->m_list, _level+1);
} }
} else { } else {
ECI_INFO(offset << it->getStartPos() << "->" << it->getStopPos() << " data='" <<std::string(_data, it->getStartPos(), it->getStopPos()-it->getStartPos()) << "'" ); ECI_INFO(offset << it->getStartPos() << "->" << it->getStopPos() << " data='" <<etk::String(_data, it->getStartPos(), it->getStopPos()-it->getStartPos()) << "'" );
} }
} }
} }
bool eci::ParserCpp::parse(const std::string& _data) { bool eci::ParserCpp::parse(const etk::String& _data) {
m_result = m_lexer.interprete(_data); m_result = m_lexer.interprete(_data);
// TODO: Agregate type // TODO: Agregate type
@ -86,7 +84,7 @@ bool eci::ParserCpp::parse(const std::string& _data) {
printNode(_data, m_result.m_list); printNode(_data, m_result.m_list);
/* /*
for (auto &it : m_result.m_list) { for (auto &it : m_result.m_list) {
ECI_INFO(" start=" << it->getStartPos() << " stop=" << it->getStopPos() << " data='" <<std::string(_data, it->getStartPos(), it->getStopPos()-it->getStartPos()) << "'" ); ECI_INFO(" start=" << it->getStartPos() << " stop=" << it->getStopPos() << " data='" <<etk::String(_data, it->getStartPos(), it->getStopPos()-it->getStartPos()) << "'" );
} }
*/ */
return false; return false;

View File

@ -1,16 +1,14 @@
/** /**
* @author Edouard DUPIN * @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved * @copyright 2014, Edouard DUPIN, all right reserved
* * @license MPL-2 (see license file)
* @license APACHE-2 (see license file)
*/ */
#ifndef __ECI_PARSER_CPP_H__ #pragma once
#define __ECI_PARSER_CPP_H__
#include <eci/Lexer.h> #include <etk/types.hpp>
#include <eci/Interpreter.h> #include <eci/Lexer.hpp>
#include <eci/Interpreter.hpp>
namespace eci { namespace eci {
@ -64,8 +62,6 @@ namespace eci {
public: public:
ParserCpp(); ParserCpp();
~ParserCpp(); ~ParserCpp();
bool parse(const std::string& _data); bool parse(const etk::String& _data);
}; };
} }
#endif

View File

@ -1,13 +1,11 @@
/** /**
* @author Edouard DUPIN * @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved * @copyright 2014, Edouard DUPIN, all right reserved
* * @license MPL-2 (see license file)
* @license APACHE-2 (see license file)
*/ */
#include <eci/lang/ParserJS.h> #include <eci/lang/ParserJS.hpp>
#include <eci/debug.h> #include <eci/debug.hpp>
eci::ParserJS::ParserJS() { eci::ParserJS::ParserJS() {
@ -39,25 +37,25 @@ eci::ParserJS::~ParserJS() {
} }
static void printNode(const std::string& _data, const std::vector<std::shared_ptr<eci::LexerNode>>& _nodes, int32_t _level=0) { static void printNode(const etk::String& _data, const etk::Vector<ememory::SharedPtr<eci::LexerNode>>& _nodes, int32_t _level=0) {
std::string offset; etk::String offset;
for (int32_t iii=0; iii<_level; ++iii) { for (int32_t iii=0; iii<_level; ++iii) {
offset += " "; offset += " ";
} }
for (auto &it : _nodes) { for (auto &it : _nodes) {
if (it->isNodeContainer() == true) { if (it->isNodeContainer() == true) {
std::shared_ptr<eci::LexerNodeContainer> sec = std::dynamic_pointer_cast<eci::LexerNodeContainer>(it); ememory::SharedPtr<eci::LexerNodeContainer> sec = ememory::dynamicPointerCast<eci::LexerNodeContainer>(it);
if (sec != nullptr) { if (sec != nullptr) {
ECI_INFO(offset << " " << sec->getStartPos() << "->" << sec->getStopPos() << " container: " << sec->getType()); ECI_INFO(offset << " " << sec->getStartPos() << "->" << sec->getStopPos() << " container: " << sec->getType());
printNode(_data, sec->m_list, _level+1); printNode(_data, sec->m_list, _level+1);
} }
} else { } else {
ECI_INFO(offset << it->getStartPos() << "->" << it->getStopPos() << " data='" <<std::string(_data, it->getStartPos(), it->getStopPos()-it->getStartPos()) << "'" ); ECI_INFO(offset << it->getStartPos() << "->" << it->getStopPos() << " data='" <<etk::String(_data, it->getStartPos(), it->getStopPos()-it->getStartPos()) << "'" );
} }
} }
} }
bool eci::ParserJS::parse(const std::string& _data) { bool eci::ParserJS::parse(const etk::String& _data) {
m_result = m_lexer.interprete(_data); m_result = m_lexer.interprete(_data);
// TODO: Agregate type // TODO: Agregate type
@ -68,7 +66,7 @@ bool eci::ParserJS::parse(const std::string& _data) {
printNode(_data, m_result.m_list); printNode(_data, m_result.m_list);
/* /*
for (auto &it : m_result.m_list) { for (auto &it : m_result.m_list) {
ECI_INFO(" start=" << it->getStartPos() << " stop=" << it->getStopPos() << " data='" <<std::string(_data, it->getStartPos(), it->getStopPos()-it->getStartPos()) << "'" ); ECI_INFO(" start=" << it->getStartPos() << " stop=" << it->getStopPos() << " data='" <<etk::String(_data, it->getStartPos(), it->getStopPos()-it->getStartPos()) << "'" );
} }
*/ */
return false; return false;

View File

@ -1,16 +1,14 @@
/** /**
* @author Edouard DUPIN * @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved * @copyright 2014, Edouard DUPIN, all right reserved
* * @license MPL-2 (see license file)
* @license APACHE-2 (see license file)
*/ */
#ifndef __ECI_PARSER_JS_H__ #pragma once
#define __ECI_PARSER_JS_H__
#include <eci/Lexer.h> #include <etk/types.hpp>
#include <eci/Interpreter.h> #include <eci/Lexer.hpp>
#include <eci/Interpreter.hpp>
namespace eci { namespace eci {
@ -47,8 +45,6 @@ namespace eci {
public: public:
ParserJS(); ParserJS();
~ParserJS(); ~ParserJS();
bool parse(const std::string& _data); bool parse(const etk::String& _data);
}; };
} }
#endif

View File

@ -1,15 +1,12 @@
/** /**
* @author Edouard DUPIN * @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved * @copyright 2014, Edouard DUPIN, all right reserved
* * @license MPL-2 (see license file)
* @license APACHE-2 (see license file)
*/ */
#ifndef __ECI_VISIBILITY_H__ #pragma once
#define __ECI_VISIBILITY_H__
#include <etk/types.h> #include <etk/types.hpp>
namespace eci { namespace eci {
enum visibility { enum visibility {
@ -20,4 +17,3 @@ namespace eci {
}; };
} }
#endif

View File

@ -4,19 +4,28 @@ import lutin.tools as tools
import os import os
def get_type(): def get_type():
return "LIBRARY" return "BINARY"
def get_name():
return "ECI"
def get_desc(): def get_desc():
return "Ewol C Interpreter" return "Ewol C Interpreter"
def get_licence(): def get_licence():
return "APACHE-2" return "MPL-2"
def get_compagny_type(): def get_compagny_type():
return "com" return "org"
def get_compagny_name(): def get_compagny_name():
return "atria-soft" return "Edouard DUPIN"
def get_maintainer():
return ["Mr DUPIN Edouard <yui.heero@gmail.com>"]
def get_version():
return [0,1,"dev"]
def configure(target, my_module): def configure(target, my_module):
my_module.add_extra_flags() my_module.add_extra_flags()