if_diff/src/idfSymbol.cxx
//============================================================================
// Analyze "name" for the syntax used for local variables.
// Set localName to NULL if and only if the '@' syntax was not used.
//============================================================================
Analyze "name" for the syntax used for local variables.
Set localName to NULL if and only if the '@' syntax was not used.
Analyze " name " for the syntax used for local variables . Set localName to NULL if and only if the ' @ ' syntax was not used .
void idfSymbol::setLocalName()
{
  localName = NULL;
  if (name != NULL) {
    char *at = strchr(name, '@');
    if (at != NULL) {
      char *end = trailing_white_space((char *)name, at);
      localName = char_array_dup(name, end - name);
      at = leading_white_space(at);
      char *brace = strchr(at, '{');
      end = (brace != NULL) ? trailing_white_space(at, brace)
                     	    : strchr(at, '\0');
      definingFunction = char_array_dup(at, end - at);
      hasBlockId = false;
      blockId = 0;
      if (brace != NULL) {
      	char *rbrace = strrchr(brace, '}');
      	if (rbrace != NULL) {
      	  unsigned int i;
      	  int n = sscanf(brace, "{%u}", &i);
      	  if (n == 1) {
      	    hasBlockId = true;
      	    blockId = i;
      	  }
      	}
      }
    }
  }
}
void idfSymbol :: setLocalName ( ) { localName = NULL ; if ( name != NULL ) { char * at = strchr ( name , ' ' ) ; if ( at != NULL ) { char * end = trailing_white_space ( ( char * ) name , at ) ; localName = char_array_dup ( name , end - name ) ; at = leading_white_space ( at ) ; char * brace = strchr ( at , ' ' ) ; end = ( brace != NULL ) ? trailing_white_space ( at , brace ) : strchr ( at , ' \0 ' ) ; definingFunction = char_array_dup ( at , end - at ) ; hasBlockId = false ; blockId = 0 ; if ( brace != NULL ) { char * rbrace = strrchr ( brace , ' ' ) ; if ( rbrace != NULL ) { unsigned int i ; int n = sscanf ( brace , " " , & i ) ; if ( n == 1 ) { hasBlockId = true ; blockId = i ; } } } } } }
Analyze "name" for the syntax used for local variables.
Analyze " name " for the syntax used for local variables .
// Allocate and set localName. // Find the function name. // Find the block id.