Redefine fqname in hidl-gen_y.yy

There is an inconsistency in hidl-gen_y.yy that fqname does not
mean an FQName object, but a Type object. Redefined fqname to create
an FQName object only, and rename the original fqname rule to fqtype.

This also propagates to AST::lookupType and Scope::lookupType to
take an FQName object instead of a plain string.

Test: `mma`
Test: `make hidl_test && adb sync && adb shell hidl_test`
Change-Id: I5d35192fa5fa9752b10bd9e7d339eadc5cdb78c0
5 files changed
tree: 8ff60f47ccca6eb6cac6d39a4c0946fc09514185
  1. c2hal/
  2. test/
  3. utils/
  4. Android.mk
  5. Annotation.cpp
  6. Annotation.h
  7. ArrayType.cpp
  8. ArrayType.h
  9. AST.cpp
  10. AST.h
  11. CompoundType.cpp
  12. CompoundType.h
  13. ConstantExpression.cpp
  14. ConstantExpression.h
  15. Coordinator.cpp
  16. Coordinator.h
  17. EnumType.cpp
  18. EnumType.h
  19. FQName.cpp
  20. FQName.h
  21. generateCpp.cpp
  22. generateCppImpl.cpp
  23. generateJava.cpp
  24. generateVts.cpp
  25. GenericBinder.cpp
  26. GenericBinder.h
  27. HandleType.cpp
  28. HandleType.h
  29. hidl-gen_l.ll
  30. hidl-gen_y.yy
  31. Interface.cpp
  32. Interface.h
  33. main.cpp
  34. Method.cpp
  35. Method.h
  36. MODULE_LICENSE_APACHE2
  37. NamedType.cpp
  38. NamedType.h
  39. NOTICE
  40. PredefinedType.cpp
  41. PredefinedType.h
  42. README.md
  43. ScalarType.cpp
  44. ScalarType.h
  45. Scope.cpp
  46. Scope.h
  47. StringType.cpp
  48. StringType.h
  49. Type.cpp
  50. Type.h
  51. TypeDef.cpp
  52. TypeDef.h
  53. VectorType.cpp
  54. VectorType.h
README.md

hidl-gen user guide

1. Build

croot
make hidl-gen

2. Run

hidl-gen -o output-path -L language (-r interface-root) fqname

output-path: directory to store the output files.
language: output file for given language. e.g.c++, vts..

fqname: fully qualified name of the input files.
For singe file input, follow the format: package@version::fileName
For directory input, follow the format: package@version

interface-root(optional): prefix and root path for fqname.
If not set, use the default prefix: android.hardware and default root path
defined in $TOP.

examples:

hidl-gen -o output -L c++ android.hardware.nfc@1.0::INfc.hal
hidl-gen -o output -L vts android.hardware.nfc@1.0
hidl-gen -o test -L c++ -r android.hardware:/home/android/master/hardware/interfaces android.hardware.nfc@1.0