summaryrefslogtreecommitdiffstats
path: root/src/code.l
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2008-06-26 19:24:36 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2008-06-26 19:24:36 (GMT)
commit039f53bb7a3f1c3dfdf03f120437f2daef454fb3 (patch)
treecc6b9b1f467451deab5096afece76012eec030b3 /src/code.l
parent52629ec8265ab9f6250ec9cd4bba55932e680b9d (diff)
downloadDoxygen-039f53bb7a3f1c3dfdf03f120437f2daef454fb3.zip
Doxygen-039f53bb7a3f1c3dfdf03f120437f2daef454fb3.tar.gz
Doxygen-039f53bb7a3f1c3dfdf03f120437f2daef454fb3.tar.bz2
Release-1.5.6-20080626
Diffstat (limited to 'src/code.l')
-rw-r--r--src/code.l104
1 files changed, 53 insertions, 51 deletions
diff --git a/src/code.l b/src/code.l
index 01e504e..fde0d82 100644
--- a/src/code.l
+++ b/src/code.l
@@ -1285,69 +1285,71 @@ static void startFontClass(const char *s)
static void writeObjCMethodCall(ObjCCallCtx *ctx)
{
if (ctx==0) return;
- if (ctx->methodName.isEmpty()) return;
- const char *p = ctx->format.data();
- //printf("writeObjCMethodCall(%s) obj=%s method=%s\n",
- // ctx->format.data(),ctx->objectTypeOrName.data(),ctx->methodName.data());
char c;
- if (!ctx->objectTypeOrName.isEmpty() && ctx->objectTypeOrName.at(0)!='$')
+ const char *p = ctx->format.data();
+ if (!ctx->methodName.isEmpty())
{
- //printf("Looking for object=%s method=%s\n",ctx->objectTypeOrName.data(),
- // ctx->methodName.data());
- ClassDef *cd = g_theVarContext.findVariable(ctx->objectTypeOrName);
- if (cd==0) // not a local variable
+ //printf("writeObjCMethodCall(%s) obj=%s method=%s\n",
+ // ctx->format.data(),ctx->objectTypeOrName.data(),ctx->methodName.data());
+ if (!ctx->objectTypeOrName.isEmpty() && ctx->objectTypeOrName.at(0)!='$')
{
- if (ctx->objectTypeOrName=="self")
+ //printf("Looking for object=%s method=%s\n",ctx->objectTypeOrName.data(),
+ // ctx->methodName.data());
+ ClassDef *cd = g_theVarContext.findVariable(ctx->objectTypeOrName);
+ if (cd==0) // not a local variable
{
- if (g_currentDefinition &&
- g_currentDefinition->definitionType()==Definition::TypeClass)
+ if (ctx->objectTypeOrName=="self")
{
- ctx->objectType = (ClassDef *)g_currentDefinition;
+ if (g_currentDefinition &&
+ g_currentDefinition->definitionType()==Definition::TypeClass)
+ {
+ ctx->objectType = (ClassDef *)g_currentDefinition;
+ }
}
- }
- else
- {
- ctx->objectType = getResolvedClass(
- g_currentDefinition,
- g_sourceFileDef,
- ctx->objectTypeOrName,
- &ctx->method);
- }
- //printf(" object is class? %p\n",ctx->objectType);
- if (ctx->objectType) // found class
- {
- ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
- //printf(" yes->method=%s\n",ctx->method?ctx->method->name().data():"<none>");
- }
- else if (ctx->method==0) // search for class variable with the same name
- {
- //printf(" no\n");
- //printf("g_currentDefinition=%p\n",g_currentDefinition);
- if (g_currentDefinition &&
- g_currentDefinition->definitionType()==Definition::TypeClass)
+ else
{
- ctx->objectVar = ((ClassDef *)g_currentDefinition)->getMemberByName(ctx->objectTypeOrName);
- //printf(" ctx->objectVar=%p\n",ctx->objectVar);
- if (ctx->objectVar)
+ ctx->objectType = getResolvedClass(
+ g_currentDefinition,
+ g_sourceFileDef,
+ ctx->objectTypeOrName,
+ &ctx->method);
+ }
+ //printf(" object is class? %p\n",ctx->objectType);
+ if (ctx->objectType) // found class
+ {
+ ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
+ //printf(" yes->method=%s\n",ctx->method?ctx->method->name().data():"<none>");
+ }
+ else if (ctx->method==0) // search for class variable with the same name
+ {
+ //printf(" no\n");
+ //printf("g_currentDefinition=%p\n",g_currentDefinition);
+ if (g_currentDefinition &&
+ g_currentDefinition->definitionType()==Definition::TypeClass)
{
- ctx->objectType = stripClassName(ctx->objectVar->typeString());
- //printf(" ctx->objectType=%p\n",ctx->objectType);
- if (ctx->objectType)
+ ctx->objectVar = ((ClassDef *)g_currentDefinition)->getMemberByName(ctx->objectTypeOrName);
+ //printf(" ctx->objectVar=%p\n",ctx->objectVar);
+ if (ctx->objectVar)
{
- ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
- //printf(" ctx->method=%p\n",ctx->method);
+ ctx->objectType = stripClassName(ctx->objectVar->typeString());
+ //printf(" ctx->objectType=%p\n",ctx->objectType);
+ if (ctx->objectType)
+ {
+ ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
+ //printf(" ctx->method=%p\n",ctx->method);
+ }
}
}
}
}
- }
- else // local variable
- {
- //printf(" object is local variable\n");
- if (cd!=VariableContext::dummyContext)
+ else // local variable
{
- ctx->method = cd->getMemberByName(ctx->methodName);
- //printf(" class=%p method=%p\n",cd,ctx->method);
+ //printf(" object is local variable\n");
+ if (cd!=VariableContext::dummyContext)
+ {
+ ctx->method = cd->getMemberByName(ctx->methodName);
+ //printf(" class=%p method=%p\n",cd,ctx->method);
+ }
}
}
}
@@ -1653,8 +1655,8 @@ SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID})
TEMPLIST "<"[^\"\}\{\(\)\/\n\>]*">"
SCOPETNAME ((({ID}{TEMPLIST}?){BN}*"::"{BN}*)*)((~{BN}*)?{ID})
SCOPEPREFIX ({ID}{TEMPLIST}?{BN}*"::"{BN}*)+
-KEYWORD_OBJC ("@public"|"@private"|"@protected"|"@class"|"@implementation"|"@interface"|"@end"|"@selector"|"@protocol")
-KEYWORD ("add"|"asm"|"__assume"|"auto"|"class"|"const"|"delete"|"enum"|"explicit"|"extern"|"false"|"friend"|"gcnew"|"gcroot"|"get"|"inline"|"internal"|"mutable"|"namespace"|"new"|"nullptr"|"override"|"operator"|"pin_ptr"|"private"|"protected"|"public"|"raise"|"register"|"remove"|"self"|"set"|"sizeof"|"static"|"struct"|"__super"|"template"|"generic"|"this"|"true"|"typedef"|"typeid"|"typename"|"union"|"using"|"virtual"|"volatile"|"abstract"|"final"|"import"|"synchronized"|"transient"|KEYWORD_OBJC)
+KEYWORD_OBJC ("@public"|"@private"|"@protected"|"@class"|"@implementation"|"@interface"|"@end"|"@selector"|"@protocol"|"@optional"|"@required"|"@throw")
+KEYWORD ("add"|"asm"|"__assume"|"auto"|"class"|"const"|"delete"|"enum"|"explicit"|"extern"|"false"|"friend"|"gcnew"|"gcroot"|"get"|"inline"|"internal"|"mutable"|"namespace"|"new"|"nullptr"|"override"|"operator"|"pin_ptr"|"private"|"protected"|"public"|"raise"|"register"|"remove"|"self"|"set"|"sizeof"|"static"|"struct"|"__super"|"template"|"generic"|"this"|"true"|"typedef"|"typeid"|"typename"|"union"|"using"|"virtual"|"volatile"|"abstract"|"final"|"import"|"synchronized"|"transient"|{KEYWORD_OBJC})
FLOWKW ("break"|"case"|"catch"|"continue"|"default"|"do"|"else"|"finally"|"for"|"foreach"|"for each"|"goto"|"if"|"return"|"switch"|"throw"|"throws"|"try"|"while")
TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"object"|"short"|"signed"|"unsigned"|"void"|"wchar_t"|"size_t"|"boolean"|"id"|"SEL"|"string")
CASTKW ("const_cast"|"dynamic_cast"|"reinterpret_cast"|"static_cast")