summaryrefslogtreecommitdiffstats
path: root/src/scanner.l
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2011-08-14 13:56:38 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2011-08-14 13:56:38 (GMT)
commit9be758009e1a4c616377dc33ccf1e55dd8b04d9b (patch)
tree3138a0d18d53a00498b4cad59f934a4e64762cf8 /src/scanner.l
parent64f0c97c3adaa28edf6f1da3264621a18c1d1adb (diff)
downloadDoxygen-9be758009e1a4c616377dc33ccf1e55dd8b04d9b.zip
Doxygen-9be758009e1a4c616377dc33ccf1e55dd8b04d9b.tar.gz
Doxygen-9be758009e1a4c616377dc33ccf1e55dd8b04d9b.tar.bz2
Release-1.7.5
Diffstat (limited to 'src/scanner.l')
-rw-r--r--src/scanner.l59
1 files changed, 41 insertions, 18 deletions
diff --git a/src/scanner.l b/src/scanner.l
index 78a9eaf..cf07d47 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -977,6 +977,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
<CliPropertyIndex>. {
current->name+=yytext;
}
+ /*
<FindMembers>{B}*"property"{BN}+ {
if (!current->type.isEmpty())
{
@@ -988,6 +989,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
lineCount();
}
}
+ */
<FindMembers>{B}*"@private"{BN}+ {
current->protection = protection = Private ;
current->mtype = mtype = Method;
@@ -1211,6 +1213,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
}
<PackageName>{ID}(("."|"\\"){ID})* {
isTypedef=FALSE;
+ //printf("Found namespace %s lang=%d\n",yytext,current->lang);
current->name = yytext;
current->name = substitute(current->name,".","::");
current->name = substitute(current->name,"\\","::");
@@ -1663,40 +1666,56 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
<NSAliasArg>";" {
BEGIN( FindMembers );
}
-<PHPUse>({ID}{BN}*"\\"{BN}*)*{ID} {
+<PHPUse>({ID}{BN}*"\\"{BN}*)*{ID}/{BN}+"as" {
lineCount();
aliasName=yytext;
- //current->fileName = yyFileName;
- //current->section=Entry::USINGDIR_SEC;
- //current_root->addSubEntry(current);
- //current = new Entry;
- //initEntry();
BEGIN(PHPUseAs);
}
+<PHPUse>({ID}{BN}*"\\"{BN}*)*{ID} {
+ lineCount();
+ current->name=removeRedundantWhiteSpace(substitute(yytext,"\\","::"));
+ //printf("PHP: adding use relation: %s\n",current->name.data());
+ current->fileName = yyFileName;
+ current->section=Entry::USINGDIR_SEC;
+ current_root->addSubEntry(current);
+ current = new Entry;
+ initEntry();
+ aliasName.resize(0);
+ }
<PHPUseAs>{BN}+"as"{BN}+ {
lineCount();
}
<PHPUseAs>{ID} {
+ //printf("PHP: adding use as relation: %s->%s\n",yytext,aliasName.data());
Doxygen::namespaceAliasDict.insert(yytext,
new QCString(removeRedundantWhiteSpace(
substitute(aliasName,"\\","::"))));
aliasName.resize(0);
}
-<PHPUseAs>[,;] {
+<PHPUse,PHPUseAs>[,;] {
+ /*
if (!aliasName.isEmpty())
{
int i=aliasName.findRev('\\');
- QCString an = removeRedundantWhiteSpace(
+ if (i!=-1)
+ {
+ QCString an = removeRedundantWhiteSpace(
substitute(aliasName,"\\","::"));
- Doxygen::namespaceAliasDict.insert(aliasName.mid(i+1),
- new QCString(an));
- current->name = an;
- current->fileName = yyFileName;
- current->section=Entry::USINGDECL_SEC;
- current_root->addSubEntry(current);
- current = new Entry ;
- initEntry();
+ printf("PHP: adding use relation: %s->%s\n",aliasName.mid(i+1).data(),an.data());
+ Doxygen::namespaceAliasDict.insert(aliasName.mid(i+1),
+ new QCString(an));
+ current->name = an;
+ current->fileName = yyFileName;
+ current->section=Entry::USINGDECL_SEC;
+ current_root->addSubEntry(current);
+ current = new Entry ;
+ initEntry();
+ }
+ else if (i==0)
+ {
+ }
}
+ */
if (*yytext==',')
{
BEGIN(PHPUse);
@@ -3050,6 +3069,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
else // probably a redundant ,
{
current->reset();
+ initEntry();
}
}
<FindFields>"[" { // attribute list in IDL
@@ -3287,7 +3307,6 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
BEGIN(FindMembers);
}
<MemberSpec>[,;] {
- //printf("current->name=`%s' msName=`%s'\n",current->name.data(),msName.data());
if (msName.isEmpty() && !current->name.isEmpty())
{
// see if the compound does not have a name or is inside another
@@ -3417,6 +3436,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
current->doc.resize(0);
current->brief.resize(0);
}
+
}
<MemberSpec>"=" {
lastInitializerContext=YY_START;
@@ -4557,6 +4577,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
<CompoundName>{SCOPENAME}{BN}*";" { // forward declaration
unput(';');
current->reset();
+ initEntry();
if (isTypedef) // typedef of a class, put typedef keyword back
{
current->type.prepend("typedef");
@@ -4575,6 +4596,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
<CompoundName>{SCOPENAME}/{BN}*"," { // multiple forward declarations on one line
// e.g. @protocol A,B;
current->reset();
+ initEntry();
}
<CompoundName>{SCOPENAME} {
current->name = yytext ;
@@ -5729,7 +5751,7 @@ static void parseCompounds(Entry *rt)
//current->reset();
if (current) delete current;
current = new Entry;
- current->lang = language;
+ initEntry();
gstat = FALSE;
int ni=ce->name.findRev("::"); if (ni==-1) ni=0; else ni+=2;
// set default protection based on the compound type
@@ -5846,6 +5868,7 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt)
current = new Entry;
}
current->reset();
+ initEntry();
scanYYrestart( scanYYin );
if ( insidePHP )
{