mIsTemplate = 0;
mNestingLevel = 0;
- cur = start;
+ m_cur = start;
mpStart = start;
mpEnd = end;
do
{
- if ( !get_next_token( cur ) )
+ if ( !get_next_token( m_cur ) )
// end of source reached
return pTopCtx;
- if ( memcmp( cur, "ScriptSection( const string&",
+ if ( memcmp( m_cur, "ScriptSection( const string&",
strlen( "ScriptSection( const string&" )
) == 0
)
// ++o;
}
- switch (*cur)
+ switch (*m_cur)
{
case '#' :
{
- AddMacroNode( cur );
+ AddMacroNode( m_cur );
continue;
}
case ':' :
{
- skip_token( cur );
+ skip_token( m_cur );
continue;
}
case ';' :
{
- skip_token( cur );
+ skip_token( m_cur );
continue;
}
case ')' :
{
- skip_token( cur );
+ skip_token( m_cur );
continue;
}
case '=' :
{
- skip_token( cur );
+ skip_token( m_cur );
continue;
}
}
// 'const' is a part of the return type, not a keyword here
- if ( strncmp(cur, "const", 5) != 0 && is_keyword( cur ) )
+ if ( strncmp(m_cur, "const", 5) != 0 && is_keyword( m_cur ) )
{
// parses, token, if token identifies
// the container context (e.g. class/namespace)
// the corresponding context object is created
// and set as current context
- ParseKeyword( cur );
+ ParseKeyword( m_cur );
continue;
}
- if ( *cur >= '0' && *cur <= '9' )
+ if ( *m_cur >= _T('0') && *m_cur <= _T('9') )
{
- skip_token( cur );
+ skip_token( m_cur );
continue;
}
- if ( *cur == '}' )
+ if ( *m_cur == _T('}') )
{
if ( mCurCtxType != SP_CTX_CLASS )
{
// DBG:: unexpected closing-bracket found
//ASSERT(0);
- skip_token( cur ); // just skip it
+ skip_token( m_cur ); // just skip it
continue;
}
if ( mpCurCtx->GetType() == SP_CTX_CLASS )
{
- int curOfs = ( (cur+1) - _gSrcStart );
+ int curOfs = ( (m_cur+1) - _gSrcStart );
mpCurCtx->mContextLength = ( curOfs - mpCurCtx->mSrcOffset );
}
mIsTemplate = 0;
}
- skip_token( cur );
+ skip_token( m_cur );
continue;
}
bool isAMacro = false;
- if ( is_function( cur, isAMacro ) )
+ if ( is_function( m_cur, isAMacro ) )
{
if ( isAMacro )
{
- skip_token( cur );
+ skip_token( m_cur );
continue;
}
- char* savedPos = cur;
+ char* savedPos = m_cur;
int tmpLnNo;
store_line_no( tmpLnNo );
isAMacro = false;
- if ( !ParseNameAndRetVal( cur, isAMacro ) )
+ if ( !ParseNameAndRetVal( m_cur, isAMacro ) )
{
if ( !isAMacro )
{
- cur = savedPos;
- SkipFunction( cur );
+ m_cur = savedPos;
+ SkipFunction( m_cur );
}
continue;
}
- if ( !ParseArguments( cur ) )
+ if ( !ParseArguments( m_cur ) )
{
// failure while parsing arguments,
// remove enclosing operation context
mpCurCtx = mpCurCtx->GetOutterContext();
mpCurCtx->RemoveChild( pFailed );
- skip_to_eol( cur );
- //cur = savedPos;
+ skip_to_eol( m_cur );
+ //m_cur = savedPos;
}
else
{
clear_commets_queue();
- SkipFunctionBody( cur );
+ SkipFunctionBody( m_cur );
mpCurCtx = mpCurCtx->GetOutterContext();
{
// non-class members are ignored
- skip_token( cur ); // skip the end of statement
+ skip_token( m_cur ); // skip the end of statement
continue;
}
- ParseMemberVar( cur );
+ ParseMemberVar( m_cur );
}
} while( 1 );
MCommentListT& lst = ctx.GetCommentList();
- char* prevComEnd = 0;
+ wxChar* prevComEnd = 0;
int tmpLnNo;
store_line_no( tmpLnNo );
lst.push_back( pComment );
// find the end of comment
- char* start = _gCommentsQueue[i];
+ wxChar* start = _gCommentsQueue[i];
- pComment->mIsMultiline = ( *(start+1) == '*' );
+ pComment->mIsMultiline = ( *(start+1) == _T('*') );
// first comment in the queue and multiline
// comments are always treated as a begining
// of the new paragraph in the comment text
if ( i == 0 )
-
+ {
pComment->mStartsPar = true;
- else
- if ( pComment->mIsMultiline )
-
+ }
+ else if ( pComment->mIsMultiline )
+ {
pComment->mStartsPar = true;
+ }
else
{
// find out wheather there is a new-line
// between to adjecent comments
-
- char* prevLine = start;
+ wxChar* prevLine = start;
skip_to_prev_line(prevLine);
if ( prevLine >= prevComEnd )
-
pComment->mStartsPar = true;
else
pComment->mStartsPar = false;
prevComEnd = set_comment_text( pComment->m_Text, start );
}
-
// attach comments which are at the end of the line
// of the given context (if any)
set_comment_text( pComment->m_Text, cur );
pComment->mStartsPar = 1;
- pComment->mIsMultiline = ( *(cur+1) == '*' );
+ pComment->mIsMultiline = ( *(cur+1) == _T('*') );
// mark this comment, so that it would not
// get in the comments list of the next context
mpCurClassSect(0)
{
// topIndex is not referenced
- mpTopIdx = new ScriptSection( "Source Code Contents" , "", &mTopTempl , 0 );
- mpClassIdx = new ScriptSection( "Classes Reference" , "", &mContentIdxTempl, &mRefTempl );
- mpEnumIdx = new ScriptSection( "Enumerations Reference" , "", &mContentIdxTempl, &mRefTempl );
- mpTypeDefIdx = new ScriptSection( "Type Definitions Reference" , "", &mContentIdxTempl, &mRefTempl );
- mpMacroIdx = new ScriptSection( "Macros Reference" , "", &mContentIdxTempl, &mRefTempl );
- mpGlobalVarsIdx = new ScriptSection( "Global Variables Reference" , "", &mContentIdxTempl, &mRefTempl );
- mpGlobalFuncIdx = new ScriptSection( "Global Functions Reference", "", &mContentIdxTempl, &mRefTempl );
- mpConstIdx = new ScriptSection( "Constants Reference" , "", &mContentIdxTempl, &mRefTempl );
+ mpTopIdx = new ScriptSection( "Source Code Contents" , wxEmptyString, &mTopTempl , 0 );
+ mpClassIdx = new ScriptSection( "Classes Reference" , wxEmptyString, &mContentIdxTempl, &mRefTempl );
+ mpEnumIdx = new ScriptSection( "Enumerations Reference" , wxEmptyString, &mContentIdxTempl, &mRefTempl );
+ mpTypeDefIdx = new ScriptSection( "Type Definitions Reference" , wxEmptyString, &mContentIdxTempl, &mRefTempl );
+ mpMacroIdx = new ScriptSection( "Macros Reference" , wxEmptyString, &mContentIdxTempl, &mRefTempl );
+ mpGlobalVarsIdx = new ScriptSection( "Global Variables Reference" , wxEmptyString, &mContentIdxTempl, &mRefTempl );
+ mpGlobalFuncIdx = new ScriptSection( "Global Functions Reference", wxEmptyString, &mContentIdxTempl, &mRefTempl );
+ mpConstIdx = new ScriptSection( "Constants Reference" , wxEmptyString, &mContentIdxTempl, &mRefTempl );
// assemble top index
mpTopIdx->AddSection( mpClassIdx , 1 );
void RipperDocGen::AppendHighlightedSource( wxString& st, wxString source )
{
// FIXME:: below should not be fixed :)
- char buf[1024*32];
+ wxChar buf[1024*32];
// DBG:::
// ASSERT( source.length() + 1 < sizeof(buf) );
- strcpy( buf, source.c_str() );
+ wxStrcpy( buf, source.c_str() );
// highlight things
mSrcPainter.Init();
if ( ctx.HasComments() ) return 0;
toSect.AddReference(
- new ScriptSection( GetScopedName( ctx ), "", 0, &mDeadRefTempl )
+ new ScriptSection( GetScopedName( ctx ), wxEmptyString, 0, &mDeadRefTempl )
);
return 1;
if ( !pFound )
{
ScriptSection* pNotFound =
- new ScriptSection( superClName, "", 0, &mDeadRefTempl );
+ new ScriptSection( superClName, wxEmptyString, 0, &mDeadRefTempl );
pSuperSect->AddReference( pNotFound );
}
void RipperDocGen::VisitEnumeration( spEnumeration& en )
{
// FOR NOW:: do not reference "nameless" enums
- if ( en.GetName() == "" ) return;
+ if ( en.GetName().empty() ) return;
if ( CheckIfUncommented( en, *mpEnumIdx ) )
return;
// to the section where this class is represented
cl.SetUserData( mpCurClassSect );
- ScriptSection* pSuper = new ScriptSection( "Derived from" ,"", &mOutLine1Templ,0, 1 );
+ ScriptSection* pSuper = new ScriptSection( "Derived from" ,wxEmptyString, &mOutLine1Templ,0, 1 );
- ScriptSection* pPublic = new ScriptSection( "Public members" ,"", &mOutLineTempl,0, 1 );
- ScriptSection* pProtected = new ScriptSection( "Protected members" ,"", &mOutLineTempl,0, 1 );
- ScriptSection* pPrivate = new ScriptSection( "Private members" ,"", &mOutLineTempl,0, 1 );
+ ScriptSection* pPublic = new ScriptSection( "Public members" ,wxEmptyString, &mOutLineTempl,0, 1 );
+ ScriptSection* pProtected = new ScriptSection( "Protected members" ,wxEmptyString, &mOutLineTempl,0, 1 );
+ ScriptSection* pPrivate = new ScriptSection( "Private members" ,wxEmptyString, &mOutLineTempl,0, 1 );
- pPublic->AddSection( new ScriptSection( "Operations", "", &mOutLine1Templ, 0, 1 ) );
- pPublic->AddSection( new ScriptSection( "Attributes", "", &mOutLine1Templ, 0, 1 ) );
+ pPublic->AddSection( new ScriptSection( "Operations", wxEmptyString, &mOutLine1Templ, 0, 1 ) );
+ pPublic->AddSection( new ScriptSection( "Attributes", wxEmptyString, &mOutLine1Templ, 0, 1 ) );
- pProtected->AddSection( new ScriptSection( "Operations", "", &mOutLine1Templ, 0, 1 ) );
- pProtected->AddSection( new ScriptSection( "Attributes", "", &mOutLine1Templ, 0, 1 ) );
+ pProtected->AddSection( new ScriptSection( "Operations", wxEmptyString, &mOutLine1Templ, 0, 1 ) );
+ pProtected->AddSection( new ScriptSection( "Attributes", wxEmptyString, &mOutLine1Templ, 0, 1 ) );
- pPrivate->AddSection( new ScriptSection( "Operations", "", &mOutLine1Templ, 0, 1 ) );
- pPrivate->AddSection( new ScriptSection( "Attributes", "", &mOutLine1Templ, 0, 1 ) );
+ pPrivate->AddSection( new ScriptSection( "Operations", wxEmptyString, &mOutLine1Templ, 0, 1 ) );
+ pPrivate->AddSection( new ScriptSection( "Attributes", wxEmptyString, &mOutLine1Templ, 0, 1 ) );
mpCurClassSect->AddSection( pSuper );
mpCurClassSect->AddSection( pPublic );