Fix Phage unit test issue with ErrorTrap

Summary: The Phage agent build became dependent on PhutilErrorTrap after its introduction. Rather than build it into the agent, make the dependency soft. Also make the ServiceProfiler dependency soft to limit the surface area of the agent.

Test Plan: `arc unit --everything`

Reviewers: btrahan, wez, michael.plusnin

Reviewed By: wez

CC: aran

Differential Revision: https://secure.phabricator.com/D6792
Add an LR(1) parser generator to libphutil

Summary:
This is a rehash of D4301, but broadly I want to use the little Conduit grammar we have to actually enforce types, e.g. `int`, `map<string, int>`, etc.

This grammar ended up being more complex than I was able to handle with a hand-rolled recursive-descent parser, so I implemented an LR(1) parser generator a while ago. It seems to work properly, it's just kind of silly to do this in PHP.

I think this isn't that terrible, though, and we can kind of see if we go anywhere with it, and replace it with some simpler recursive-descent thing or something if it stops making any sense or is a terrible idea.

Test Plan: Ran unit tests, built a little type library on top of this (next revision).

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2039

Differential Revision: https://secure.phabricator.com/D6794
Implement a simple type language

Summary:
Depends on D6794. Ref T2039. This implements a simple type language so we can typecheck things (like Conduit method calls) easily. For T2039, I want to typecheck a JSON file without writing a zillion lines of custom parser code.

I codegenerated the parser since it takes around 125ms to build.

Test Plan: Ran unit tests.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2039

Differential Revision: https://secure.phabricator.com/D6795
Make PhutilDocblockParser slightly more liberal in finding "@special" annotations

Summary:
Ref T988. XHProf has some docblocks like this:

  /**
   * Blah blah blah, one space indent.
   *
   *  @author two space indent
   */

This is slightly ambiguous with code blocks, but be more liberal in parsing it since we don't really create any ambiguity.

Test Plan: Unit tests.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T988

Differential Revision: https://secure.phabricator.com/D6811
Add a console progress bar

Summary:
Ref T988. This is pretty fluff, but we have a few processes that do long-running processing and either don't report progress or do something relatively un-useful like printing a lot of dots.

Provide a progress bar with reasonable behaviors (notably: awareness of TTYs, of `--trace`, of console widths, and of exceptions).

Test Plan: Ran `progress_bar.php` script under all the special conditions it notes.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, chad

Maniphest Tasks: T988

Differential Revision: https://secure.phabricator.com/D6813
Fix xhpast Makefile for parallel builds

See: https://github.com/facebook/libphutil/issues/29