// Created: 22/09/98
// RCS-ID: $Id$
// Copyright: (c) Aleskandars Gluchovas
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
*cur != '/'
) ++cur;
- if ( cur == _gSrcEnd ) return FALSE;
+ if ( cur == _gSrcEnd ) return false;
if ( *cur == '/' )
{
if ( (*(cur+1) == '*') ||
- (*(cur+1) == '/') ) return TRUE;
+ (*(cur+1) == '/') ) return true;
else
{
++cur;
}
}
- return FALSE;
+ return false;
} while(1);
}
}
if ( cur >= _gSrcEnd )
-
- return FALSE;
+ return false;
else
- return TRUE;
+ return true;
}
static inline void skip_preprocessor_dir( char*& cur )
do
{
if ( *(tok1++) != *(tok2++) )
- return FALSE;
+ return false;
--len;
} while ( --len );
- return TRUE;
+ return true;
}
static inline bool cmp_tokens_fast( char* tok1, char* tok2, size_t len )
do
{
if ( *(tok1++) != *(tok2++) )
- return FALSE;
+ return false;
} while ( --len );
- return TRUE;
+ return true;
}
static inline void skip_tempalate_statement( char*& cur )
while( *cur != '{' && cur < _gSrcEnd )
{
skip_token( cur );
- if ( !get_next_token( cur ) ) return FALSE;
+ if ( !get_next_token( cur ) ) return false;
}
while( *cur != '}' && cur < _gSrcEnd )
{
skip_token( cur );
- if ( !get_next_token( cur ) ) return FALSE;
+ if ( !get_next_token( cur ) ) return false;
}
++cur;
- return TRUE;
+ return true;
}
static bool is_class_token( char*& cur )
return cmp_tokens_fast( cur, "union", 5 );
- return FALSE;
+ return false;
}
inline static bool is_forward_decl( char* cur )
{
switch( *cur )
{
- case ':' : return FALSE;
- case '{' : return FALSE;
- case '(' : return FALSE;
+ case ':' : return false;
+ case '{' : return false;
+ case '(' : return false;
- case ';' : return TRUE;
+ case ';' : return true;
default : break;
};
} while (cur < _gSrcEnd); // prevent running out of bounds
- return FALSE;
+ return false;
}
inline static bool is_function( char* cur, bool& isAMacro )
{
- isAMacro = FALSE;
+ isAMacro = false;
int tmpLnNo;
store_line_no( tmpLnNo );
if ( cur > eol )
{
- isAMacro = TRUE;
+ isAMacro = true;
restore_line_no( tmpLnNo );
- return TRUE;
+ return true;
}
// it's not a macro, go to the begining of arg. list
if ( *cur == '(' )
{
restore_line_no( tmpLnNo );
- return TRUE;
+ return true;
}
// end of statement found without any brackets in it
if ( *cur == ';' )
{
restore_line_no( tmpLnNo );
- return FALSE;
+ return false;
}
++cur;
isAMacro = 1;
restore_line_no( tmpLnNo );
- return FALSE;
+ return false;
}
// upon return the cursor is positioned after the
) == 0
)
{
- int o = 0;
- ++o;
+ // int o = 0;
+ // ++o;
}
switch (*cur)
continue;
}
- bool isAMacro = 0;
+ bool isAMacro = false;
if ( is_function( cur, isAMacro ) )
{
int tmpLnNo;
store_line_no( tmpLnNo );
+ wxUnusedVar( tmpLnNo );
- isAMacro = FALSE;
+ isAMacro = false;
if ( !ParseNameAndRetVal( cur, isAMacro ) )
{
if ( i == 0 )
- pComment->mStartsPar = TRUE;
+ pComment->mStartsPar = true;
else
if ( pComment->mIsMultiline )
- pComment->mStartsPar = TRUE;
+ pComment->mStartsPar = true;
else
{
// find out wheather there is a new-line
if ( prevLine >= prevComEnd )
- pComment->mStartsPar = TRUE;
+ pComment->mStartsPar = true;
else
- pComment->mStartsPar = FALSE;
+ pComment->mStartsPar = false;
}
prevComEnd = set_comment_text( pComment->mText, start );
bool CJSourceParser::ParseNameAndRetVal( char*& cur, bool& isAMacro )
{
- isAMacro = FALSE;
+ isAMacro = false;
// FOR NOW:: all functions in the global
// scope are ignored
isVirtual = true;
skip_token( cur );
- if ( !get_next_token( cur ) ) return FALSE;
+ if ( !get_next_token( cur ) ) return false;
}
char* bracketPos = cur;
mpPlugin->ParseContext( _gSrcStart, cur, _gSrcEnd, mpCurCtx );
- isAMacro = TRUE;
+ isAMacro = true;
- return FALSE;
+ return false;
}
}
// now, enter operation context
mpCurCtx = pOp;
- return TRUE;
+ return true;
}
bool CJSourceParser::ParseArguments( char*& cur )
get_next_token( cur );
- bool first_blk = 1;
+ bool first_blk = true;
while( *cur != ')' && *cur != ',' )
{
// if only one block enclosed, than it's probably
// some macro, there should be at least two blocks,
// one for argument type and another for it's identifier
- return FALSE;
+ return false;
}
if ( blocksSkipped == 0 )
int tmpLnNo;
store_line_no( tmpLnNo );
+ bool result = true;
+
do
{
if ( *tok == '{' || *tok == ';' )
{
restore_line_no(tmpLnNo);
- return TRUE;
+ break;
}
// check for unexpected tokens
if ( *tok == '=' || *tok == '0' )
{
skip_token(tok);
- if ( !get_next_token(tok) ) return FALSE;
+ if ( !get_next_token(tok) ) return false;
continue;
}
- if ( *tok == '}' ) return FALSE;
+ if ( *tok == '}' ) return false;
// if initialization list found
if ( *tok == ':' )
{
restore_line_no(tmpLnNo);
- return TRUE;
+ break;
}
if ( cmp_tokens_fast( tok, "const", 5 ) )
((spOperation*)mpCurCtx)->mIsConstant = true;
skip_token(tok);
- if ( !get_next_token(tok) ) return FALSE;
+ if ( !get_next_token(tok) ) return false;
continue;
}
- if ( CheckVisibilty( tok ) ) return FALSE;
+ if ( CheckVisibilty( tok ) ) return false;
// if next context found
- if ( is_keyword( tok ) ) return FALSE;
+ if ( is_keyword( tok ) ) return false;
skip_token(tok);
- if ( !get_next_token(tok) ) return FALSE;
+ if ( !get_next_token(tok) ) return false;
} while(1);
- return TRUE;
+ return result;
}
void CJSourceParser::ParseMemberVar( char*& cur )
{
MMemberListT& members = mpCurCtx->GetMembers();
- bool firstMember = 1;
-
- size_t first = 0;
+ bool firstMember = true;
string type;
if ( firstMember )
{
firstMember = 0;
- first = members.size() - 1;;
}
skip_token_back( cur );
} while(1);
- first = 0;
+ size_t first = 0;
// set up types for all collected (same-type) attributes;
while ( first != members.size() - 1 )
{
// FIXME:: check for comments and quoted stirngs here
- bool hasDefinition = FALSE;
+ bool hasDefinition = false;
while( *cur != '{' && *cur != ';' )
{
}
else
{
- hasDefinition = TRUE;
+ hasDefinition = true;
skip_scope_block( cur ); // skip the whole imp.
}
if ( cmp_tokens_fast( cur, "public:", len ) )
{
mCurVis = SP_VIS_PUBLIC;
- return TRUE;
+ return true;
}
if ( cmp_tokens_fast( cur, "protected:", len ) )
{
mCurVis = SP_VIS_PROTECTED;
- return TRUE;
+ return true;
}
if ( cmp_tokens_fast( cur, "private:", len ) )
{
mCurVis = SP_VIS_PRIVATE;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void CJSourceParser::AddClassNode( char*& cur )