Pointer support and embedded types in HIDL.

* Pointers work per transaction. Don't work
  across transactions.
* ref<T> in HIDL translates to T const* in C++.
* No Java support.
* Embedded types like ref<vec<vec<int32_t>>>
  or vec<ref<T>> is supported. Pointers to
  pointers like ref<ref<ref<T>>> is supported.
* Array of pointers and pointer to array supported.
* Pointer inside a union is NOT supported.

Test: `mma`
Test: `make hidl_test && adb sync && adb shell hidl_test`
      Note that this only works with a kernel patch.

Bug: 31300815
Bug: 31349114

Change-Id: I15b74ca74a801009cc8bdc7132bd53d0185dbcbf
diff --git a/hidl-gen_l.ll b/hidl-gen_l.ll
index 8a52137..97e3737 100644
--- a/hidl-gen_l.ll
+++ b/hidl-gen_l.ll
@@ -38,6 +38,8 @@
 #include "Method.h"
 #include "ScalarType.h"
 #include "StringType.h"
+#include "VectorType.h"
+#include "RefType.h"
 
 #include "hidl-gen_y.h"
 
@@ -88,7 +90,8 @@
 "struct"		{ return token::STRUCT; }
 "typedef"		{ return token::TYPEDEF; }
 "union"			{ return token::UNION; }
-"vec"			{ return token::VEC; }
+"vec"			{ yylval->templatedType = new VectorType; return token::TEMPLATED; }
+"ref"			{ yylval->templatedType = new RefType; return token::TEMPLATED; }
 "oneway"		{ return token::ONEWAY; }
 
 "bool"			{ SCALAR_TYPE(KIND_BOOL); }