⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 entry.cc

📁 Doc++,可以根据你的C/C++和java的源码文件中的注释行自动生成Html说明文件的工具
💻 CC
📖 第 1 页 / 共 3 页
字号:
	jlang->insert("IllegalThreadStateException");	jlang->insert("IndexOutOfBoundsException");	jlang->insert("InstantiationException");	jlang->insert("InterruptedException");	jlang->insert("NegativeArraySizeException");	jlang->insert("NoSuchFieldException");	jlang->insert("NoSuchMethodException");	jlang->insert("NullPointerException");	jlang->insert("NumberFormatException");	jlang->insert("RuntimeException");	jlang->insert("SecurityException");	jlang->insert("StringIndexOutOfBoundsException");	jlang->insert("UnsupportedOperationExceptio");	// Errors	jlang->insert("AbstractMethodError");	jlang->insert("ClassCircularityError");	jlang->insert("ClassFormatError");	jlang->insert("Error");	jlang->insert("ExceptionInInitializerError");	jlang->insert("IllegalAccessError");	jlang->insert("IncompatibleClassChangeError");	jlang->insert("InstantiationError");	jlang->insert("InternalError");	jlang->insert("LinkageError");	jlang->insert("NoClassDefFoundError");	jlang->insert("NoSuchFieldError");	jlang->insert("NoSuchMethodError");	jlang->insert("OutOfMemoryError");	jlang->insert("StackOverflowError");	jlang->insert("ThreadDeath");	jlang->insert("UnknownError");	jlang->insert("UnsatisfiedLinkError");	jlang->insert("UnsupportedClassVersionError");	jlang->insert("VerifyError");	jlang->insert("VirtualMachineError");	}    if(int *i = jlang->lookup(n.c_str()))	{	n.insert(0, "java.lang.");	Entry *tmp = findJavaClass(n, root);	if(tmp)	    tmp->section = *i;	return;	}    // Assume it's in the first completely imported package    for(i = 0; i < import.size(); i++)	{	ri = import[i]->rindex('*');	if(ri >= 0)	    {	    McString tmp(*(import[i]));	    tmp[ri] = '\0';	    n.insert(0, tmp.c_str());	    if(verb)		printf("  Guessed package: %s\n", n.c_str());	    return;	    }	}    // OK, assume that its the same package!    n.insert(0, thispkg.c_str());#ifdef DEBUG    if(verb)        printf("	-> `%s'\n", n.c_str());#endif}void Entry::makeFullName(){    fullName.clear();    if(parent != 0 && parent->fullName.length() > 0)	{	fullName = parent->fullName;	if(language == LANG_CXX)	    fullName += "::";	else    	    fullName += ".";	}    fullName += name;}void Entry::makeRefs(){    McString tmp;    int i;    if(language == LANG_JAVA)	{	if((section & CLASS_SEC) || (section & INTERFACE_SEC))	    {	    for(i = 0; i < implements.size(); i++)		{	    	tmp = *(implements[i]);		makeFullName(tmp);		addBaseClass(tmp.c_str(), PUBL);		}	    for(i = 0; i < extends.size(); i++)		{	        tmp = *(extends[i]);		makeFullName(tmp);	      		addBaseClass(tmp.c_str(), PUBL);		}	  	    }	}    else	if(language == LANG_PHP)	    {	    if((section & CLASS_SEC) || (section & INTERFACE_SEC))		for(i = 0; i < extends.size(); i++)		    {		    tmp = *(extends[i]);		    addBaseClass(tmp.c_str(), PUBL);		    }	  	    }	else	    if((section & CLASS_SEC) || (section & INTERFACE_SEC))		findBases();    for(i = 0; i < sublist.size(); ++i)	sublist[i]->makeRefs();}void Entry::makeSubList(){    Entry *tmp;    int i = 0;    sublist.clear();    for(tmp = sub; tmp; tmp = tmp->next)	++i;    if(i)	{	sublist.remax(i);	for(tmp = sub; tmp; tmp = tmp->next)	    {	    sublist.append((Entry *)0);	    for(i = sublist.size() - 1; i > 0; --i)		{		if(sublist[i - 1]->name <= tmp->name)		    break;		sublist[i] = sublist[i - 1];		}	    sublist[i] = tmp;	    }	/* the sublist items are sorted, but there seem to be rather	   lots of accesses just by traversing via tmp->next, so it's	   a quick fix to sort the tmp-entries themselves... */	/* now everything is sorted out, so let's comment out the code. This	   could be useful, for example, to make the `--sort' option usable	   for any output format, not only for HTML	*//*	for(i = 0; i < sublist.size() - 1; i++)	    sublist[i]->next = sublist[i + 1];	sublist[i]->next = (Entry *)0;	sub = sublist[0];*/	}}Entry *Entry::newSubEntry(){    Entry *newentry = new Entry;    addSubEntry(newentry);    return newentry;}void Entry::removeSub(Entry *e){    Entry *tmp;    int i;    for(i = 0; i < sublist.size(); i++)	if(sublist[i] == e)	    {	    sublist.remove(i);	    break;	    }    if(sub == e)	sub = e->next;    else	for(tmp = sub; tmp->next; tmp = tmp->next)	    if(tmp->next == e)		{		tmp->next = e->next;		break;		}}void setupLanguageHash(){    char *st, *tmp;    int lp;    // C/C++    st = cxxreserved;    tmp = st;    cxxtable = new McHashTable<const char *, char *>("");    while(*tmp)	if(*tmp == ' ')	    {	    *tmp = 0;	    cxxtable->insert(st, "1");	    st = ++tmp;	    }	else	    tmp++;    // Java    st = javareserved;    tmp = st;    javatable = new McHashTable<const char *, char *>("");    while(*tmp)	if(*tmp == ' ')	    {	    *tmp = 0;	    javatable->insert(st, "1");	    st = ++tmp;	    }	else	    tmp++;    // IDL    st = idlreserved;    tmp = st;    idltable = new McHashTable<const char *, char *>("");    while(*tmp)	if(*tmp == ' ')	    {	    *tmp = 0;	    idltable->insert(st, "1");	    st = ++tmp;	    }	else	    tmp++;    // PHP    st = phpreserved;    tmp = st;    phptable = new McHashTable<const char *, char *>("");    while(*tmp)	if(*tmp == ' ')	    {	    *tmp = 0;	    phptable->insert(st, "1");	    st = ++tmp;	    }	else	    tmp++;    // Setup cache as well    for(lp = 0; lp < MAX_CACHE; lp++)	{	cache_entry[lp] = 0;	cache_name[lp] = 0;	}}void makeSubLists(Entry *rt){    int i;    rt->makeSubList();    for(i = rt->sublist.size(); --i >= 0; )	makeSubLists(rt->sublist[i]);}Entry *findJavaPackage(McString n, Entry *root, Entry *p){    Entry *tmp, *newPackage, *result = 0;    int i = n.index('.'), j;    McString *pkgName;    if(!root || language == LANG_PHP)	return 0;    if(root->section == EMPTY_SEC)	{	p = root;	root = root->sub;	}    if((root->section != PACKAGE_SEC) && (root->section != EMPTY_SEC) &&	!(root->section & CLASS_SEC))	return 0;    if(i > -1)	{	for(tmp = root; tmp && !result; tmp = tmp->next)	    if((tmp->section == PACKAGE_SEC) || (tmp->section & CLASS_SEC))		{		i = tmp->name.length();		if(i <= n.length())		    {		    pkgName = new McString(n, 0, i);		    if(tmp->name == *pkgName)			{		    	n.remove(0, i + 1);		    	if(n.length() < 1)			    result = tmp;		    	else	    		    result = findJavaPackage(n, tmp->sub, tmp);			}		    }		}    	}    else	for(tmp = root; tmp && !result; tmp = tmp->next)	    if((tmp->section == PACKAGE_SEC) || (tmp->section & CLASS_SEC))		if(tmp->name == n)		    result = tmp;    if(!result)	{	i = -1;	do	    {	    j = n.index('.', i + 1);	    newPackage = p->newSubEntry();	    if(j != -1)		newPackage->name = *(new McString(n, 0, j));	    else		newPackage->name = n;	    newPackage->section = PACKAGE_SEC;	    newPackage->fromUnknownPackage = true;	    p = newPackage;	    n.remove(0, j + 1);	    }	while((j != -1) && (n.length() > 0));	result = newPackage;	}    return result;}Entry *findJavaClass(McString n, Entry *root){    Entry *pkg;    Entry *tmp;    Entry *result = NULL;    McString *package;    int i = n.rindex('.');    if(i != -1)	package = new McString(n, 0, i);    else	package = &n;    pkg = findJavaPackage(*package, root);    if(pkg != NULL)	{	if(i != -1)	    n.remove(0, i + 1);	for(tmp = pkg->sub; tmp && (result == NULL); tmp = tmp->next)	    if((tmp->section & CLASS_SEC) || (tmp->section & INTERFACE_SEC))		if(tmp->name == n)		    result = tmp;	if(!result)	    {	    result = pkg->newSubEntry();	    result->name = n;	    result->section = CLASS_SEC;	    result->makeFullName();	    result->fromUnknownPackage = true;	    }	}    return result;}bool isIt(const McString& n, const Entry* m){    if(worthDoing(m))	return (n == m->fullName);    return false;}static McString *get1RefName(McString& str, int start, int end){    McString *s = 0;    while((str[start] == ' ' || str[start] == '\t') && start < end)	start++;    while((str[end] == ' ' || str[end] == '\t' || str[end] == ',') && start < end)	end--;    if(start < end)	s = new McString(str, start, end);    return s;}bool equalTypes(McString const &a, McString const &b){    char const *type_a = (char const *)a;    char const *type_b = (char const *)b;    if(strncmp(type_a, "inline", 6) == 0)	type_a += 6;    if(strncmp(type_a, "static", 6) == 0)	type_a += 6;    if(strncmp(type_a, "virtual", 7) == 0)	type_a += 7;    if(strncmp(type_b, "inline", 6) == 0)	type_b += 6;    if(strncmp(type_b, "static", 6) == 0)	type_b += 6;    if(strncmp(type_b, "virtual", 7) == 0)	type_b += 7;    while(*type_a == ' ')	type_a++;    while(*type_b == ' ')	type_b++;    return(strcmp(type_a, type_b) == 0);}unsigned int countCommas(McString const &args){    unsigned int count = 0;    int i;    for(i = 0; i < args.size() && args[i] != 0; i++)	if(args[i] == ',')	    count++;    return count;}void separateArguments(char const *args, McDArray<McString *> &arg_list){    McString *s;    unsigned int start, end, i, j;    for(i = 0;; i++)	{	if(args[i] == 0)	    return;	if(args[i] == '(')	    break;	}    start = ++i;    for(;; i++)	{	if(args[i] == 0)	    return;	if(start != 0 && (args[i] == '=' || args[i] == ',' || args[i] == ')'))	    {	    while(args[start] == ' ')		start++;	    end = i - 1;	    // remove trailing spaces	    while(args[end] == ' ')		end--;	    // remove parameter name	    for(j = end; j >= start; j--)		if(args[j] == ' ')		    {		    end = j - 1;		    break;		    }	    if(start < end)		{		s = new McString(args, start, end - start + 1);		arg_list.append(s);		}	    start = 0;	    }	if(args[i] == ',')	    start = i + 1;	if(args[i] == ')')	    return;	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -