process comments line-by-line and handle each tag type with a different function