📄 tools.htm
字号:
while ( 1 ) { if ( p[ 0 ] == 0 ) { i = 0; while ( i <= strlen( tag_name() ) ) { p[ i ] = tag_name()[ i ]; i++; } break; } else { p = p + strlen( p ) +1; } } } } } if ( keyword( "class" ) ) { if ( strcmp( prev_token(), "<" ) != 0 ) { inClassHead = TRUE; } } if ( op_colon_1 ) { if ( inClassHead ) { inBase = TRUE; } } if ( op_separator ) { if ( inBase ) { if ( strcmp( prev_token(), ">" ) != 0 ) { isBaseClass = TRUE; } } } if ( op_open_angle ) { if ( inBase ) { if ( angleLevel == 0 ) { isBaseClass = TRUE; } angleLevel++; } } if ( op_close_angle ) { if ( inBase ) { angleLevel--; if ( angleLevel == 0 ) { isBaseClass = FALSE; } } } if ( isBaseClass ) { p = tagList; while ( p[ 0 ] != 0 ) { if (strcmp( p, prev_token() ) == 0 ) { break; } else { p = p + strlen( p ) + 1; } } if ( p[ 0 ] == 0 ) { warn( 1401, "The destructor of class %s should be declared as virtual.", tag_name() ); } } if ( tag_begin ) { inBase = FALSE; inClassHead = FALSE; }HP's CodeAdvisor uses C++ as an extension language. New constraints are implemented via classes inheriting from the predefined Rule class. These classes are then compiled and linked to a runtime library. Here is our implementation of Rule 10: class Rule_VirtDtorInBaseClass : public Rule { public: virtual int kindMask() const; virtual Language langMask() const; void check(SymbolTable *, const Symbol virtual const char *errorMess() const; virtual const char *name() const; }; // This rule is invoked for all "Tag" objects. Tags include all // compound objects, such as Classes, Templates, Structs, Unions, and Enums. // Can't specify a kindMask() of KIND_CLASS, since check() is invoked // only on Symbol objects. Class is not a Symbol; Tag is. int Rule_VirtDtorInBaseClass::kindMask() const { return 1 KIND_TAG; } // RETURNS A MASK OF THE LANGUAGE(S) THIS RULE APPLIES TO. LANGUAGE RULE_VIRTDTORINBASECLASS::LANGMASK() CONST { RETURN LANGUAGE_CPP; } // FIND ALL BASE CLASSES NOT DECLARING A VIRTUAL DESTRUCTOR. VOID RULE_VIRTDTORINBASECLASS::CHECK( SYMBOLTABLE *, CONST SYMBOL {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -