Changeset 40


Ignore:
Timestamp:
10/10/11 00:04:41 (5 months ago)
Author:
sevo
Message:
- added support for nested classes
- updated .NET example
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/README.txt

    r39 r40  
    125125                  (in most cases your Project or Solution folder!) 
    126126 
     1275. open vbfilter.awk in your favorite editor and edit the options in 
     128   the Configuration section as you like. 
    127129 
    128 5. run Doc\make.bat or Doc/make.sh to generate the documentation. 
     1306. run Doc\make.bat or Doc/make.sh to generate the documentation. 
    129131 
    130132 
  • trunk/samples/DotNET/class_with_interface.vb

    r37 r40  
    7777    Implements ISample 
    7878 
     79        ''' <summary> 
     80        ''' nested class declared inside SampleClass 
     81        ''' </summary> 
     82    Public Class NestedClass 
     83        Inherits Object 
     84        Public someString As String    ' simple public string value 
     85 
     86            ''' <summary> 
     87            ''' some event 
     88            ''' </summary> 
     89            ''' <param name="Sender">sender of object type</param> 
     90            ''' <param name="args">event arguments</param> 
     91            ''' <remarks></remarks> 
     92            Public Event SomeEvent(ByVal Sender As Object, ByVal args As EventArgs) 
     93 
     94    End Class 
     95 
    7996    Private someInteger As Integer ' simple private integer value 
    8097    Public longArray() As Long     ' long array 
    8198    Public someString As String    ' simple public string value 
    82          
     99    Public nestedClassObject As New NestedClass  ' NestedClass instance 
    83100 
    84101    ''' <summary> 
     
    172189 
    173190    End Sub 
     191         
     192    ''' <summary> 
     193    ''' method handles event from nested class 
     194    ''' </summary> 
     195    Public Sub nestedClassObject_OnSomeEvent(ByVal Sender As Object, ByVal args As EventArgs) Handles nestedClassObject.SomeEvent 
     196 
     197    End Sub 
     198 
    174199 
    175200    ''' <summary> 
  • trunk/vbfilter.awk

    r39 r40  
    11#---------------------------------------------------------------------------- 
    2 # vbfilter.awk - doxygen VB .NET filter script - v2.4 
     2# vbfilter.awk - doxygen VB .NET filter script - v2.4.1 
    33# 
    44# Creation:     26.05.2010  Vsevolod Kukol 
     
    6464        fileHeader=0; 
    6565        fullLine=1; 
    66         insideClass=0; 
     66        classNestCounter=0; 
     67        className[1]=""; 
    6768        insideVB6Class=0; 
    6869        insideVB6ClassName=""; 
    6970        insideVB6Header=0; 
    70         insideSubClass=0; 
    7171        insideNamespace=0; 
    7272        insideComment=0; 
     
    299299                 
    300300                if (isInherited==1){ 
    301                         isInherited=0; 
    302                         if (lastLine!="") print appShift lastLine; 
    303                         print appShift "{" 
    304                         AddShift() 
    305                         lastLine=""; 
     301                        endOfInheritance(); 
    306302                } 
    307303                print appShift "/**" 
     
    725721 
    726722############################################################################# 
     723# Rewrite Subs handling events if csharpStyledOutput=1 
     724############################################################################# 
     725 
     726/.*[[:blank:]]Handles[[:blank:]]+/ && (csharpStyledOutput==1) { 
     727        name=gensub(/(.*)[[:blank:]]+Handles[[:blank:]]+(\w+)/,"\\2","g",$0); 
     728        print appShift "/// \\remark Handles the " name " event."; 
     729        $0=  gensub(/(.*)[[:blank:]]+Handles[[:blank:]]+(.*)/,"\\1","g",$0); 
     730} 
     731                 
     732############################################################################# 
    727733# namespaces 
    728734############################################################################# 
     
    757763        sub("Structure","struct"); 
    758764        sub("Type","struct"); 
    759          
    760         # handle subclasses 
    761         if (insideClass==1) { 
    762                 insideSubClass=1; 
    763         } else { 
    764                 insideClass=1; 
    765         } 
     765        if(isInherited) { 
     766                endOfInheritance(); 
     767        } 
     768        classNestCounter++; 
    766769         
    767770        # save class name for constructor handling 
    768         className=gensub(".+class[[:blank:]]+([^ ]*).*","\\1","g"); 
    769          
     771        className[classNestCounter]=gensub(".+class[[:blank:]]+([^ ]*).*","\\1","g"); 
    770772        isInherited=1; 
    771773        print appShift $0; 
     
    774776 
    775777# handle constructors 
    776 /.*Sub[[:blank:]]+New.*/ && className!="" { 
    777         sub("New", "New " className); 
    778 } 
    779  
     778/.*Sub[[:blank:]]+New.*/ && className[classNestCount]!="" { 
     779        sub("New", "New " className[classNestCount]); 
     780} 
     781 
     782function endOfInheritance() 
     783{ 
     784                isInherited=0; 
     785                if (lastLine!="") print appShift lastLine; 
     786                print appShift "{"; 
     787                AddShift(); 
     788                lastLine=""; 
     789                return 0; 
     790} 
    780791 
    781792# handle inheritance 
     
    797808        } 
    798809        else { 
    799                 isInherited=0; 
    800                 if (lastLine!="") print appShift lastLine; 
    801                 print appShift "{"; 
    802                 AddShift(); 
    803                 lastLine=""; 
     810                endOfInheritance(); 
    804811        } 
    805812} 
     
    809816 /.*End[[:blank:]]+Structure/ || 
    810817 /.*End[[:blank:]]+Type/) && 
    811  (insideClass==1 || insideSubClass==1){ 
    812         if (insideSubClass==1) { 
    813                 insideSubClass=0; 
    814         } else { 
    815                 insideClass=0; 
    816         } 
     818 (classNestCounter >= 1){ 
    817819        ReduceShift(); 
    818820        print appShift "}"; 
    819         className=""; 
     821        delete className[classNestCounter+1]; 
    820822        next; 
    821823} 
Note: See TracChangeset for help on using the changeset viewer.