More warning and error fixes (work in progress with Tinderbox).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34416 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -386,13 +386,13 @@ static inline bool get_next_token( char*& cur )
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void skip_preprocessor_dir( char*& cur )
|
static inline void skip_preprocessor_dir( wxChar*& cur )
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
skip_to_eol(cur);
|
skip_to_eol(cur);
|
||||||
|
|
||||||
if ( *(cur-1) != '\\' )
|
if ( *(cur-1) != _T('\\') )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if ( cur < _gSrcEnd )
|
if ( cur < _gSrcEnd )
|
||||||
@@ -2196,10 +2196,10 @@ void CJSourceParser::AddClassNode( char*& cur )
|
|||||||
clear_commets_queue();
|
clear_commets_queue();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CJSourceParser::AddEnumNode( char*& cur )
|
void CJSourceParser::AddEnumNode( wxChar*& cur )
|
||||||
{
|
{
|
||||||
// now the cursor is at "enum" keyword
|
// now the cursor is at "enum" keyword
|
||||||
char* start = cur;
|
wxChar* start = cur;
|
||||||
|
|
||||||
spEnumeration* pEnum = new spEnumeration();
|
spEnumeration* pEnum = new spEnumeration();
|
||||||
mpCurCtx->AddMember( pEnum );
|
mpCurCtx->AddMember( pEnum );
|
||||||
@@ -2233,13 +2233,13 @@ void CJSourceParser::AddEnumNode( char*& cur )
|
|||||||
clear_commets_queue();
|
clear_commets_queue();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CJSourceParser::AddTypeDefNode( char*& cur )
|
void CJSourceParser::AddTypeDefNode( wxChar*& cur )
|
||||||
{
|
{
|
||||||
// now the cursor at the token next to "typedef" keyword
|
// now the cursor at the token next to "typedef" keyword
|
||||||
|
|
||||||
if ( !get_next_token(cur) ) return;
|
if ( !get_next_token(cur) ) return;
|
||||||
|
|
||||||
char* start = cur;
|
wxChar* start = cur;
|
||||||
|
|
||||||
spTypeDef* pTDef = new spTypeDef();
|
spTypeDef* pTDef = new spTypeDef();
|
||||||
mpCurCtx->AddMember( pTDef );
|
mpCurCtx->AddMember( pTDef );
|
||||||
@@ -2253,18 +2253,18 @@ void CJSourceParser::AddTypeDefNode( char*& cur )
|
|||||||
int tmpLnNo;
|
int tmpLnNo;
|
||||||
store_line_no( tmpLnNo );
|
store_line_no( tmpLnNo );
|
||||||
|
|
||||||
char* tok = cur-1;
|
wxChar* tok = cur-1;
|
||||||
skip_next_token_back( tok );
|
skip_next_token_back( tok );
|
||||||
|
|
||||||
char* nameEnd = tok;
|
wxChar* nameEnd = tok;
|
||||||
|
|
||||||
skip_token_back( tok );
|
skip_token_back( tok );
|
||||||
|
|
||||||
char* nameStart = tok;
|
wxChar* nameStart = tok;
|
||||||
|
|
||||||
skip_next_token_back( tok );
|
skip_next_token_back( tok );
|
||||||
|
|
||||||
char* typeEnd = tok;
|
wxChar* typeEnd = tok;
|
||||||
|
|
||||||
// check if it's function prototype
|
// check if it's function prototype
|
||||||
if ( *nameStart == ')' )
|
if ( *nameStart == ')' )
|
||||||
|
@@ -257,13 +257,13 @@ ScriptTemplate* RipperDocGen::GetRefTemplFor( spContext& ctx )
|
|||||||
return &mDeadRefTempl;
|
return &mDeadRefTempl;
|
||||||
}
|
}
|
||||||
|
|
||||||
string RipperDocGen::GetScopedName( spContext& ofCtx )
|
wxString RipperDocGen::GetScopedName( spContext& ofCtx )
|
||||||
{
|
{
|
||||||
if ( ofCtx.IsInFile() )
|
if ( ofCtx.IsInFile() )
|
||||||
return ofCtx.GetName();
|
return ofCtx.GetName();
|
||||||
else
|
else
|
||||||
return ofCtx.GetOutterContext()->GetName() +
|
return ofCtx.GetOutterContext()->GetName() +
|
||||||
"::" + ofCtx.GetName();
|
_T("::") + ofCtx.GetName();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RipperDocGen::AddToCurrentClass( ScriptSection* pSection, spContext& ctx,
|
void RipperDocGen::AddToCurrentClass( ScriptSection* pSection, spContext& ctx,
|
||||||
@@ -371,14 +371,14 @@ void RipperDocGen::VisitEnumeration( spEnumeration& en )
|
|||||||
if ( CheckIfUncommented( en, *mpEnumIdx ) )
|
if ( CheckIfUncommented( en, *mpEnumIdx ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
string body;
|
wxString body;
|
||||||
body += mTags[TAG_BOLD].start;
|
body += mTags[TAG_BOLD].start;
|
||||||
|
|
||||||
AppendMulitilineStr( body, en.m_EnumContent );
|
AppendMulitilineStr( body, en.m_EnumContent );
|
||||||
|
|
||||||
body += mTags[TAG_BOLD].end;
|
body += mTags[TAG_BOLD].end;
|
||||||
|
|
||||||
string line;
|
wxString line;
|
||||||
AppendHighlightedSource( line, body );
|
AppendHighlightedSource( line, body );
|
||||||
AppendComments( en, line );
|
AppendComments( en, line );
|
||||||
|
|
||||||
@@ -394,7 +394,7 @@ void RipperDocGen::VisitTypeDef( spTypeDef& td )
|
|||||||
if ( CheckIfUncommented( td, *mpTypeDefIdx ) )
|
if ( CheckIfUncommented( td, *mpTypeDefIdx ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
string body;
|
wxString body;
|
||||||
body += mTags[TAG_BOLD].start;
|
body += mTags[TAG_BOLD].start;
|
||||||
body += "typdef ";
|
body += "typdef ";
|
||||||
body += mTags[TAG_BOLD].end;
|
body += mTags[TAG_BOLD].end;
|
||||||
@@ -407,7 +407,7 @@ void RipperDocGen::VisitTypeDef( spTypeDef& td )
|
|||||||
body += td.GetName();
|
body += td.GetName();
|
||||||
body += mTags[TAG_BOLD].end;
|
body += mTags[TAG_BOLD].end;
|
||||||
|
|
||||||
string line;
|
wxString line;
|
||||||
AppendHighlightedSource( line, body );
|
AppendHighlightedSource( line, body );
|
||||||
AppendComments( td, line );
|
AppendComments( td, line );
|
||||||
|
|
||||||
@@ -426,10 +426,10 @@ void RipperDocGen::VisitPreprocessorLine( spPreprocessorLine& pd )
|
|||||||
if ( CheckIfUncommented( pd, *mpMacroIdx ) )
|
if ( CheckIfUncommented( pd, *mpMacroIdx ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
string body;
|
wxString body;
|
||||||
body += mTags[TAG_FIXED_FONT].start;
|
body += mTags[TAG_FIXED_FONT].start;
|
||||||
|
|
||||||
string coloredLine = pd.m_Line;
|
wxString coloredLine = pd.m_Line;
|
||||||
AppendHighlightedSource( coloredLine, pd.m_Line );
|
AppendHighlightedSource( coloredLine, pd.m_Line );
|
||||||
|
|
||||||
AppendMulitilineStr( body, coloredLine );
|
AppendMulitilineStr( body, coloredLine );
|
||||||
@@ -456,7 +456,7 @@ void RipperDocGen::VisitClass( spClass& cl )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
string body;
|
wxString body;
|
||||||
AppendComments( cl, body );
|
AppendComments( cl, body );
|
||||||
|
|
||||||
mpCurClassSect =
|
mpCurClassSect =
|
||||||
@@ -491,7 +491,7 @@ void RipperDocGen::VisitClass( spClass& cl )
|
|||||||
|
|
||||||
void RipperDocGen::VisitAttribute( spAttribute& attr )
|
void RipperDocGen::VisitAttribute( spAttribute& attr )
|
||||||
{
|
{
|
||||||
string body;
|
wxString body;
|
||||||
body += mTags[TAG_BOLD].start;
|
body += mTags[TAG_BOLD].start;
|
||||||
body += attr.m_Type;
|
body += attr.m_Type;
|
||||||
body += mTags[TAG_BOLD].end;
|
body += mTags[TAG_BOLD].end;
|
||||||
@@ -501,7 +501,7 @@ void RipperDocGen::VisitAttribute( spAttribute& attr )
|
|||||||
body += attr.GetName();
|
body += attr.GetName();
|
||||||
body += mTags[TAG_ITALIC].end;
|
body += mTags[TAG_ITALIC].end;
|
||||||
|
|
||||||
string line;
|
wxString line;
|
||||||
AppendHighlightedSource( line, body );
|
AppendHighlightedSource( line, body );
|
||||||
AppendComments( attr, line );
|
AppendComments( attr, line );
|
||||||
|
|
||||||
@@ -525,7 +525,7 @@ void RipperDocGen::VisitAttribute( spAttribute& attr )
|
|||||||
|
|
||||||
void RipperDocGen::VisitOperation( spOperation& op )
|
void RipperDocGen::VisitOperation( spOperation& op )
|
||||||
{
|
{
|
||||||
string body;
|
wxString body;
|
||||||
|
|
||||||
AppendHighlightedSource( body, op.GetFullName(mTags) );
|
AppendHighlightedSource( body, op.GetFullName(mTags) );
|
||||||
|
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
// Created: 22/09/98
|
// Created: 22/09/98
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) Aleskandars Gluchovas
|
// Copyright: (c) Aleskandars Gluchovas
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef __DOCRIPPER_G__
|
#ifndef __DOCRIPPER_G__
|
||||||
@@ -18,16 +18,16 @@
|
|||||||
|
|
||||||
#if defined( wxUSE_TEMPLATE_STL )
|
#if defined( wxUSE_TEMPLATE_STL )
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
typedef vector<ScriptTemplate*> STemplateListT;
|
typedef vector<ScriptTemplate*> STemplateListT;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#include "wxstlvec.h"
|
#include "wxstlvec.h"
|
||||||
|
|
||||||
typedef ScriptTemplate* ScriptTemplatePtrT;
|
typedef ScriptTemplate* ScriptTemplatePtrT;
|
||||||
typedef WXSTL_VECTOR_SHALLOW_COPY(ScriptTemplatePtrT) STemplateListT;
|
typedef WXSTL_VECTOR_SHALLOW_COPY(ScriptTemplatePtrT) STemplateListT;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -38,119 +38,119 @@
|
|||||||
class RipperDocGen : public DocGeneratorBase, public spVisitor
|
class RipperDocGen : public DocGeneratorBase, public spVisitor
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
// templates for various sections
|
// templates for various sections
|
||||||
ScriptTemplate mTopTempl;
|
ScriptTemplate mTopTempl;
|
||||||
ScriptTemplate mContentIdxTempl;
|
ScriptTemplate mContentIdxTempl;
|
||||||
ScriptTemplate mSuperContentTempl;
|
ScriptTemplate mSuperContentTempl;
|
||||||
ScriptTemplate mSubContentTempl;
|
ScriptTemplate mSubContentTempl;
|
||||||
ScriptTemplate mOutLineTempl;
|
ScriptTemplate mOutLineTempl;
|
||||||
ScriptTemplate mOutLine1Templ;
|
ScriptTemplate mOutLine1Templ;
|
||||||
|
|
||||||
// template used for corss-references
|
// template used for corss-references
|
||||||
ScriptTemplate mRefTempl;
|
ScriptTemplate mRefTempl;
|
||||||
|
|
||||||
// template used to show not-existing sections
|
// template used to show not-existing sections
|
||||||
ScriptTemplate mDeadRefTempl;
|
ScriptTemplate mDeadRefTempl;
|
||||||
|
|
||||||
// template collection for generation of class-tree
|
// template collection for generation of class-tree
|
||||||
STemplateListT mTreeTemplates;
|
STemplateListT mTreeTemplates;
|
||||||
|
|
||||||
// pointers to all major index sections
|
// pointers to all major index sections
|
||||||
ScriptSection* mpTopIdx;
|
ScriptSection* mpTopIdx;
|
||||||
ScriptSection* mpClassIdx;
|
ScriptSection* mpClassIdx;
|
||||||
ScriptSection* mpEnumIdx;
|
ScriptSection* mpEnumIdx;
|
||||||
ScriptSection* mpTypeDefIdx;
|
ScriptSection* mpTypeDefIdx;
|
||||||
ScriptSection* mpMacroIdx;
|
ScriptSection* mpMacroIdx;
|
||||||
ScriptSection* mpGlobalVarsIdx;
|
ScriptSection* mpGlobalVarsIdx;
|
||||||
ScriptSection* mpGlobalFuncIdx;
|
ScriptSection* mpGlobalFuncIdx;
|
||||||
ScriptSection* mpConstIdx;
|
ScriptSection* mpConstIdx;
|
||||||
|
|
||||||
// parser set up from user-code for sepcific language
|
// parser set up from user-code for sepcific language
|
||||||
SourceParserBase* mpParser;
|
SourceParserBase* mpParser;
|
||||||
|
|
||||||
// class section, which is currently being
|
// class section, which is currently being
|
||||||
// assembled
|
// assembled
|
||||||
ScriptSection* mpCurClassSect;
|
ScriptSection* mpCurClassSect;
|
||||||
|
|
||||||
// source syntax heighlighter object
|
// source syntax heighlighter object
|
||||||
SourcePainter mSrcPainter;
|
SourcePainter mSrcPainter;
|
||||||
|
|
||||||
// context, to which all file contexts
|
// context, to which all file contexts
|
||||||
// are assembled
|
// are assembled
|
||||||
spContext* mpFileBinderCtx;
|
spContext* mpFileBinderCtx;
|
||||||
|
|
||||||
// script tags set up from usesr code
|
// script tags set up from usesr code
|
||||||
MarkupTagsT mTags;
|
MarkupTagsT mTags;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// helpers
|
// helpers
|
||||||
void AppendComments( spContext& fromContext, string& str );
|
void AppendComments( spContext& fromContext, string& str );
|
||||||
|
|
||||||
void AppendMulitilineStr( string& st, string& mlStr );
|
void AppendMulitilineStr( string& st, string& mlStr );
|
||||||
|
|
||||||
void AppendHighlightedSource( string& st, string source );
|
void AppendHighlightedSource( string& st, string source );
|
||||||
|
|
||||||
// returns TRUE, if no comments found in the context,
|
// returns true, if no comments found in the context,
|
||||||
// plus, creates dummy(empty) section, and puts a
|
// plus, creates dummy(empty) section, and puts a
|
||||||
// reference woth "dead-link" template to it in the
|
// reference woth "dead-link" template to it in the
|
||||||
// given index-section "toSect"
|
// given index-section "toSect"
|
||||||
|
|
||||||
bool CheckIfUncommented( spContext& ctx, ScriptSection& toSect );
|
bool CheckIfUncommented( spContext& ctx, ScriptSection& toSect );
|
||||||
|
|
||||||
// checks if context has any comments, then returns
|
// checks if context has any comments, then returns
|
||||||
// template of normal reference, otherwise of dead reference
|
// template of normal reference, otherwise of dead reference
|
||||||
|
|
||||||
ScriptTemplate* GetRefTemplFor( spContext& ctx );
|
ScriptTemplate* GetRefTemplFor( spContext& ctx );
|
||||||
|
|
||||||
// adds "someClass::" perfix to the context name,
|
// adds "someClass::" perfix to the context name,
|
||||||
// if it's not in the file scope (i.e. if it's not global)
|
// if it's not in the file scope (i.e. if it's not global)
|
||||||
|
|
||||||
string GetScopedName( spContext& ofCtx );
|
wxString GetScopedName( spContext& ofCtx );
|
||||||
|
|
||||||
// adds section to currently assembled class section
|
// adds section to currently assembled class section
|
||||||
// and places references to it from "public", "protected"
|
// and places references to it from "public", "protected"
|
||||||
// or "private" indexing-subsections of the class, depending
|
// or "private" indexing-subsections of the class, depending
|
||||||
// on the visibility of the context
|
// on the visibility of the context
|
||||||
|
|
||||||
void AddToCurrentClass( ScriptSection* pSection, spContext& ctx,
|
void AddToCurrentClass( ScriptSection* pSection, spContext& ctx,
|
||||||
const char* subSectionName );
|
const char* subSectionName );
|
||||||
|
|
||||||
// called, after all files are processed, to
|
// called, after all files are processed, to
|
||||||
// resolve possible super/derived class relations,
|
// resolve possible super/derived class relations,
|
||||||
// and put cross references to them - where resolution was
|
// and put cross references to them - where resolution was
|
||||||
// successful
|
// successful
|
||||||
void LinkSuperClassRefs();
|
void LinkSuperClassRefs();
|
||||||
|
|
||||||
// implementations of "visiting procedures", declared in spVisitor
|
// implementations of "visiting procedures", declared in spVisitor
|
||||||
|
|
||||||
virtual void VisitClass( spClass& cl );
|
virtual void VisitClass( spClass& cl );
|
||||||
virtual void VisitEnumeration( spEnumeration& en );
|
virtual void VisitEnumeration( spEnumeration& en );
|
||||||
virtual void VisitTypeDef( spTypeDef& td );
|
virtual void VisitTypeDef( spTypeDef& td );
|
||||||
virtual void VisitPreprocessorLine( spPreprocessorLine& pd );
|
virtual void VisitPreprocessorLine( spPreprocessorLine& pd );
|
||||||
virtual void VisitAttribute( spAttribute& attr );
|
virtual void VisitAttribute( spAttribute& attr );
|
||||||
virtual void VisitOperation( spOperation& op );
|
virtual void VisitOperation( spOperation& op );
|
||||||
|
|
||||||
// overriden member of DocGernatorBase
|
// overriden member of DocGernatorBase
|
||||||
|
|
||||||
virtual bool OnSaveDocument( ScriptStream& stm );
|
virtual bool OnSaveDocument( ScriptStream& stm );
|
||||||
|
|
||||||
virtual ScriptSection* GetTopSection()
|
virtual ScriptSection* GetTopSection()
|
||||||
{ return mpTopIdx; }
|
{ return mpTopIdx; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RipperDocGen();
|
RipperDocGen();
|
||||||
~RipperDocGen();
|
~RipperDocGen();
|
||||||
|
|
||||||
// should be called onece to set user-code provided,
|
// should be called onece to set user-code provided,
|
||||||
// parser for specific source code language
|
// parser for specific source code language
|
||||||
// (NOTE:: it's the user-code's responsibility to
|
// (NOTE:: it's the user-code's responsibility to
|
||||||
// relseas memory of pParser)
|
// relseas memory of pParser)
|
||||||
|
|
||||||
void Init( SourceParserBase* pParser );
|
void Init( SourceParserBase* pParser );
|
||||||
|
|
||||||
// should be called on each file
|
// should be called on each file
|
||||||
|
|
||||||
void ProcessFile( const char* sourceFile );
|
void ProcessFile( const char* sourceFile );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user