refactor: AidlAnnotation/AidlTypeSpecifier are commentable

These nodes are not syntactically commentable, but they hold comments
for parent nodes while parsing.

For example,

  // comments
  @Annotation int foo;

The comment is first attached to the annotation and then transfered to
the type('int') and then finally passed to the variable declaration.

While processing AST, we only care about variable 'foo's comments.

Bug: none
Test: aidl_unittests
Change-Id: I11f19dd9e5f8b5fe6a8343f862bbe34393ad8a4d
diff --git a/aidl_language.cpp b/aidl_language.cpp
index 9340e0e..e5da160 100644
--- a/aidl_language.cpp
+++ b/aidl_language.cpp
@@ -166,7 +166,8 @@
 
 AidlAnnotation* AidlAnnotation::Parse(
     const AidlLocation& location, const string& name,
-    std::map<std::string, std::shared_ptr<AidlConstantValue>>* parameter_list) {
+    std::map<std::string, std::shared_ptr<AidlConstantValue>>* parameter_list,
+    const std::string& comments) {
   const Schema* schema = nullptr;
   for (const Schema& a_schema : AllSchemas()) {
     if (a_schema.name == name) {
@@ -186,16 +187,20 @@
     return nullptr;
   }
   if (parameter_list == nullptr) {
-    return new AidlAnnotation(location, *schema, {});
+    return new AidlAnnotation(location, *schema, {}, comments);
   }
 
-  return new AidlAnnotation(location, *schema, std::move(*parameter_list));
+  return new AidlAnnotation(location, *schema, std::move(*parameter_list), comments);
 }
 
 AidlAnnotation::AidlAnnotation(
     const AidlLocation& location, const Schema& schema,
-    std::map<std::string, std::shared_ptr<AidlConstantValue>>&& parameters)
-    : AidlNode(location), schema_(schema), parameters_(std::move(parameters)) {}
+    std::map<std::string, std::shared_ptr<AidlConstantValue>>&& parameters,
+    const std::string& comments)
+    : AidlNode(location),
+      AidlCommentable(comments),
+      schema_(schema),
+      parameters_(std::move(parameters)) {}
 
 struct ConstReferenceFinder : AidlVisitor {
   const AidlConstantReference* found;
@@ -448,10 +453,10 @@
                                      vector<unique_ptr<AidlTypeSpecifier>>* type_params,
                                      const string& comments)
     : AidlAnnotatable(location),
+      AidlCommentable(comments),
       AidlParameterizable<unique_ptr<AidlTypeSpecifier>>(type_params),
       unresolved_name_(unresolved_name),
       is_array_(is_array),
-      comments_(comments),
       split_name_(Split(unresolved_name, ".")) {}
 
 const AidlTypeSpecifier& AidlTypeSpecifier::ArrayBase() const {