Better diagnostics if an attempt is made to redeclare a type under the same name

as an existing type in that scope. Support for anonymous struct/unions.

Change-Id: I0122cfae4da848419956c7b27bacaca66f8021d5
Bug: 30896059
3 files changed
tree: 91a61a49581cf9e53d2806eb6009cae8e54cd348
  1. test/
  2. Android.mk
  3. Annotation.cpp
  4. Annotation.h
  5. ArrayType.cpp
  6. ArrayType.h
  7. AST.cpp
  8. AST.h
  9. CompoundType.cpp
  10. CompoundType.h
  11. Constant.cpp
  12. Constant.h
  13. Coordinator.cpp
  14. Coordinator.h
  15. EnumType.cpp
  16. EnumType.h
  17. Formatter.cpp
  18. Formatter.h
  19. FQName.cpp
  20. FQName.h
  21. generateCpp.cpp
  22. generateJava.cpp
  23. generateVts.cpp
  24. HandleType.cpp
  25. HandleType.h
  26. hidl-gen_l.ll
  27. hidl-gen_y.yy
  28. Interface.cpp
  29. Interface.h
  30. main.cpp
  31. Method.cpp
  32. Method.h
  33. NamedType.cpp
  34. NamedType.h
  35. README.md
  36. ScalarType.cpp
  37. ScalarType.h
  38. Scope.cpp
  39. Scope.h
  40. StringType.cpp
  41. StringType.h
  42. Type.cpp
  43. Type.h
  44. TypeDef.cpp
  45. TypeDef.h
  46. VectorType.cpp
  47. 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
hild-gen -o test -L c++ -r android.hardware:/home/android/master/hardware/interfaces android.hardware.nfc@1.0