Replace sync_enums_to_hal.py with generate_api.{py,sh} and regenerate NeuralNetworks.h

There are certain pieces of NeuralNetworks.h and of our various *.hal
files that ought to be kept in sync -- most notably the operand type
and operation type definitions and descriptions in our
NeuralNetworks.h and types.hal files.  To avoid having to do this
manually, a tool can be employed.

The old solution to this problem is sync_enums_to_hal.py, which parses
the existing NeuralNetworks.h and types.hal files, and then rewrites
the types.hal files: It identifies the operand type and operation type
portions of the files, and in the types.hal files replaces them with
transformed versions of the portions from NeuralNetworks.h.  This
approach is brittle -- it is very sensitive to the structure of the
files, as was recognized when this tool was created.  Changes to those
files since the script was last updated essentially broke the script,
as noted in http://b/140132458.

The new solution employs a new tool generate_api.py to combine a
single "specification file" with one "template file" per API file
(NeuralNetworks.h or types.hal) to produce that API file.  The script
generate_api.sh invokes generate_api.py once per API file, passing
appropriate arguments.  See nn/tools/api/README.md for more details.

In the process of combining information from NeuralNetworks.h and
*/types.hal, some formatting, syntactic, and semantic changes have
been made to those files.  For example:
- types.hal files no longer refer to API levels or (similarly)
  to HAL versions other than earlier HAL versions
- More description in NeuralNetworks.h is now associated explicitly
  with API level 29 rather than appearing without qualification

Bug: 130169064
Bug: 140132458

Test: cd nn/runtime ; mma

Change-Id: I804e2ee6dbc852d2f0211eba3b0be4d0c36b2547
Merged-In: I804e2ee6dbc852d2f0211eba3b0be4d0c36b2547
(cherry picked from commit 9f9a583986cbd9ed90cb1cebfb5ffecb8d67f75e)
7 files changed