2
* This file is part of the FortranProject plugin for Code::Blocks IDE
3
* and licensed under the GNU General Public License, version 3
4
* http://www.gnu.org/licenses/gpl-3.0.html
7
#ifndef PARSERTHREADF_H
8
#define PARSERTHREADF_H
11
#include "tokenizerf.h"
12
#include "usetokenf.h"
13
#include "moduletokenf.h"
14
#include "submoduletokenf.h"
15
#include "includedb.h"
23
ParserThreadF(const wxString& bufferOrFilename,
25
FortranSourceForm fsForm,
27
IncludeDB* includeDB=NULL);
28
ParserThreadF(const wxString& filename,
30
FortranSourceForm fsForm,
32
const wxString& buffer);
33
virtual ~ParserThreadF();
35
void ParseDeclarations(bool breakAtEnd=false, bool breakAtContains=false);
36
static void SplitAssociateConstruct(const wxString& argLine, std::map<wxString,wxString>& assocMap);
39
TokenF* DoAddToken(TokenKindF kind, const wxString& name, const wxString& args=wxEmptyString, const wxString& typeDefinition=wxEmptyString);
40
TokenF* DoAddToken(TokenKindF kind, const wxString& name, const wxString& args, const unsigned int defStartLine);
41
UseTokenF* DoAddUseToken(const wxString& modName);
42
ModuleTokenF* DoAddModuleToken(const wxString& modName);
43
SubmoduleTokenF* DoAddSubmoduleToken(const wxString& submName, const wxString& ancestorModule, const wxString& parentSubmodule, unsigned int defStartLine);
46
TokensArrayF* m_pTokens;
47
TokenF* m_pLastParent;
49
wxArrayString m_IncludeList;
50
IncludeDB* m_pIncludeDB;
52
wxString m_LastTokenName;
53
DocBlock m_ParentDocs;
55
unsigned int m_InterfaceOperator;
56
unsigned int m_InterfaceAssignment;
57
unsigned int m_InterfaceRead;
58
unsigned int m_InterfaceWrite;
60
const wxString m_Briefend;
62
void InitSecondEndPart();
64
void HandleSubmodule();
65
void HandleFunction(TokenKindF, TokenAccessKind taKind=taPublic);
66
void HandleType(bool& needDefault, TokenF* &newToken);
69
void HandleBlockConstruct();
70
void HandleAssociateConstruct();
71
void HandleSelectTypeConstruct();
72
void HandleSelectCaseConstruct();
73
void HandleInterface(TokenAccessKind taKind=taPublic);
74
void HandleInterface(TokenAccessKind taKind, TokenF* &tokNew, bool &isGeneric);
75
void HandleBlockData();
77
void HandleAccessList(TokenAccessKind taKind, bool& changeDefault, int& countAccess, wxArrayString& nameList);
78
void HandleProcedureList();
79
void HandlePrivatePublic();
81
bool IsEnd(wxString tok_low, wxString nex_low);
82
bool ParseDeclarationsFirstPart(wxString& token, wxString& next);
83
void ParseDeclarationsSecondPart(wxString& token, bool& needDefault, TokensArrayF& newTokenArr);
84
void HandleSubmoduleProcedure();
85
void CheckParseOneDeclaration(wxString& token, wxString& tok_low, wxString& next, wxString& next_low,
86
bool& needDefault, TokensArrayF& newTokenArr);
87
void ParseTypeBoundProcedures(const wxString& firstWord, bool breakAtEOL, bool passIn=true);
88
void MakeArrayStringLower(wxArrayString &arr, wxArrayString &arrLw);
89
void ChangeTokenAccess(ModuleTokenF* modToken, TokenF* token);
90
void GetDocBlock(DocBlock &docs, bool lookDown, unsigned int ln, bool takeSimpleDoc);
91
wxString TrimRepetitives(wxString& inStr);
92
wxString GetDocLine(unsigned int ln);
93
void AddParamDocs(TokenF* pParToken, DocBlock &docs);
96
std::set<wxString> m_KnownEndSecPart;
99
#endif // PARSERTHREADF_H