hsk-libs-scripts  270
High Speed Karlsruhe XC878 build scripts
Functions
awk2doxygen.awk File Reference

Converts an awk script containing doxygen comments into something the C parser of doxygen can handle. More...

Functions

void filter14 ()
 Initialise globals. More...
 
void debug (var msg)
 Prints a debugging message on stderr. More...
 
void filter38 ()
 Fill the input buffer. More...
 
void initDoc ()
 Setup globals to assemble a new documentation block. More...
 
var genFunction (var name)
 Generates a function signature. More...
 
void filter84 ()
 Flush the remaining input buffer. More...
 
void filter94 ()
 Initialise file documentation. More...
 
void filter103 ()
 Initialise documentation block. More...
 
void filter115 ()
 Close documentation block. More...
 
void filter178 ()
 Strip the indenting from the documentation. More...
 
void filter185 ()
 Collect function parameters. More...
 
void filter196 ()
 Detect that the function returns something. More...
 
void filter203 ()
 Replace static regular expressions with strings. More...
 
void filter219 ()
 Assume the current line does not contain a comment. More...
 
void filter226 ()
 Make C comments out of awk comments. More...
 
void filter241 ()
 Replace $n with incol[n]. More...
 
void filter254 ()
 Append a semicolon. More...
 

Detailed Description

Converts an awk script containing doxygen comments into something the C parser of doxygen can handle.

Warning
This script only produces correct output for completely documented code.

Function Documentation

§ filter14()

void filter14 ( )

Initialise globals.

Precondition
BEGIN  

§ debug()

void debug ( var  msg)

Prints a debugging message on stderr.

The debugging message is only printed if DEBUG is set.

Parameters
msgThe message to print

§ filter38()

void filter38 ( )

Fill the input buffer.

Buffering is used to inject code into previous output lines.

§ initDoc()

void initDoc ( )

Setup globals to assemble a new documentation block.

The following globals are reset:

  • doc(string): Set to enter documentation mode, contains the initial string to be able to reproduce the indention
  • fret(bool): The coming function returns something
  • fargs(array): The coming function has the following arguments, further arguments are discarded as local variables

§ genFunction()

var genFunction ( var  name)

Generates a function signature.

Parameters
nameThe function name
Returns
A string containing a function declaration

§ filter84()

void filter84 ( )

Flush the remaining input buffer.

Precondition
END  

§ filter94()

void filter94 ( )

Initialise file documentation.

Precondition
!doc && /^#!/  

§ filter103()

void filter103 ( )

Initialise documentation block.

Precondition
!doc && /^[ \t]*##/  

§ filter115()

void filter115 ( )

Close documentation block.

This closes a documentation block and generates a function signature for functions and filters.

Precondition
doc && /^[ \t]*([^#]|$)/  

§ filter178()

void filter178 ( )

Strip the indenting from the documentation.

This benefits verbatim and code formatting.

Precondition
doc && /^[ \t]*#/  

§ filter185()

void filter185 ( )

Collect function parameters.

Precondition
doc && buf[line] ~ /[\\@]param(\[(in|out|in,out)\])?[ \t]/  

§ filter196()

void filter196 ( )

Detect that the function returns something.

Precondition
doc && buf[line] ~ /[\\@](return|retval)/  

§ filter203()

void filter203 ( )

Replace static regular expressions with strings.

Precondition
!doc && buf[line] ~ /^(("(\\.|[^"])*")?[^"\/])*\/(\\.|[^\/])+\//  

§ filter219()

void filter219 ( )

Assume the current line does not contain a comment.

§ filter226()

void filter226 ( )

Make C comments out of awk comments.

Precondition
!doc && buf[line] ~ /^(("(\\.|[^"])*")?[^"#])*#/  

§ filter241()

void filter241 ( )

Replace $n with incol[n].

Precondition
!doc && buf[line] ~ /^(("(\\.|[^"])*")?[^"$])*\$[0-9]+/  

§ filter254()

void filter254 ( )

Append a semicolon.

Precondition
!doc && !comment && buf[line] ~ /[^