1. more C++ parser fixes - now it almost parses wx/string.h

a) #if/#ifdef/#else (very) limited support
 b) param type fix - now indirection chars are correctly handled
 c) class/struct/union distinction
 d) public/private fixes
 e) Dump() function added - very useful for debugging

2. option to ignore parameter names during 'diff' (in fact, they're ignored
   by default, and this option switches it on)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1744 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-02-21 22:32:46 +00:00
parent c4c794e1d0
commit d12e353663
6 changed files with 2617 additions and 2197 deletions

View File

@@ -7,7 +7,7 @@
// Created: 22/09/98
// RCS-ID: $Id$
// Copyright: (c) Aleskandars Gluchovas
// Licence: wxWindows licence
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __CJPARSESR_G__
@@ -22,72 +22,72 @@
// class parses given "memory-resident" Java or C++ source code
// and captures information about classes/attrubutes/methods/
// arguments/etc into structures. Conforms with SourceParserBase
// arguments/etc into structures. Conforms with SourceParserBase
// interface requirements.
class CJSourceParser : public SourceParserBase
{
protected:
// begining of the full-text area of the source file
char* mpStart;
// begining of the full-text area of the source file
char* mpStart;
// points to first character after the end
// of teh full-text area
char* mpEnd;
// points to first character after the end
// of teh full-text area
char* mpEnd;
// current "privacy level"
int mCurVis;
// current "privacy level"
int mCurVis;
// current parsing position int full-text area
char* cur;
// current parsing position int full-text area
char* cur;
// about the current class
bool mIsVirtual;
bool mIsTemplate;
size_t mNestingLevel;
// about the current class
bool mIsVirtual;
bool mIsTemplate;
size_t mNestingLevel;
// context data for which is currently being collected
spContext* mpCurCtx;
// context data for which is currently being collected
spContext* mpCurCtx;
int mCurCtxType; // type of the current context
int mCurCtxType; // type of the current context
bool mCommentsOn;
bool mMacrosOn;
bool mCommentsOn;
bool mMacrosOn;
protected:
void AttachComments( spContext& ctx, char* cur );
void ParseKeyword( char*& cur );
bool ParseNameAndRetVal( char*& cur, bool& isAMacro );
bool ParseArguments( char*& cur );
void ParseMemberVar( char*& cur );
void SkipFunction( char*& cur );
void SkipFunctionBody( char*& cur );
bool CheckVisibilty( char*& cur );
void AttachComments( spContext& ctx, char* cur );
void ParseKeyword( char*& cur );
bool ParseNameAndRetVal( char*& cur, bool& isAMacro );
bool ParseArguments( char*& cur );
void ParseMemberVar( char*& cur );
void SkipFunction( char*& cur );
void SkipFunctionBody( char*& cur );
bool CheckVisibilty( char*& cur );
void AddClassNode( char*& cur );
void AddMacroNode( char*& cur );
void AddEnumNode( char*& cur );
void AddTypeDefNode( char*& cur );
void AddClassNode( char*& cur );
void AddMacroNode( char*& cur );
void AddEnumNode( char*& cur );
void AddTypeDefNode( char*& cur );
void DumpOperationInfo( spOperation& info, const string& tab, ostream& os );
void DumpClassHeader( spClass& info, ostream& os );
void DumpClassBody( spClass& info, ostream& os );
void DumpOperationInfo( spOperation& info, const string& tab, ostream& os );
void DumpClassHeader( spClass& info, ostream& os );
void DumpClassBody( spClass& info, ostream& os );
public:
// NOTE:: discarding of macros or comments improves performance and
// decreases memory usage
// NOTE:: discarding of macros or comments improves performance and
// decreases memory usage
CJSourceParser(bool collectCommnets = 1,
bool collectMacros = 1);
CJSourceParser(bool collectCommnets = 1,
bool collectMacros = 1);
// returns the root-node of the created context tree
// (user is responsible for releasing it from the heep)
// "end" should point to the last (character + 1) of the
// source text
// returns the root-node of the created context tree
// (user is responsible for releasing it from the heep)
// "end" should point to the last (character + 1) of the
// source text
virtual spFile* Parse( char* start, char* end );
virtual spFile* Parse( char* start, char* end );
};
// inline'ed helpers used (just info):