##### 16.9.2.5 Output parsers

There are cases in which GPS needs to parse the output of the VCS commands: when querying the status, or when “annotating” a file.

The following parsers can be implemented in the `vcs` node.

`<status_parser>`, `<local_status_parser>` and `<update_parser>`
  These parsers are used by the command VCS.status_parse, to parse a string for the status of files controlled by a VCS.

  They accept the following child nodes:

  `<regexp>` (mandatory)
    Indicates the regular expression to match.
  `<file_index>`
    An index of a parenthesized expression in `regexp` that contains the name of a file.
  `<status_index>`
    An index of a parenthesized expression in `regexp` that contains the file status. This status is passed through the regular expressions defined in the `status_matcher` nodes, see below.
  `<local_revision_index>`
    An index of a parenthesized expression in `regexp` that contains the name of the local revision (the version of the file that was checked out).
  `<repository_revision_index>`
    An index of a parenthesized expression in `regexp` that contains the name of the repository revision (the latest version of the file in the VCS).
  `<status_matcher>`
    A regular expression which, when matching an expressions, identifies the status passed in the node attribute `label`.
`<annotations_parser>`
  This parser is used by the command VCS.annotations_parse, to parse a string for annotations in a file controlled by a VCS.

  It accepts the following child nodes:

  `<regexp>` (mandatory)
    Indicates the regular expression to match.
  `<repository_revision_index>` (mandatory)
    An index of a parenthesized expression in `regexp` that contains the repository revision of the line.
  `<author_index>`
    An index of a parenthesized expression in `regexp` that contains the author of the line.
  `<date_index>`
    An index of a parenthesized expression in `regexp` that contains the date of the line.
  `<file_index>`
    An index of a parenthesized expression in `regexp` that indicates the part of the line that belongs to the file.
  `<tooltip_pattern>`
    A template pattern that will be used to format the tooltip information. It can contain text and reference parenthesized expressions in `regexp` using \`n` (where `n` represents the nth expression in `regexp`).
`<log_parser>`
  This parser is used by the command VCS.log_parse, to parse a string for revision histories in a file controlled by a VCS.

  It accepts the following child nodes:

  `<regexp>` (mandatory)
    Indicates the regular expression to match.
  `<repository_revision_index>` (mandatory)
    An index of a parenthesized expression in `regexp` that contains the repository revision of the log.
  `<author_index>`
    An index of a parenthesized expression in `regexp` that contains the author of the log.
  `<date_index>`
    An index of a parenthesized expression in `regexp` that contains the date of the log.
  `<log_index>`
    An index of a parenthesized expression in `regexp` that contains the actual text of the log.
`<revision_parser>`
  This parser is used by the command VCS.revision_parse, to parse a string for revision tags and branches in a file controlled by a VCS.

  It accepts the following child nodes:

  `<regexp>` (mandatory)
    Indicates the regular expression to match.
  `<sym_index>` (mandatory)
    An index of a parenthesized expression in `regexp` that contains the tags or branches symbolic name of the revision.
  `<repository_revision_index>` (mandatory)
    An index of a parenthesized expression in `regexp` that contains the repository revision number of the revision.