~efargaspro/+junk/codeblocks-16.01-release

« back to all changes in this revision

Viewing changes to src/plugins/contrib/FortranProject/parserthreadf.h

  • Committer: damienlmoore at gmail
  • Date: 2016-02-02 02:43:22 UTC
  • Revision ID: damienlmoore@gmail.com-20160202024322-yql5qmtbwdyamdwd
Code::BlocksĀ 16.01

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
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
 
5
 */
 
6
 
 
7
#ifndef PARSERTHREADF_H
 
8
#define PARSERTHREADF_H
 
9
 
 
10
#include "tokenf.h"
 
11
#include "tokenizerf.h"
 
12
#include "usetokenf.h"
 
13
#include "moduletokenf.h"
 
14
#include "submoduletokenf.h"
 
15
#include "includedb.h"
 
16
#include "docblock.h"
 
17
#include <set>
 
18
 
 
19
 
 
20
class ParserThreadF
 
21
{
 
22
    public:
 
23
        ParserThreadF(const wxString& bufferOrFilename,
 
24
                                                         TokensArrayF* tokens,
 
25
                                                         FortranSourceForm fsForm,
 
26
                                                         bool isBuffer=false,
 
27
                                                         IncludeDB* includeDB=NULL);
 
28
        ParserThreadF(const wxString& filename,
 
29
                                                         TokensArrayF* tokens,
 
30
                                                         FortranSourceForm fsForm,
 
31
                                                         IncludeDB* includeDB,
 
32
                                                         const wxString& buffer);
 
33
        virtual ~ParserThreadF();
 
34
        bool Parse();
 
35
        void ParseDeclarations(bool breakAtEnd=false, bool breakAtContains=false);
 
36
        static void SplitAssociateConstruct(const wxString& argLine, std::map<wxString,wxString>& assocMap);
 
37
    protected:
 
38
    private:
 
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);
 
44
 
 
45
                Tokenizerf m_Tokens;
 
46
                TokensArrayF* m_pTokens;
 
47
                TokenF* m_pLastParent;
 
48
                wxString m_Filename;
 
49
                wxArrayString m_IncludeList;
 
50
                IncludeDB* m_pIncludeDB;
 
51
 
 
52
                wxString m_LastTokenName;
 
53
                DocBlock m_ParentDocs;
 
54
 
 
55
                unsigned int m_InterfaceOperator;
 
56
                unsigned int m_InterfaceAssignment;
 
57
                unsigned int m_InterfaceRead;
 
58
                unsigned int m_InterfaceWrite;
 
59
 
 
60
                const wxString m_Briefend;
 
61
 
 
62
        void InitSecondEndPart();
 
63
                void HandleModule();
 
64
                void HandleSubmodule();
 
65
                void HandleFunction(TokenKindF, TokenAccessKind taKind=taPublic);
 
66
                void HandleType(bool& needDefault, TokenF* &newToken);
 
67
                void HandleType();
 
68
                void HandleUse();
 
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();
 
76
                void HandleInclude();
 
77
                void HandleAccessList(TokenAccessKind taKind, bool& changeDefault, int& countAccess, wxArrayString& nameList);
 
78
                void HandleProcedureList();
 
79
                void HandlePrivatePublic();
 
80
                void GoThroughBody();
 
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);
 
94
                void HandleBindTo();
 
95
 
 
96
        std::set<wxString> m_KnownEndSecPart;
 
97
};
 
98
 
 
99
#endif // PARSERTHREADF_H