mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-29 00:34:24 +02:00
[UPDATE] Build-in FunctionList in progress.
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1025 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
0180d012cb
commit
49128550d4
@ -32,11 +32,6 @@
|
||||
|
||||
void FunctionListPanel::addEntry(const TCHAR *nodeName, const TCHAR *displayText, size_t pos)
|
||||
{
|
||||
/*
|
||||
int index = ::SendDlgItemMessage(_hSelf, IDC_LIST_FUNCLIST, LB_GETCOUNT, 0, 0);
|
||||
::SendDlgItemMessage(_hSelf, IDC_LIST_FUNCLIST, LB_INSERTSTRING, index, (LPARAM)displayText);
|
||||
::SendDlgItemMessage(_hSelf, IDC_LIST_FUNCLIST, LB_SETITEMDATA, index, (LPARAM)pos);
|
||||
*/
|
||||
HTREEITEM itemParent = NULL;
|
||||
TCHAR posStr[32];
|
||||
generic_itoa(pos, posStr, 10);
|
||||
@ -58,10 +53,6 @@ void FunctionListPanel::addEntry(const TCHAR *nodeName, const TCHAR *displayText
|
||||
|
||||
void FunctionListPanel::removeAllEntries()
|
||||
{
|
||||
/*
|
||||
while (::SendDlgItemMessage(_hSelf, IDC_LIST_FUNCLIST, LB_GETCOUNT, 0, 0))
|
||||
::SendDlgItemMessage(_hSelf, IDC_LIST_FUNCLIST, LB_DELETESTRING, 0, 0);
|
||||
*/
|
||||
_treeView.removeAllItems();
|
||||
}
|
||||
|
||||
@ -118,118 +109,6 @@ size_t FunctionListPanel::getBodyClosePos(size_t begin, const TCHAR *bodyOpenSym
|
||||
return targetEnd;
|
||||
}
|
||||
|
||||
// This method will
|
||||
void FunctionListPanel::parse2(std::vector<foundInfo> & foundInfos, size_t begin, size_t end, const TCHAR *block, std::vector< generic_string > blockNameToSearch, const TCHAR *bodyOpenSymbol, const TCHAR *bodyCloseSymbol, const TCHAR *function, std::vector< generic_string > functionToSearch)
|
||||
{
|
||||
if (begin >= end)
|
||||
return;
|
||||
|
||||
int flags = SCFIND_REGEXP | SCFIND_POSIX;
|
||||
|
||||
(*_ppEditView)->execute(SCI_SETSEARCHFLAGS, flags);
|
||||
int targetStart = (*_ppEditView)->searchInTarget(block, lstrlen(block), begin, end);
|
||||
int targetEnd = 0;
|
||||
|
||||
//foundInfos.clear();
|
||||
while (targetStart != -1 && targetStart != -2)
|
||||
{
|
||||
targetEnd = int((*_ppEditView)->execute(SCI_GETTARGETEND));
|
||||
|
||||
// Get class name
|
||||
int foundPos = 0;
|
||||
generic_string classStructName = parseSubLevel(targetStart, targetEnd, blockNameToSearch, foundPos);
|
||||
|
||||
|
||||
if (lstrcmp(bodyOpenSymbol, TEXT("")) != 0 && lstrcmp(bodyCloseSymbol, TEXT("")) != 0)
|
||||
{
|
||||
targetEnd = getBodyClosePos(targetEnd, bodyOpenSymbol, bodyCloseSymbol);
|
||||
}
|
||||
|
||||
if (targetEnd > int(end)) //we found a result but outside our range, therefore do not process it
|
||||
{
|
||||
break;
|
||||
}
|
||||
int foundTextLen = targetEnd - targetStart;
|
||||
if (targetStart + foundTextLen == int(end))
|
||||
break;
|
||||
|
||||
// Begin to search all method inside
|
||||
vector< generic_string > emptyArray;
|
||||
parse(foundInfos, targetStart, targetEnd, function, functionToSearch, emptyArray, classStructName);
|
||||
|
||||
begin = targetStart + (targetEnd - targetStart);
|
||||
targetStart = (*_ppEditView)->searchInTarget(block, lstrlen(block), begin, end);
|
||||
}
|
||||
}
|
||||
|
||||
void FunctionListPanel::parse(vector<foundInfo> & foundInfos, size_t begin, size_t end, const TCHAR *regExpr2search, vector< generic_string > dataToSearch, vector< generic_string > data2ToSearch, generic_string classStructName)
|
||||
{
|
||||
if (begin >= end)
|
||||
return;
|
||||
|
||||
int flags = SCFIND_REGEXP | SCFIND_POSIX;
|
||||
|
||||
(*_ppEditView)->execute(SCI_SETSEARCHFLAGS, flags);
|
||||
int targetStart = (*_ppEditView)->searchInTarget(regExpr2search, lstrlen(regExpr2search), begin, end);
|
||||
int targetEnd = 0;
|
||||
|
||||
//foundInfos.clear();
|
||||
while (targetStart != -1 && targetStart != -2)
|
||||
{
|
||||
targetStart = int((*_ppEditView)->execute(SCI_GETTARGETSTART));
|
||||
targetEnd = int((*_ppEditView)->execute(SCI_GETTARGETEND));
|
||||
if (targetEnd > int(end)) //we found a result but outside our range, therefore do not process it
|
||||
{
|
||||
break;
|
||||
}
|
||||
int foundTextLen = targetEnd - targetStart;
|
||||
if (targetStart + foundTextLen == int(end))
|
||||
break;
|
||||
|
||||
foundInfo fi;
|
||||
|
||||
// dataToSearch & data2ToSearch are optional
|
||||
if (!dataToSearch.size() && !data2ToSearch.size())
|
||||
{
|
||||
TCHAR foundData[1024];
|
||||
(*_ppEditView)->getGenericText(foundData, 1024, targetStart, targetEnd);
|
||||
|
||||
fi._data = foundData; // whole found data
|
||||
fi._pos = targetStart;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
int foundPos;
|
||||
if (dataToSearch.size())
|
||||
{
|
||||
fi._data = parseSubLevel(targetStart, targetEnd, dataToSearch, foundPos);
|
||||
fi._pos = foundPos;
|
||||
}
|
||||
|
||||
if (data2ToSearch.size())
|
||||
{
|
||||
fi._data2 = parseSubLevel(targetStart, targetEnd, data2ToSearch, foundPos);
|
||||
fi._pos2 = foundPos;
|
||||
}
|
||||
else if (classStructName != TEXT(""))
|
||||
{
|
||||
fi._data2 = classStructName;
|
||||
fi._pos2 = 0; // change -1 valeur for validated data2
|
||||
}
|
||||
}
|
||||
|
||||
if (fi._pos != -1 || fi._pos2 != -1) // at least one should be found
|
||||
{
|
||||
foundInfos.push_back(fi);
|
||||
}
|
||||
|
||||
begin = targetStart + foundTextLen;
|
||||
targetStart = (*_ppEditView)->searchInTarget(regExpr2search, lstrlen(regExpr2search), begin, end);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
generic_string FunctionListPanel::parseSubLevel(size_t begin, size_t end, std::vector< generic_string > dataToSearch, int & foundPos)
|
||||
{
|
||||
if (begin >= end)
|
||||
|
@ -88,14 +88,10 @@ public:
|
||||
void removeEntry();
|
||||
void modifyEntry();
|
||||
void update();
|
||||
|
||||
void parse(std::vector<foundInfo> & foundInfos, size_t begin, size_t end, const TCHAR *regExpr2search, std::vector< generic_string > dataToSearch, std::vector< generic_string > data2ToSearch, generic_string classStructName = TEXT(""));
|
||||
/*
|
||||
void parse(size_t begin, size_t end, const TCHAR *wordToExclude, const TCHAR *regExpr2search, ...);
|
||||
bool parseSubLevel(size_t begin, size_t end, const TCHAR *wordToExclude, const TCHAR *regExpr2search, ...);
|
||||
*/
|
||||
void parse(std::vector<foundInfo> & foundInfos, size_t begin, size_t end, const TCHAR *regExpr2search, std::vector< generic_string > dataToSearch, std::vector< generic_string > data2ToSearch, generic_string classStructName = TEXT(""));
|
||||
void parse2(std::vector<foundInfo> & foundInfos, size_t begin, size_t end, const TCHAR *block, std::vector< generic_string > blockNameToSearch, const TCHAR *bodyOpenSymbol, const TCHAR *bodyCloseSymbol, const TCHAR *function, std::vector< generic_string > functionToSearch);
|
||||
|
||||
*/
|
||||
protected:
|
||||
virtual BOOL CALLBACK FunctionListPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "precompiledHeaders.h"
|
||||
#include "ScintillaEditView.h"
|
||||
#include "functionParser.h"
|
||||
#include "boostregexsearch.h"
|
||||
|
||||
bool FunctionParsersManager::init(generic_string xmlPath, ScintillaEditView ** ppEditView)
|
||||
{
|
||||
@ -82,6 +83,8 @@ bool FunctionParsersManager::getFuncListFromXmlTree()
|
||||
if (!displayName || !displayName[0])
|
||||
displayName = id;
|
||||
|
||||
const TCHAR *commentExpr = NULL;
|
||||
|
||||
TiXmlNode *classRangeParser = childNode->FirstChild(TEXT("classRange"));
|
||||
if (classRangeParser)
|
||||
{
|
||||
@ -95,6 +98,12 @@ bool FunctionParsersManager::getFuncListFromXmlTree()
|
||||
|
||||
openSymbole = (classRangeParser->ToElement())->Attribute(TEXT("openSymbole"));
|
||||
closeSymbole = (classRangeParser->ToElement())->Attribute(TEXT("closeSymbole"));
|
||||
TiXmlNode *commentSymbols = classRangeParser->FirstChild(TEXT("comment"));
|
||||
if (commentSymbols)
|
||||
{
|
||||
commentExpr = (commentSymbols->ToElement())->Attribute(TEXT("expr"));
|
||||
}
|
||||
|
||||
TiXmlNode *classNameParser = classRangeParser->FirstChild(TEXT("className"));
|
||||
if (classNameParser)
|
||||
{
|
||||
@ -130,7 +139,7 @@ bool FunctionParsersManager::getFuncListFromXmlTree()
|
||||
|
||||
}
|
||||
|
||||
_parsers.push_back(new FunctionZoneParser(id, displayName, mainExpr, openSymbole, closeSymbole, classNameExprArray, functionExpr, functionNameExprArray));
|
||||
_parsers.push_back(new FunctionZoneParser(id, displayName, commentExpr, mainExpr, openSymbole, closeSymbole, classNameExprArray, functionExpr, functionNameExprArray));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -144,6 +153,12 @@ bool FunctionParsersManager::getFuncListFromXmlTree()
|
||||
if (!mainExpr)
|
||||
continue;
|
||||
|
||||
TiXmlNode *commentSymbols = functionParser->FirstChild(TEXT("comment"));
|
||||
if (commentSymbols)
|
||||
{
|
||||
commentExpr = (commentSymbols->ToElement())->Attribute(TEXT("expr"));
|
||||
}
|
||||
|
||||
TiXmlNode *functionNameParser = functionParser->FirstChild(TEXT("functionName"));
|
||||
if (functionNameParser)
|
||||
{
|
||||
@ -169,7 +184,7 @@ bool FunctionParsersManager::getFuncListFromXmlTree()
|
||||
classNameExprArray.push_back(expr);
|
||||
}
|
||||
}
|
||||
_parsers.push_back(new FunctionUnitParser(id, displayName, mainExpr, functionNameExprArray, classNameExprArray));
|
||||
_parsers.push_back(new FunctionUnitParser(id, displayName, commentExpr, mainExpr, functionNameExprArray, classNameExprArray));
|
||||
}
|
||||
}
|
||||
|
||||
@ -214,7 +229,7 @@ void FunctionParser::funcParse(std::vector<foundInfo> & foundInfos, size_t begi
|
||||
if (begin >= end)
|
||||
return;
|
||||
|
||||
int flags = SCFIND_REGEXP | SCFIND_POSIX;
|
||||
int flags = SCFIND_REGEXP | SCFIND_POSIX | SCFIND_REGEXP_DOTMATCHESNL;
|
||||
|
||||
(*ppEditView)->execute(SCI_SETSEARCHFLAGS, flags);
|
||||
int targetStart = (*ppEditView)->searchInTarget(_functionExpr.c_str(), _functionExpr.length(), begin, end);
|
||||
@ -287,7 +302,7 @@ generic_string FunctionParser::parseSubLevel(size_t begin, size_t end, std::vect
|
||||
if (!dataToSearch.size())
|
||||
return TEXT("");
|
||||
|
||||
int flags = SCFIND_REGEXP | SCFIND_POSIX;
|
||||
int flags = SCFIND_REGEXP | SCFIND_POSIX | SCFIND_REGEXP_DOTMATCHESNL;
|
||||
|
||||
(*ppEditView)->execute(SCI_SETSEARCHFLAGS, flags);
|
||||
const TCHAR *regExpr2search = dataToSearch[0].c_str();
|
||||
@ -350,7 +365,7 @@ size_t FunctionZoneParser::getBodyClosePos(size_t begin, const TCHAR *bodyOpenSy
|
||||
exprToSearch += TEXT(")");
|
||||
|
||||
|
||||
int flags = SCFIND_REGEXP | SCFIND_POSIX;
|
||||
int flags = SCFIND_REGEXP | SCFIND_POSIX | SCFIND_REGEXP_DOTMATCHESNL;
|
||||
|
||||
(*ppEditView)->execute(SCI_SETSEARCHFLAGS, flags);
|
||||
int targetStart = (*ppEditView)->searchInTarget(exprToSearch.c_str(), exprToSearch.length(), begin, docLen);
|
||||
@ -386,21 +401,21 @@ size_t FunctionZoneParser::getBodyClosePos(size_t begin, const TCHAR *bodyOpenSy
|
||||
return targetEnd;
|
||||
}
|
||||
|
||||
void FunctionZoneParser::classParse(std::vector<foundInfo> & foundInfos, size_t begin, size_t end, ScintillaEditView **ppEditView, generic_string classStructName)
|
||||
void FunctionZoneParser::classParse(vector<foundInfo> & foundInfos, vector< pair<int, int> > &scannedZone, size_t begin, size_t end, ScintillaEditView **ppEditView, generic_string classStructName)
|
||||
{
|
||||
if (begin >= end)
|
||||
return;
|
||||
|
||||
int flags = SCFIND_REGEXP | SCFIND_POSIX;
|
||||
int flags = SCFIND_REGEXP | SCFIND_POSIX | SCFIND_REGEXP_DOTMATCHESNL;
|
||||
|
||||
(*ppEditView)->execute(SCI_SETSEARCHFLAGS, flags);
|
||||
int targetStart = (*ppEditView)->searchInTarget(_rangeExpr.c_str(), _rangeExpr.length(), begin, end);
|
||||
int targetEnd = 0;
|
||||
|
||||
//foundInfos.clear();
|
||||
while (targetStart != -1 && targetStart != -2)
|
||||
{
|
||||
targetEnd = int((*ppEditView)->execute(SCI_GETTARGETEND));
|
||||
scannedZone.push_back(pair<int, int>(targetStart, targetEnd));
|
||||
|
||||
// Get class name
|
||||
int foundPos = 0;
|
||||
@ -429,12 +444,80 @@ void FunctionZoneParser::classParse(std::vector<foundInfo> & foundInfos, size_t
|
||||
}
|
||||
}
|
||||
|
||||
void FunctionParser::getCommentZones(vector< pair<int, int> > & commentZone, size_t begin, size_t end, ScintillaEditView **ppEditView)
|
||||
{
|
||||
if ((begin >= end) || (_commentExpr == TEXT("")))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int flags = SCFIND_REGEXP | SCFIND_POSIX | SCFIND_REGEXP_DOTMATCHESNL;
|
||||
|
||||
(*ppEditView)->execute(SCI_SETSEARCHFLAGS, flags);
|
||||
int targetStart = (*ppEditView)->searchInTarget(_commentExpr.c_str(), _commentExpr.length(), begin, end);
|
||||
int targetEnd = 0;
|
||||
|
||||
while (targetStart != -1 && targetStart != -2)
|
||||
{
|
||||
targetStart = int((*ppEditView)->execute(SCI_GETTARGETSTART));
|
||||
targetEnd = int((*ppEditView)->execute(SCI_GETTARGETEND));
|
||||
if (targetEnd > int(end)) //we found a result but outside our range, therefore do not process it
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
commentZone.push_back(pair<int, int>(targetStart, targetEnd));
|
||||
|
||||
int foundTextLen = targetEnd - targetStart;
|
||||
if (targetStart + foundTextLen == int(end))
|
||||
break;
|
||||
|
||||
begin = targetStart + foundTextLen;
|
||||
targetStart = (*ppEditView)->searchInTarget(_commentExpr.c_str(), _commentExpr.length(), begin, end);
|
||||
}
|
||||
}
|
||||
|
||||
void FunctionParser::getInvertZones(vector< pair<int, int> > & destZones, vector< pair<int, int> > & sourceZones, size_t begin, size_t end)
|
||||
{
|
||||
if (sourceZones.size() == 0)
|
||||
{
|
||||
destZones.push_back(pair<int, int>(begin, end));
|
||||
}
|
||||
else
|
||||
{
|
||||
// todo : check the begin
|
||||
size_t i = 0;
|
||||
for (; i < sourceZones.size() - 1; i++)
|
||||
{
|
||||
int newBegin = sourceZones[i].second + 1;
|
||||
int newEnd = sourceZones[i+1].first - 1;
|
||||
if (newBegin < newEnd)
|
||||
destZones.push_back(pair<int, int>(newBegin, newEnd));
|
||||
}
|
||||
int lastBegin = sourceZones[i].second + 1;
|
||||
if (lastBegin < int(end))
|
||||
destZones.push_back(pair<int, int>(lastBegin, end));
|
||||
}
|
||||
}
|
||||
|
||||
void FunctionZoneParser::parse(std::vector<foundInfo> & foundInfos, size_t begin, size_t end, ScintillaEditView **ppEditView, generic_string classStructName)
|
||||
{
|
||||
classParse(foundInfos, begin, end, ppEditView, classStructName);
|
||||
vector< pair<int, int> > commentZones, nonCommentZones;
|
||||
getCommentZones(commentZones, begin, end, ppEditView);
|
||||
getInvertZones(nonCommentZones, commentZones, begin, end);
|
||||
for (size_t i = 0; i < nonCommentZones.size(); i++)
|
||||
{
|
||||
classParse(foundInfos, commentZones, nonCommentZones[i].first, nonCommentZones[i].second, ppEditView, classStructName);
|
||||
}
|
||||
}
|
||||
|
||||
void FunctionUnitParser::parse(std::vector<foundInfo> & foundInfos, size_t begin, size_t end, ScintillaEditView **ppEditView, generic_string classStructName)
|
||||
{
|
||||
funcParse(foundInfos, begin, end, ppEditView, classStructName);
|
||||
vector< pair<int, int> > commentZones, nonCommentZones;
|
||||
getCommentZones(commentZones, begin, end, ppEditView);
|
||||
getInvertZones(nonCommentZones, commentZones, begin, end);
|
||||
for (size_t i = 0; i < nonCommentZones.size(); i++)
|
||||
{
|
||||
funcParse(foundInfos, nonCommentZones[i].first, nonCommentZones[i].second, ppEditView, classStructName);
|
||||
}
|
||||
}
|
@ -42,26 +42,29 @@ struct foundInfo {
|
||||
class FunctionParser {
|
||||
friend class FunctionParsersManager;
|
||||
public:
|
||||
FunctionParser(const TCHAR *id, const TCHAR *displayName, generic_string functionExpr, std::vector<generic_string> functionNameExprArray, std::vector<generic_string> classNameExprArray):
|
||||
_id(id), _displayName(displayName), _functionExpr(functionExpr), _functionNameExprArray(functionNameExprArray), _classNameExprArray(classNameExprArray){};
|
||||
FunctionParser(const TCHAR *id, const TCHAR *displayName, const TCHAR *commentExpr, generic_string functionExpr, std::vector<generic_string> functionNameExprArray, std::vector<generic_string> classNameExprArray):
|
||||
_id(id), _displayName(displayName), _commentExpr(commentExpr?commentExpr:TEXT("")), _functionExpr(functionExpr), _functionNameExprArray(functionNameExprArray), _classNameExprArray(classNameExprArray){};
|
||||
|
||||
virtual void parse(std::vector<foundInfo> & foundInfos, size_t begin, size_t end, ScintillaEditView **ppEditView, generic_string classStructName = TEXT("")) = 0;
|
||||
void funcParse(std::vector<foundInfo> & foundInfos, size_t begin, size_t end, ScintillaEditView **ppEditView, generic_string classStructName = TEXT(""));
|
||||
protected:
|
||||
generic_string _id;
|
||||
generic_string _displayName;
|
||||
generic_string _commentExpr;
|
||||
generic_string _functionExpr;
|
||||
std::vector<generic_string> _functionNameExprArray;
|
||||
std::vector<generic_string> _classNameExprArray;
|
||||
void getCommentZones(std::vector< std::pair<int, int> > & commentZone, size_t begin, size_t end, ScintillaEditView **ppEditView);
|
||||
void getInvertZones(std::vector< std::pair<int, int> > & destZones, std::vector< std::pair<int, int> > & sourceZones, size_t begin, size_t end);
|
||||
generic_string parseSubLevel(size_t begin, size_t end, std::vector< generic_string > dataToSearch, int & foundPos, ScintillaEditView **ppEditView);
|
||||
};
|
||||
|
||||
|
||||
class FunctionZoneParser : public FunctionParser {
|
||||
public:
|
||||
FunctionZoneParser(const TCHAR *id, const TCHAR *displayName, generic_string rangeExpr, generic_string openSymbole, generic_string closeSymbole,
|
||||
FunctionZoneParser(const TCHAR *id, const TCHAR *displayName, const TCHAR *commentExpr, generic_string rangeExpr, generic_string openSymbole, generic_string closeSymbole,
|
||||
std::vector<generic_string> classNameExprArray, generic_string functionExpr, std::vector<generic_string> functionNameExprArray):
|
||||
FunctionParser(id, displayName, functionExpr, functionNameExprArray, classNameExprArray), _rangeExpr(rangeExpr), _openSymbole(openSymbole), _closeSymbole(closeSymbole) {};
|
||||
FunctionParser(id, displayName, commentExpr, functionExpr, functionNameExprArray, classNameExprArray), _rangeExpr(rangeExpr), _openSymbole(openSymbole), _closeSymbole(closeSymbole) {};
|
||||
|
||||
void parse(std::vector<foundInfo> & foundInfos, size_t begin, size_t end, ScintillaEditView **ppEditView, generic_string classStructName = TEXT(""));
|
||||
|
||||
@ -74,15 +77,15 @@ private:
|
||||
generic_string _functionExpr;
|
||||
//std::vector<generic_string> _functionNameExprArray;
|
||||
|
||||
void classParse(std::vector<foundInfo> & foundInfos, size_t begin, size_t end, ScintillaEditView **ppEditView, generic_string classStructName = TEXT(""));
|
||||
void classParse(std::vector<foundInfo> & foundInfos, std::vector< std::pair<int, int> > & scannedZone, size_t begin, size_t end, ScintillaEditView **ppEditView, generic_string classStructName = TEXT(""));
|
||||
size_t getBodyClosePos(size_t begin, const TCHAR *bodyOpenSymbol, const TCHAR *bodyCloseSymbol, ScintillaEditView **ppEditView);
|
||||
};
|
||||
|
||||
class FunctionUnitParser : public FunctionParser {
|
||||
public:
|
||||
FunctionUnitParser(const TCHAR *id, const TCHAR *displayName,
|
||||
FunctionUnitParser(const TCHAR *id, const TCHAR *displayName, const TCHAR *commentExpr,
|
||||
generic_string mainExpr, std::vector<generic_string> functionNameExprArray,
|
||||
std::vector<generic_string> classNameExprArray): FunctionParser(id, displayName, mainExpr, functionNameExprArray, classNameExprArray){};
|
||||
std::vector<generic_string> classNameExprArray): FunctionParser(id, displayName, commentExpr, mainExpr, functionNameExprArray, classNameExprArray){};
|
||||
|
||||
void parse(std::vector<foundInfo> & foundInfos, size_t begin, size_t end, ScintillaEditView **ppEditView, generic_string classStructName = TEXT(""));
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
openSymbole = "\{"
|
||||
closeSymbole = "\}"
|
||||
displayMode="node">
|
||||
<comment expr="((/\*.*?\*)/|(//.*?$))" />
|
||||
<className>
|
||||
<nameExpr expr="(class|struct)[\t ]+[\w]+"/>
|
||||
<nameExpr expr="[\t ]+[\w]+"/>
|
||||
@ -33,7 +34,24 @@
|
||||
</parser>
|
||||
<parser id="c_cpp_function" displayName="C++/C source">
|
||||
<function
|
||||
mainExpr="^[\t ]*((static|const)[\s]+)?[\w]+([\s]+|\*[\s]+|[\s]+\*|[\s]+\*[\s]+)([\w_]+[\s]*::)?(?!(if|whil|for))[\w_]+[\s]*\([^\)\(]*\)([\s]*const[\s]*)?[\n\s]*\{"
|
||||
mainExpr="^[\t ]*((static|const)[\s]+)?[\w]+([\s]+|\*[\s]+|[\s]+\*|[\s]+\*[\s]+)([\w_]+[\s]*::)?(?!(if|whil|for))[\w_]+[\s]*\([^\)\(]*\)([\s]*const[\s]*)?[\n\s]*\{"
|
||||
OmainExpr="^[\t ]*((static|const)[\s]+)?[\w]+([\s]+|\*[\s]+|[\s]+\*|[\s]+\*[\s]+)([\w_]+[\s]*::)?(?!(if|whil|for))[\w_]+[\s]*\([\n\w_,*&\s]*\)([\s]*const[\s]*)?[\n\s]*\{"
|
||||
displayMode="$className->$functionName">
|
||||
<comment expr="((/\*.*?\*)/|(//.*?$))" />
|
||||
<functionName>
|
||||
<nameExpr expr="(?!(if|whil|for))[\w_]+[\s]*\("/>
|
||||
<nameExpr expr="(?!(if|whil|for))[\w_]+"/>
|
||||
</functionName>
|
||||
<className>
|
||||
<nameExpr expr="[\w_]+(?=[\s]*::)"/>
|
||||
</className>
|
||||
</function>
|
||||
</parser>
|
||||
|
||||
|
||||
<parser id="js_function" displayName="Javascript">
|
||||
<function
|
||||
mainExpr="function[\s]+[\w]*[\s]+\([^\)\(]*\)[\n\s]*\{"
|
||||
displayMode="$className->$functionName">
|
||||
<functionName>
|
||||
<nameExpr expr="(?!(if|whil|for))[\w_]+[\s]*\("/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user