Contents



  ContinueComment()


  1. start
  2. is this function already in the middle of a comment?
    1. yes, this function is already in the middle of a comment.
    2. get a handle to the current comment.
    3. append the new text to it.
  3. else
    1. no, the current function is not already building a comment.
    2. so start a new one with this text.
  4. return all done!


  Main()


  1. start
  2. do we have any arguments?
    1. yes, we have arguments -- print usage and die.
    2. endif
    3. foreach line from stdin
      1. hack out a few Doxygen bits, if found
      2. is this a pseudocode line?
        1. {1,2})\s*(.*?)\s*$/ ) {
        2. yes, this is a metadata line
        3. parse line
        4. is this a new command?
          1. yes, this is a new command.
          2. parse out command and options
          3. cleanse comment for HTML display
        5. did this line start a new command?
          1. yes, this is a new command
          2. finish last command
          3. process this command
            1. case func.
              1. print last (finished) function
              2. start a new function
            2. case return/continue/break
            3. case block
            4. case warning/todo/notyet/...
            5. case note/question/review/...
            6. case crit/key
            7. case commented
            8. case for/if/while/...
            9. case switch
            10. case else
            11. case case
            12. case endfor/endif/...
            13. case endswitch
            14. case default display warning
        6. else
          1. no, this is not a command line
          2. does this line have program code before the comment?
            1. yes, this line appears to have program code before the comment.
            2. assume we are to start a new comment.
          3. else
            1. no, this is presumably a continuation of the previous comment.
            2. add text to current comment
      3. else
        1. no, this is not a metadata line
        2. commit (completed) comment to the current function, if either exists
    4. close last function
    5. crit print everything to stdout
    6. return all done!


  PrintEverything()


  1. start
  2. print header/TOC

  3. print header
  4. print TOC
  5. finish TOC
  6. print function bodies

  7. start function bodies
  8. iterate through each function
    1. start function
    2. iterate through each comment
      1. catch up to this comment's correct indentation level
      2. warning it would be better if some validation appeared here
      3. format comment
      4. background colors disabled until reliable and attractive solution is found to handle colorized nested blocks.
      5. render comment
    3. clean up any broken indents
    4. finish function
  9. end body


  StartComment()


  1. start
  2. extract the current function
  3. is the current function already in the middle of a comment?
    1. yes, the current function is in the middle of a comment.
    2. finish the current comment.
  4. initialize the new comment to default values (let the caller override)
  5. make the new comment the "current" comment for the function
  6. should we close this comment now, immediately upon creation?
    1. yes, we should (either AutoFinish was specified or the comment ended in a period).
    2. finish the "current" comment for this function (which is the one we just made).
  7. return all done!