summaryrefslogtreecommitdiffstats
path: root/src/scanner.l
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2002-04-07 17:23:32 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2002-04-07 17:23:32 (GMT)
commit63962ead8b355c4c93d5e442ab0a26005e1b863f (patch)
treec38e1a43019260d8c13223b0bab64424c575dfcb /src/scanner.l
parentde20cde3d47c58a69c25afe75e4c476d61dbe631 (diff)
downloadDoxygen-63962ead8b355c4c93d5e442ab0a26005e1b863f.zip
Doxygen-63962ead8b355c4c93d5e442ab0a26005e1b863f.tar.gz
Doxygen-63962ead8b355c4c93d5e442ab0a26005e1b863f.tar.bz2
Release-1.2.15-20020407
Diffstat (limited to 'src/scanner.l')
-rw-r--r--src/scanner.l48
1 files changed, 41 insertions, 7 deletions
diff --git a/src/scanner.l b/src/scanner.l
index 049dc9b..be548f3 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -586,6 +586,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
%x NSAliasArg
%x PackageName
%x GetCallType
+%x JavaImport
%%
@@ -992,6 +993,29 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<NSAliasArg>";" {
BEGIN( FindMembers );
}
+<JavaImport>({ID}{BN}*"."{BN}*)+"*" { // package import => add as a using directive
+ lineCount();
+ QCString scope=yytext;
+ current->name=removeRedundantWhiteSpace(substitute(scope.left(scope.length()-2),".","::"));
+ current->fileName = yyFileName;
+ current->section=Entry::USINGDIR_SEC;
+ current_root->addSubEntry(current);
+ current = new Entry ;
+ initEntry();
+ BEGIN(Using);
+ }
+<JavaImport>({ID}{BN}*"."{BN}*)+{ID} { // class import => add as a using declaration
+ lineCount();
+ QCString scope=yytext;
+ current->name=removeRedundantWhiteSpace(substitute(scope,".","::"));
+ printf("import name = %s -> %s\n",yytext,current->name.data());
+ current->fileName = yyFileName;
+ current->section=Entry::USINGDECL_SEC;
+ current_root->addSubEntry(current);
+ current = new Entry ;
+ initEntry();
+ BEGIN(Using);
+ }
<FindMembers>"using"{BN}+ {
current->startLine=yyLineNr;
lineCount();
@@ -999,6 +1023,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
<Using>"namespace"{BN}+ { lineCount(); BEGIN(UsingDirective); }
<Using>{ID}{BN}*"::"{BN}*{ID}({BN}*"::"{BN}*{ID})* {
+ lineCount();
current->name=yytext;
current->fileName = yyFileName;
current->section=Entry::USINGDECL_SEC;
@@ -1109,7 +1134,10 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
else if ((insideIDL || insideJava) && yyleng==6 && strcmp(yytext,"import")==0)
{
- BEGIN(NextSemi);
+ if (insideIDL)
+ BEGIN(NextSemi);
+ else // insideJava
+ BEGIN(JavaImport);
}
else if (insideIDL && strcmp(yytext,"case")==0)
{
@@ -2108,7 +2136,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
}
<CopyArgComment>^{B}*"*"+/{BN}+
-<CopyArgComment>[^\n\*]+ { fullArgString+=yytext; }
+<CopyArgComment>[^\n\\\@\*]+ { fullArgString+=yytext; }
<CopyArgComment>"*/" { fullArgString+=yytext;
if (lastCopyArgChar!=0)
unput(lastCopyArgChar);
@@ -2120,7 +2148,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
unput(lastCopyArgChar);
BEGIN( ReadFuncArgType );
}
-<CopyArgCommentLine>[^\n]+ { fullArgString+=yytext; }
+<CopyArgCommentLine>[^\\\@\n]+ { fullArgString+=yytext; }
<CopyArgComment>\n { fullArgString+=*yytext; yyLineNr++; }
<CopyArgComment>. { fullArgString+=*yytext; }
<ReadTempArgs>"<" {
@@ -4092,7 +4120,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<Doc,ClassDoc,PageDoc,ExampleDoc,AfterDoc>"\\"[a-z_A-Z][a-z_A-Z0-9]*[\\] { // directory type of text
current->doc+=yytext;
}
-<Doc,ClassDoc,PageDoc,ExampleDoc,AfterDoc>{CMD}[a-z_A-Z][a-z_A-Z0-9]* {
+<Doc,ClassDoc,PageDoc,ExampleDoc,AfterDoc,CopyArgComment>{CMD}[a-z_A-Z][a-z_A-Z0-9]* {
QCString *pValue=Doxygen::aliasDict[yytext+1];
if (pValue)
{
@@ -4104,13 +4132,16 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
else
{
- current->doc+=yytext;
+ if (YY_START==CopyArgComment)
+ fullArgString+=yytext;
+ else
+ current->doc+=yytext;
}
}
<JavaDoc,LineDoc,ClassDocBrief,AfterDocBrief,AfterDocLine>"\\"[a-z_A-Z][a-z_A-Z0-9]*[\\] { // directory type of text
current->brief+=yytext;
}
-<JavaDoc,LineDoc,ClassDocBrief,AfterDocBrief,AfterDocLine>{CMD}[a-z_A-Z][a-z_A-Z0-9]* {
+<JavaDoc,LineDoc,ClassDocBrief,AfterDocBrief,AfterDocLine,CopyArgCommentLine>{CMD}[a-z_A-Z][a-z_A-Z0-9]* {
QCString *pValue=Doxygen::aliasDict[yytext+1];
if (pValue)
{
@@ -4122,7 +4153,10 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
else
{
- current->brief+=yytext;
+ if (YY_START==CopyArgCommentLine)
+ fullArgString+=yytext;
+ else
+ current->brief+=yytext;
}
}
<DefLineDoc,LineDoc,ClassDoc,PageDoc,ExampleDoc,Doc>"/*"|"//" { current->doc += yytext; }