Changeset 40 for trunk/vbfilter.awk
- Timestamp:
- 10/10/11 00:04:41 (7 months ago)
- File:
-
- 1 edited
-
trunk/vbfilter.awk (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/vbfilter.awk
r39 r40 1 1 #---------------------------------------------------------------------------- 2 # vbfilter.awk - doxygen VB .NET filter script - v2.4 2 # vbfilter.awk - doxygen VB .NET filter script - v2.4.1 3 3 # 4 4 # Creation: 26.05.2010 Vsevolod Kukol … … 64 64 fileHeader=0; 65 65 fullLine=1; 66 insideClass=0; 66 classNestCounter=0; 67 className[1]=""; 67 68 insideVB6Class=0; 68 69 insideVB6ClassName=""; 69 70 insideVB6Header=0; 70 insideSubClass=0;71 71 insideNamespace=0; 72 72 insideComment=0; … … 299 299 300 300 if (isInherited==1){ 301 isInherited=0; 302 if (lastLine!="") print appShift lastLine; 303 print appShift "{" 304 AddShift() 305 lastLine=""; 301 endOfInheritance(); 306 302 } 307 303 print appShift "/**" … … 725 721 726 722 ############################################################################# 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 ############################################################################# 727 733 # namespaces 728 734 ############################################################################# … … 757 763 sub("Structure","struct"); 758 764 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++; 766 769 767 770 # save class name for constructor handling 768 className=gensub(".+class[[:blank:]]+([^ ]*).*","\\1","g"); 769 771 className[classNestCounter]=gensub(".+class[[:blank:]]+([^ ]*).*","\\1","g"); 770 772 isInherited=1; 771 773 print appShift $0; … … 774 776 775 777 # 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 782 function endOfInheritance() 783 { 784 isInherited=0; 785 if (lastLine!="") print appShift lastLine; 786 print appShift "{"; 787 AddShift(); 788 lastLine=""; 789 return 0; 790 } 780 791 781 792 # handle inheritance … … 797 808 } 798 809 else { 799 isInherited=0; 800 if (lastLine!="") print appShift lastLine; 801 print appShift "{"; 802 AddShift(); 803 lastLine=""; 810 endOfInheritance(); 804 811 } 805 812 } … … 809 816 /.*End[[:blank:]]+Structure/ || 810 817 /.*End[[:blank:]]+Type/) && 811 (insideClass==1 || insideSubClass==1){ 812 if (insideSubClass==1) { 813 insideSubClass=0; 814 } else { 815 insideClass=0; 816 } 818 (classNestCounter >= 1){ 817 819 ReduceShift(); 818 820 print appShift "}"; 819 className="";821 delete className[classNestCounter+1]; 820 822 next; 821 823 }
Note: See TracChangeset
for help on using the changeset viewer.
