def words(): return _(r"[^\n]+")
def requirement(): return requirement_heading, version, ZeroOrMore( [priority, type, group, uid]), Optional(requirement_description), _(r"\n?")
def heading(): return [(_(r"\s*#+\s+"), heading_name, _(r"\n?")), (heading_name, _(r"\n?[-=]+\n?"))]
def priority(): return _(r"\s*priority:\s*"), word
def group(): return _(r"\s*group:\s*"), word
def requirement_heading(): return [(_(r"\s?\s?\s?#+\s+"), requirement_name, _(r"\n?")), (requirement_name, _(r"[-=]+\n?"))]
def word(): return _(r"[^\s]+")
def requirement_uid(): return _(r"[ \t]*uid:[ \t]*"), word
def specification_name(): return _(r"(QA-)?SRS[^\n]+")
def requirement_type(): return _(r"[ \t]*type:[ \t]*"), word
def requirement_group(): return _(r"[ \t]*group:[ \t]*"), word
def requirement_priority(): return _(r"[ \t]*priority:[ \t]*"), word
def requirement_version(): return _(r"[ \t]*version:[ \t]*"), word
def requirement_heading(): return _(r"#+[ \t]+"), requirement_name, _(r"\n")
def specification_approval_other(): return _(r"\*?\*?[^\*\n]+:\*?\*?[ \t]*"), words, _(r"\n")
def specification_heading(): return _(r"#[ \t]+"), specification_name, _(r"\n")
def specification(): return specification_heading, ZeroOrMore(inline_heading), ZeroOrMore([ specification_author, specification_date, specification_version, specification_other, specification_approval, empty_line, _(r"[ \t]*[^\*#\n][^\n]*\n") ]), [toc_heading, heading]
def specification_author(): return _(r"\*?\*?[Aa]uthor:\*?\*?[ \t]*"), words, _(r"\n")
def requirement_name(): return _(r"RQ\.[^\n]+")
def specification_approval_heading(): return _(r"#+[ \t]+"), _(r"Approval"), _(r"[ \t]*\n")
def version(): return _(r"\s*version:\s*"), word
def specification_approval_status(): return _(r"\*?\*?[Ss]tatus:\*?\*?[ \t]*"), words, _(r"\n")
def type(): return _(r"\s*type:\s*"), word
def specification_approval_version(): return _(r"\*?\*?[Vv]ersion:\*?\*?[ \t]*"), words, _(r"\n")
def uid(): return _(r"\s*uid:\s*"), word
def specification_approval_by(): return _(r"\*?\*?[Aa]pproved by:\*?\*?[ \t]*"), words, _(r"\n")
def line(): return _(r"[^\n]*\n")
def specification_approval_date(): return _(r"\*?\*?[Dd]ate:\*?\*?[ \t]*"), words, _(r"\n")
def heading_name(): return _(r"[^\n]+")
def toc_heading(): return _(r"#+[ \t]+"), _( r"[Tt][Aa][Bb][Ll][Ee] [Oo][Ff] [Cc][Oo][Nn][Tt][Ee][Nn][Tt][Ss]" ), _(r"[ \t]*\n")