
C:\tmp\doxygen-1.7.3>diff -i -u -b -B src/vhdlscanner.l addon/vhdlscanner.l  
--- src/vhdlscanner.l	2010-10-17 21:49:12.000000000 +0200
+++ addon/vhdlscanner.l	2011-02-24 15:24:12.000000000 +0100
@@ -84,7 +84,7 @@
 static bool             docBlockAutoBrief;
 static char             docBlockTerm;
 static int              iDocLine      = -1;
-
+static Entry   gBlock;
 //#define YY_A_INTERACTIVE 1
 #define YY_NEVER_INTERACTIVE 1
 //-----------------------------------------------------------------------------
@@ -95,6 +95,26 @@
 static void newEntry();
 static void initEntry(Entry *e);
 
+static void makeInline(QCString val)
+{
+  gBlock.section=Entry::VARIABLE_SEC;
+  gBlock.doc=val; 
+  gBlock.spec=VhdlDocGen::MISCELLANEOUS;
+  gBlock.fileName = yyFileName;
+  gBlock.endBodyLine=yyLineNr-1;
+   Entry *temp=new Entry(gBlock);
+ if(lastCompound)
+  lastCompound->addSubEntry(temp);
+ else if(lastEntity)
+  lastEntity->addSubEntry(temp);
+ else
+ {
+   temp->type="misc";
+   current_root->addSubEntry(temp);
+   }
+  gBlock.reset();
+}// makeInline
+
 static void addSubEntry(Entry* root, Entry* e)
 {
   if (e==0 || root==0) return;
@@ -900,6 +920,7 @@
 <ParseProcess>[^;()] {
   // eat process body
   lineCount();
+  addText(yytext,yyleng);
   BEGIN(ParseProcess);
 }
 
@@ -1098,37 +1119,8 @@
     functionEntry=0;
     //eFuncBody=new Entry;
     ::parseFunctionProto();
-#if 0
-
-    EntryListIterator eli(*eFuncBody->children());
-    Entry *rrt=eli.current();
-
-    if (current && (current->spec==VhdlDocGen::ARCHITECTURE && rrt))
-    {
-      Entry *ep=new Entry(*rrt);
-      addSubEntry(current,ep);
-      isBody=1;
-    }
-    if (rrt) 
-    {
-      Entry *ef=VhdlDocGen::findFunction(current_root,rrt);
-      if (ef) 
-      { 
-	ef->bodyLine=iFuncLine;
-	functionEntry=ef;
-      }
-      else if ((current->spec==VhdlDocGen::PACKAGE_BODY))//VhdlDocGen::Package_Body))
-      {
-	Entry *ep=new Entry(*rrt);
-	addSubEntry(current,ep);
-	ep->bodyLine=iFuncLine;
-	functionEntry = ep;
-      }
-    }
-    delete eFuncBody;
-    eFuncBody=0;
-#endif
   }
+ if(gBlock.startLine==0)// yyLineNr+1; 
   bufferClear();  
   BEGIN(ParseType);
 }
@@ -1316,11 +1308,6 @@
   }
 }
 
-<ParseType>{TEXTT} {
-  lineCount();
-  BEGIN(ParseType);
-}
-
 <ParseType>{BR}* {
   lineCount();
   addText(yytext,yyleng);
@@ -1348,6 +1335,7 @@
     //qq=qq.lower();
 
     current->name=qq;
+    qq=qq.lower();
     if (lastCompound)
     {
       if (lastCompound->spec==VhdlDocGen::PACKAGE)
@@ -1600,6 +1588,27 @@
   QCString qcs;
   getBufText(qcs,iTextCounter);
   VhdlDocGen::prepareComment(qcs);
+    int ii =qcs.find("\\code");
+   if(ii>0)
+   {
+   gBlock.reset();
+   int len=qcs.length();
+   QCString name=qcs.right(len-ii);// 
+   name=VhdlDocGen::getIndexWord(name.data(),1);
+    if(!name)
+         gBlock.name="misc"+ VhdlDocGen::getRecordNumber(); 
+    else
+        gBlock.name=name;
+   qcs=qcs.left(ii);
+  // qcs=qcs.stripWhiteSpace();
+   gBlock.startLine=yyLineNr+1;
+   gBlock.bodyLine=yyLineNr+1;
+   gBlock.brief+=qcs;
+    iTextCounter=0;
+   }
+ 
+
+if(ii==-1)
   handleCommentBlock(qcs,FALSE);
   bufferClear();
   unput(*yytext);
@@ -1609,10 +1618,18 @@
 <*>"--!"[^\n]* { // one line comment
   if (iDocLine==-1) iDocLine=yyLineNr;
   QCString qcs(yytext);
+   QCString val;
+   getBufText(val,iTextCounter);
   int j=qcs.find("--!");
   qcs=qcs.right(qcs.length()-3-j);
+   bool isEndCode=qcs.contains("\\endcode");
+  
+   if(isEndCode)
+    makeInline(val);
   //printf("--> handleCommentBlock line %d\n",yyLineNr);
   Entry* pTemp=getEntryAtLine(current_root,yyLineNr);
+ 
+ if(!isEndCode){
   if (pTemp)
   {
     pTemp->briefLine=yyLineNr;
@@ -1623,10 +1640,12 @@
   {
     handleCommentBlock(qcs,TRUE);
   }
-  //printf("--> end: handleCommentBlock line %d\n",yyLineNr);
-  bufferClear();
 } 
 
+bufferClear();
+}// one line
+
+
 <*>{COMMENT} {
 }
 

C:\tmp\doxygen-1.7.3>diff -i -u -b -B src/vhdldocgen.h addon/vhdldocgen.h  
--- src/vhdldocgen.h	2010-02-19 21:09:48.000000000 +0100
+++ addon/vhdldocgen.h	2011-02-24 15:37:32.000000000 +0100
@@ -75,7 +75,8 @@
       VFILE,   
       SHAREDVARIABLE,
       CONFIG,
-      ALIAS
+      ALIAS,
+      MISCELLANEOUS
     };
 
     VhdlDocGen();
@@ -137,7 +138,8 @@
                                      OutputList &ol);
 
     //static void writeVhdlComponentList(OutputList &ol,int type);
-
+     static bool isMisc(const MemberDef *mdef) 
+    { return mdef->getMemberSpecifiers()==VhdlDocGen::MISCELLANEOUS; }   
     static bool isConfig(const MemberDef *mdef) 
     { return mdef->getMemberSpecifiers()==VhdlDocGen::CONFIG; }
     static bool isAlias(const MemberDef *mdef) 
@@ -265,12 +267,15 @@
     static void startFonts(const QCString& q, const char *keyword,OutputList& ol);
     static bool isNumber(const QCString& s);
     static QCString getProtectionName(int prot);
+	static void writeSource(MemberDef *mdef,OutputList& ol,QCString &);
   private:
     static void getFuncParams(QList<Argument>&, const char* str);
     static bool compareArgList(ArgumentList*,ArgumentList*);
     static void writeVhdlLink(const ClassDef* cdd ,OutputList& ol,QCString& type,QCString& name,QCString& beh);
     static void findAllArchitectures(QList<QCString>& ql,const ClassDef *cd);
     static void writeStringLink(const MemberDef *mdef,QCString mem,OutputList& ol);
+     static void writeCodeFragment(MemberDef *mdef,OutputList& ol);
+
 };
 
 #endif

C:\tmp\doxygen-1.7.3>diff -i -u -b -B src/vhdldocgen.cpp addon/vhdldocgen.cpp  
--- src/vhdldocgen.cpp	2010-09-11 17:10:38.000000000 +0200
+++ addon/vhdldocgen.cpp	2011-02-24 15:55:30.000000000 +0100
@@ -42,7 +42,7 @@
 #include "definition.h"
 #include "searchindex.h"
 #include "outputlist.h"
-
+#include "parserintf.h"
 /* --------------------------------------------------------------- */
 
 //#define theTranslator_vhdlType theTranslator->trVhdlType
@@ -1211,6 +1211,7 @@
     case VhdlDocGen::COMPONENT_INST: return "Component Instantiation"; 
     case VhdlDocGen::ALIAS:          return "Alias";
     case VhdlDocGen::CONFIG:         return "Configuration";                                     
+    case VhdlDocGen::MISCELLANEOUS: return "Miscellanous";                                 
     default:                         return "";
   }
 } // convertType
@@ -1300,7 +1301,9 @@
       bool k=VhdlDocGen::isNumber(find); // is this a number
       if (k)
       {
+	   ol.docify(" ");
 	VhdlDocGen::startFonts(find,"vhdldigit",ol);
+         ol.docify(" ");
       }
       else if (j != 0 && ss)
       {
@@ -1579,6 +1582,7 @@
     const ArgumentList* al,
     bool /*type*/)
 {
+  //static bool optVerilog       = Config_getBool("OPTIMIZE_OUTPUT_VERILOG"); 
   if (al==0) return;
   bool sem=FALSE;    
   ol.enableAll();
@@ -1591,36 +1595,36 @@
     return;
   }
   ol.startParameterList(FALSE); 
+  //ol.startParameterName(false);
   Argument *arg;
   bool first=TRUE;
   for (;(arg=ali.current());++ali)
   { 
     ol.startParameterType(first,"");  
     if (first) ol.writeChar('(');
-    if (!VhdlDocGen::isProcess(md))
-    {
-      if (TRUE) //VhdlDocGen::isProcedure(md))
+      if (VhdlDocGen::isProcedure(md))
       {
 	startFonts(arg->defval,"keywordtype",ol);
 	ol.docify(" ");
       } 
-      // linkifyText(TextGeneratorOLImpl(ol),md->getClassDef(),md->getBodyDef(),md->name(),arg->type);
+      ol.endParameterType();
+     
+     ol.startParameterName(true);
       VhdlDocGen::writeFormatString(arg->name,ol,md);
       ol.docify(" ");
 
       if (VhdlDocGen::isProcedure(md))
 	startFonts(arg->attrib,"stringliteral",ol);
-      else
+	  else if(VhdlDocGen::isVhdlFunction(md))
 	startFonts(QCString("in"),"stringliteral",ol);
-    }
+    
+  
     ol.docify(" ");
     ol.disable(OutputGenerator::Man);
     ol.startEmphasis();
     ol.enable(OutputGenerator::Man);
     if (!VhdlDocGen::isProcess(md))
       startFonts(arg->type,"vhdlkeyword",ol);
-    else
-      startFonts(arg->name,"vhdlkeyword",ol);
     ol.disable(OutputGenerator::Man);
     ol.endEmphasis();
     ol.enable(OutputGenerator::Man);
@@ -1629,12 +1633,12 @@
       ol.docify(" , ");    
     else
       ol.docify(" ) ");
-
-    ol.endParameterName(FALSE,FALSE,FALSE); 
+  ol.endParameterName(TRUE,FALSE,FALSE);
 
     sem=TRUE;        
     first=FALSE;
   }
+  ol.endParameterList(); 
 
 } // writeDocFunProc
 
@@ -1738,6 +1743,7 @@
   VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,0,0,gd,theTranslator_vhdlType(VhdlDocGen::GROUP,FALSE),0,FALSE,VhdlDocGen::GROUP);
   VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,0,0,gd,theTranslator_vhdlType(VhdlDocGen::COMPONENT_INST,FALSE),0,FALSE,VhdlDocGen::COMPONENT_INST);
   VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,0,0,gd,theTranslator_vhdlType(VhdlDocGen::ALIAS,FALSE),0,FALSE,VhdlDocGen::ALIAS);
+   VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,0,0,gd,theTranslator_vhdlType(VhdlDocGen::MISCELLANEOUS),0,FALSE,VhdlDocGen::MISCELLANEOUS);
   
   // configurations must be added to global file definitions.  
   VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,0,fd,gd,theTranslator_vhdlType(VhdlDocGen::CONFIG,FALSE),0,FALSE,VhdlDocGen::CONFIG);
@@ -1762,6 +1768,10 @@
     {
       mdd->setMemberSpecifiers(VhdlDocGen::USE);        
     } 
+    else if (stricmp(mdd->typeString(),"misc")==0)
+    {
+		mdd->setMemberSpecifiers(VhdlDocGen::MISCELLANEOUS);        
+    } 
   }
 }
 
@@ -1778,6 +1788,8 @@
     MemberDef* memdef=VhdlDocGen::findMember(na,nn);
     if (memdef && memdef->isLinkable()) 
     { 
+        ol.docify(" ");
+      
       ol.startBold();
       //ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,mdef->typeString());                
        writeLink(memdef,ol);
@@ -1786,13 +1798,20 @@
     }
     else
     {
+     ol.docify(" ");
       QCString ttype=mdef->typeString();
       VhdlDocGen::formatString(ttype,ol,mdef);
+     ol.docify(" "); 
     }
     ol.docify(mdef->name());
     VhdlDocGen::writeFuncProcDocu(mdef,ol, mdef->argumentList().pointer());
   }
 
+  if(VhdlDocGen::isMisc(mdef))
+ {
+  writeLink(mdef,ol);
+ 	 return;
+ }
   if (mdef->isVariable())
   { 
     //ol.docify(mdef->name().data());
@@ -1941,12 +1960,18 @@
   if (gd) gd=0;
   switch(mm)
   {
+     case VhdlDocGen::MISCELLANEOUS:
+		 //  writeLink(mdef,ol);
+		   VhdlDocGen::writeCodeFragment(mdef,ol);
+		break;
     case VhdlDocGen::PROCEDURE:
     case VhdlDocGen::FUNCTION: 
       ol.startBold();
       VhdlDocGen::formatString(ltype,ol,mdef);
       ol.endBold();
       ol.insertMemberAlign();
+      ol.docify(" ");
+	
       writeLink(mdef,ol);
       if (alp!=0 && mm==VhdlDocGen::FUNCTION)
 	VhdlDocGen::writeFunctionProto(ol,alp.pointer(),mdef);
@@ -1986,11 +2011,11 @@
     case VhdlDocGen::GENERIC:
     case VhdlDocGen::PORT:
       writeLink(mdef,ol);
+     ol.docify(" ");
       ol.insertMemberAlign();
       if (mm==VhdlDocGen::GENERIC)
       {
 	ol.startBold();
-	ol.docify(" ");
 	VhdlDocGen::formatString(ltype,ol,mdef);
 	ol.endBold();
       }
@@ -2016,6 +2041,8 @@
     case VhdlDocGen::CONFIG:
       writeLink(mdef,ol);
       ol.insertMemberAlign();
+      ol.docify("  ");
+       
       ol.startBold();
       ol.docify(ltype);
       ol.endBold();
@@ -2070,6 +2097,7 @@
       break;
     case VhdlDocGen::RECORD:    
       writeLink(mdef,ol);
+	  ol.docify(" ");
       ol.startBold();
       if (ltype.isEmpty()) ol.docify("     : record");    
       ol.insertMemberAlign();
@@ -2080,6 +2108,7 @@
     case VhdlDocGen::UNITS:
       ol.startBold();
       writeLink(mdef,ol);
+	  ol.docify(" ");
       if (ltype.isEmpty()) ol.docify("     : unit");    
       ol.insertMemberAlign();
       if (!ltype.isEmpty())
@@ -2220,7 +2249,7 @@
 
   if (title) 
   {
-    ol.startMemberHeader(ml->listTypeAsString());
+    ol.startMemberHeader(title);
     ol.parseText(title);
     ol.endMemberHeader();
     ol.docify(" ");
@@ -2379,7 +2408,8 @@
     case VhdlDocGen::CONFIG:        
       if (sing) return "Configuration";       
       return "Configurations";
-      
+     case VhdlDocGen::MISCELLANEOUS:
+	  return "Miscellaneous";  
     default:                       
       return "Class";
   }
@@ -2478,3 +2508,71 @@
   VhdlDocGen::startFonts(mem,"vhdlchar",ol);    
 }// found component
 
+void VhdlDocGen::writeCodeFragment( MemberDef *mdef,OutputList& ol)
+{
+  //  Definition d=(Definition)mdef;
+//	QCString fdd=mdef->getDefFileExtension();
+//	QCString scope=mdef->getScopeString();
+	QCString codeFragment=mdef->documentation();
+	//FileDef *fd=mdef->getFileDef();
+	
+	int start=mdef->getStartBodyLine();
+	int end=mdef->getEndBodyLine();
+	QStringList qsl=QStringList::split("\n",codeFragment);
+
+    writeLink(mdef,ol);
+      ol.docify(" ");
+      ol.insertMemberAlign();
+	  int len= qsl.count();	
+  	 for(int j=0;j<len;j++)
+	 {
+		  QCString q=(QCString)qsl[j];
+           VhdlDocGen::writeFormatString(q,ol,mdef);
+		  ol.lineBreak(); 
+		  if(j==2) // only the first three lines are shown
+		  {
+		    q = "...";
+            VhdlDocGen::writeFormatString(q,ol,mdef);
+	        break;
+		  }
+	 }
+
+}
+
+ void VhdlDocGen::writeSource(MemberDef *mdef,OutputList& ol,QCString & cname)
+ {
+//  Definition d=(Definition)mdef;
+	QCString fdd=mdef->getDefFileExtension();
+	QCString scope=mdef->getScopeString();
+	QCString codeFragment=mdef->documentation();
+	FileDef *fd=mdef->getFileDef();
+	int start=mdef->getStartBodyLine();
+	int end=mdef->getEndBodyLine();
+	QStringList qsl=QStringList::split("\n",codeFragment);
+
+	ParserInterface *pIntf = Doxygen::parserManager->getParser(fdd.data());
+    pIntf->resetCodeParserState();
+
+	ol.startParagraph();
+      ol.startCodeFragment();
+      pIntf->parseCode(ol,               // codeOutIntf
+                       scope,        // scope
+                       codeFragment,     // input
+                       FALSE,            // isExample
+                       0,                // exampleName
+                       fd,  // fileDef
+                       start,      // startLine
+                       end,        // endLine
+                       TRUE,             // inlineFragment
+                       mdef,           // memberDef
+                       FALSE             // show line numbers
+                      );
+      ol.endCodeFragment();
+     ol.endParagraph();
+
+	 	 mdef->writeSourceDef(ol,cname);
+          mdef->writeSourceRefs(ol,cname);
+          mdef->writeSourceReffedBy(ol,cname);
+
+ 
+ }
\ No newline at end of file

C:\tmp\doxygen-1.7.3>diff -i -u -b -B src/memberdef.cpp addon/memberdef.cpp  
--- src/memberdef.cpp	2011-01-02 14:17:46.000000000 +0100
+++ addon/memberdef.cpp	2011-02-24 16:19:36.000000000 +0100
@@ -2059,7 +2059,14 @@
   if (!detailed.isEmpty() || 
       !inbodyDocumentation().isEmpty())
   { 
+	  // write vhdl inline code with or without option INLINE_SOURCE
+	  if(optVhdl && VhdlDocGen::isMisc(this)) {
+		VhdlDocGen::writeSource(this,ol,cname);
+		return;
+	  }
+	else
     ol.parseDoc(docFile(),docLine(),getOuterScope()?getOuterScope():container,this,detailed+"\n",TRUE,FALSE);
+   
     if (!inbodyDocumentation().isEmpty())
     {
       ol.startParagraph();
