added doxygen-webtester.sed do generate doxygen from webtester files
This commit is contained in:
		
							
								
								
									
										44
									
								
								scripts/doxygen-webtester.sed
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										44
									
								
								scripts/doxygen-webtester.sed
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,44 @@ | ||||
| #!/bin/sed -nsf | ||||
|  | ||||
| # begin of file, declare file | ||||
| 1{ | ||||
|   /@file/!{ # no file definition yet, add it | ||||
|     x | ||||
|     s,^,    @file\n, | ||||
|     x | ||||
|   } | ||||
| } | ||||
|  | ||||
| # line with doxygen comment (defined as ## at begin of line) | ||||
| /^##\( \|$\)/{ | ||||
|   s/##\( \|$\)/    / # replace ## comments by 4 spaces indent | ||||
|   H; d               # hold, evaluate later | ||||
| } | ||||
|  | ||||
| # variable definition | ||||
| /^set/{ | ||||
|   s,^set \+\([^ =]\+\)\( *= *\(.*\)\)\?,/** @var \1, # prepend variable decl | ||||
|   G                                                  # append hold buffer | ||||
|   s,$, */\n,                                         # append end of comment | ||||
|   p; z; x; d                                         # clear buffer, next line | ||||
| } | ||||
|  | ||||
| # function definition | ||||
| /^function/{ | ||||
|   s,^function \+\([^ ]\+\) *\(.*\)\?,/** @fn \1(\2), # prepend function decl | ||||
|   G                                                  # append hold buffer | ||||
|   s,$, */\n,                                         # append end of comment | ||||
|   p; z; x; d                                         # clear buffer, next line | ||||
| } | ||||
|  | ||||
| # default for non matching lines - print buffer | ||||
| { | ||||
|   z; x; # get and clear buffer | ||||
|   /^$/!{                # only if buffer is not empty | ||||
|     s,^\n,,             # remove first newline | ||||
|     s,^\(    \)\?,/** , # prepend doxygen comment start | ||||
|     s,$, */\n,          # append end of comment | ||||
|     p; d | ||||
|   } | ||||
| } | ||||
|  | ||||
							
								
								
									
										13
									
								
								scripts/example.wt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								scripts/example.wt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| ## Commented Webtest Example File | ||||
| ## | ||||
| ## This is text that can be converted to doxygen using the tool | ||||
| ## @c doxygen-webtester.sed as filter. | ||||
|  | ||||
| ## This is a variable declaration | ||||
| set a=b | ||||
|  | ||||
| ## This is a function | ||||
| ## | ||||
| ## Here we have an example of a function declaration | ||||
| function function-name ARG1, ARG2 | ||||
|   # do nothing | ||||
							
								
								
									
										9
									
								
								scripts/makefile.am
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								scripts/makefile.am
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | ||||
| ## @id $Id$ | ||||
| # | ||||
| # This file has been added by bootstrap.sh on Wed, 06 May 2015 16:04:49 +0200 | ||||
| # Feel free to change it or even remove and rebuild it, up to your needs | ||||
| # | ||||
| ##       1         2         3         4         5         6         7         8 | ||||
| ## 45678901234567890123456789012345678901234567890123456789012345678901234567890 | ||||
|  | ||||
| dist_bin_SCRIPTS = doxygen-webtester.sed | ||||
		Reference in New Issue
	
	Block a user