Пример #1
0
const char *scopeSeparatorFor (langType lang, int kindIndex, int parentKindIndex)
{
	kindDefinition *kind = getLanguageKind (lang, kindIndex);
	scopeSeparator *table = kind->separators;

	/* If no table is given, use the default generic separator ".".
	   The exception is if a root separator is looked up. In this case,
	   return NULL to notify there is no root separator to the caller. */

	if (table == NULL)
	{
		if (parentKindIndex == KIND_GHOST_INDEX)
			return NULL;
		else
			return ".";
	}

	while (table - kind->separators < kind->separatorCount)
	{
		/* KIND_WILDCARD cannot be used as a key for finding
		   a root separator.*/
		if ( (table->parentKindIndex == KIND_WILDCARD_INDEX
		       && parentKindIndex != KIND_GHOST_INDEX)
		    || table->parentKindIndex == parentKindIndex)
			return table->separator;
		table++;
	}
	if (parentKindIndex == KIND_GHOST_INDEX)
		return NULL;
	else
		return ".";
}
Пример #2
0
extern void debugEntry (const tagEntryInfo *const tag)
{
	const char *const scope = tag->isFileScope ? "{fs}" : "";

	if (debug (DEBUG_PARSE))
	{
		langType lang = (tag->extensionFields.scopeLangType == LANG_AUTO)
			? tag->langType
			: tag->extensionFields.scopeLangType;
		kindDefinition *scopeKindDef = getLanguageKind(lang,
													   tag->extensionFields.scopeKindIndex);
		printf ("<#%s%s:%s", scope, getTagKindName(tag), tag->name);

		if (tag->extensionFields.scopeKindIndex != KIND_GHOST_INDEX  &&
				tag->extensionFields.scopeName != NULL)
			printf (" [%s:%s]", scopeKindDef->name,
					tag->extensionFields.scopeName);

		if (isFieldEnabled (FIELD_INHERITANCE) &&
				tag->extensionFields.inheritance != NULL)
			printf (" [inherits:%s]", tag->extensionFields.inheritance);

		if (isFieldEnabled (FIELD_FILE_SCOPE) &&
				tag->isFileScope && ! isInputHeaderFile ())
			printf (" [file:]");

		if (isFieldEnabled (FIELD_ACCESS) &&
				tag->extensionFields.access != NULL)
			printf (" [access:%s]", tag->extensionFields.access);

		if (isFieldEnabled (FIELD_IMPLEMENTATION) &&
				tag->extensionFields.implementation != NULL)
			printf (" [imp:%s]", tag->extensionFields.implementation);

		if (isFieldEnabled (FIELD_TYPE_REF) &&
				tag->extensionFields.typeRef [0] != NULL  &&
				tag->extensionFields.typeRef [1] != NULL)
			printf (" [%s:%s]", tag->extensionFields.typeRef [0],
					tag->extensionFields.typeRef [1]);

		printf ("#>");
		fflush (stdout);
	}
}
Пример #3
0
extern kindDefinition *getInputLanguageFileKind (void)
{
	return getLanguageKind (getInputLanguage (), KIND_FILE_INDEX);
}