Patch: lex rules for ICE

Alex Brooks <[email protected]>
Newsgroups gmane.text.doxygen.devel
Message-ID <[email protected]>
Hi,

I submitted this patch last week some time, but it didn't appear to get 
through.  Apologies if it arrives twice.

The patch is a modification to scanner to let it parse .ice files.  ICE is a 
communications engine similar to CORBA, and .ice files are like .idl files
(See http://www.zeroc.com for details).

We've been using the updated doxygen version (with this patch) for about a 
week now, for both ICE and C++ code, and everything seems OK.


Cheers,

Alex
ice_rules.patch (text/x-diff, 3 KB)
--- doxygen/src/scanner.l	2005-10-12 13:59:12.000000000 +1000
+++ new/src/scanner.l	2005-10-21 04:02:32.411960720 +1000
@@ -111,6 +111,7 @@
 static bool             insideCS = FALSE;		//!< processing C# code?
 static bool             insideD = FALSE;		//!< processing D code?
 static bool             insidePHP = FALSE;		//!< processing PHP code?
+static bool             insideICE = FALSE;		//!< processing ICE code?
 static bool             insideCppQuote = FALSE;
 static bool             insideObjC = FALSE;             //!< processing Objective C code?
 static bool             insideProtocolList = FALSE;
@@ -321,6 +322,7 @@
   insideD    = fileName.right(2)==".d"; // for normal keywords add colon
   insidePHP  = fileName.right(4)==".php" || fileName.right(5)==".php4" || 
                fileName.right(4)==".inc" || fileName.right(6)==".phtml";
+  insideICE  = fileName.right(4)==".ice";
   insideObjC = fileName.right(2)==".m" || fileName.right(2)==".M" ||
                fileName.right(3)==".mm";
   if ( insidePHP )
@@ -328,8 +330,8 @@
     useOverrideCommands = TRUE;
   }
   //printf("setContext(%s) insideIDL=%d insideJava=%d insideCS=%d "
-  //       "insideD=%d insidePHP=%d insideObjC=%d\n",
-  //       yyFileName.data(),insideIDL,insideJava,insideCS,insideD,insidePHP,insideObjC
+  //       "insideD=%d insidePHP=%d insideObjC=%d\n insideICE=%d\n",
+  //       yyFileName.data(),insideIDL,insideJava,insideCS,insideD,insidePHP,insideObjC,insideICE
   //	);
 }
 
@@ -1051,7 +1053,7 @@
 					}
 <FindMembers>{B}*"module"{BN}+		{ 
 					  lineCount();
-                                          if (insideIDL)
+                                          if (insideIDL || insideICE)
 					  {
   					    isTypedef=FALSE;
 					    current->section = Entry::NAMESPACE_SEC;
@@ -1092,7 +1094,7 @@
 					}
 <FindMembers>{B}*((("disp")?"interface")|"valuetype"){BN}+ 	{ // M$/Corba IDL interface
 					  lineCount();
-                                          if (insideIDL || insideJava || insideCS || insideD || insidePHP)
+                                          if (insideIDL || insideJava || insideCS || insideD || insidePHP || insideICE)
 					  {
   					    isTypedef=FALSE;
 					    current->section = Entry::INTERFACE_SEC;
@@ -3570,7 +3572,9 @@
 					    roundCount=0;
 					    BEGIN(SkipUnionSwitch);
 					  }
-					  else if ((insideJava || insidePHP) && (strcmp(yytext,"implements")==0 || strcmp(yytext,"extends")==0))
+					  else if ((insideJava || insidePHP) && 
+                                                   (strcmp(yytext,"implements")==0 || strcmp(yytext,"extends")==0) ||
+                                                   (insideICE && strcmp(yytext,"extends")==0))
 					  {
   					    current->type.resize(0);
 					    baseProt=Public;
@@ -4505,6 +4509,7 @@
 	if (
 	    ce->fileName.right(4)==".php" ||
 	    ce->fileName.right(4)==".inc" ||
+	    ce->fileName.right(4)==".ice" ||
 	    ce->fileName.right(2)==".d"
 	   )
           current->protection = protection = Public ;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.