Christopher Wiley | da69599 | 2015-10-05 11:31:41 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015, The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Christopher Wiley | f600a55 | 2015-09-12 14:07:44 -0700 | [diff] [blame] | 17 | #include "ast_cpp.h" |
| 18 | |
Christopher Wiley | da69599 | 2015-10-05 11:31:41 -0700 | [diff] [blame] | 19 | #include <algorithm> |
| 20 | |
Christopher Wiley | f600a55 | 2015-09-12 14:07:44 -0700 | [diff] [blame] | 21 | #include "code_writer.h" |
Christopher Wiley | da69599 | 2015-10-05 11:31:41 -0700 | [diff] [blame] | 22 | #include "logging.h" |
Christopher Wiley | f600a55 | 2015-09-12 14:07:44 -0700 | [diff] [blame] | 23 | |
Christopher Wiley | a7a5c10 | 2015-09-29 16:26:52 -0700 | [diff] [blame] | 24 | using std::string; |
Casey Dahlin | b7d0f7f | 2015-09-22 17:21:08 -0700 | [diff] [blame] | 25 | using std::unique_ptr; |
Christopher Wiley | da69599 | 2015-10-05 11:31:41 -0700 | [diff] [blame] | 26 | using std::vector; |
Casey Dahlin | b7d0f7f | 2015-09-22 17:21:08 -0700 | [diff] [blame] | 27 | |
Christopher Wiley | f600a55 | 2015-09-12 14:07:44 -0700 | [diff] [blame] | 28 | namespace android { |
| 29 | namespace aidl { |
Christopher Wiley | f944e79 | 2015-09-29 10:00:46 -0700 | [diff] [blame] | 30 | namespace cpp { |
Christopher Wiley | da69599 | 2015-10-05 11:31:41 -0700 | [diff] [blame] | 31 | namespace { |
| 32 | |
| 33 | void WriteArgList(CodeWriter* to, const vector<string>& arguments_) { |
| 34 | bool first = true; |
| 35 | |
| 36 | to->Write("("); |
| 37 | |
| 38 | for (const auto& arg : arguments_) { |
| 39 | if (!first) |
| 40 | to->Write(", "); |
| 41 | to->Write("%s", arg.c_str()); |
| 42 | first = false; |
| 43 | } |
| 44 | |
| 45 | to->Write(")"); |
| 46 | } |
| 47 | |
| 48 | } // namespace |
Christopher Wiley | f600a55 | 2015-09-12 14:07:44 -0700 | [diff] [blame] | 49 | |
Christopher Wiley | 0c732db | 2015-09-29 14:36:44 -0700 | [diff] [blame] | 50 | ClassDecl::ClassDecl(const std::string& name, const std::string& parent) |
| 51 | : name_(name), |
| 52 | parent_(parent) {} |
| 53 | |
Christopher Wiley | f944e79 | 2015-09-29 10:00:46 -0700 | [diff] [blame] | 54 | ClassDecl::ClassDecl(const std::string& name, const std::string& parent, |
| 55 | std::vector<unique_ptr<Declaration>> public_members, |
| 56 | std::vector<unique_ptr<Declaration>> private_members) |
Casey Dahlin | 60a4916 | 2015-09-17 14:23:10 -0700 | [diff] [blame] | 57 | : name_(name), |
| 58 | parent_(parent), |
Casey Dahlin | b7d0f7f | 2015-09-22 17:21:08 -0700 | [diff] [blame] | 59 | public_members_(std::move(public_members)), |
| 60 | private_members_(std::move(private_members)) {} |
Casey Dahlin | 60a4916 | 2015-09-17 14:23:10 -0700 | [diff] [blame] | 61 | |
Christopher Wiley | f944e79 | 2015-09-29 10:00:46 -0700 | [diff] [blame] | 62 | void ClassDecl::Write(CodeWriter* to) const { |
Casey Dahlin | 60a4916 | 2015-09-17 14:23:10 -0700 | [diff] [blame] | 63 | to->Write("class %s ", name_.c_str()); |
| 64 | |
| 65 | if (parent_.length() > 0) |
| 66 | to->Write(": public %s ", parent_.c_str()); |
| 67 | |
Casey Dahlin | 88924d6 | 2015-09-17 16:28:24 -0700 | [diff] [blame] | 68 | to->Write("{\n"); |
Casey Dahlin | 60a4916 | 2015-09-17 14:23:10 -0700 | [diff] [blame] | 69 | |
| 70 | if (!public_members_.empty()) |
| 71 | to->Write("public:\n"); |
| 72 | |
| 73 | for (const auto& dec : public_members_) |
| 74 | dec->Write(to); |
| 75 | |
| 76 | if (!private_members_.empty()) |
| 77 | to->Write("private:\n"); |
| 78 | |
| 79 | for (const auto& dec : private_members_) |
| 80 | dec->Write(to); |
| 81 | |
Casey Dahlin | 88924d6 | 2015-09-17 16:28:24 -0700 | [diff] [blame] | 82 | to->Write("}; // class %s\n", name_.c_str()); |
| 83 | } |
| 84 | |
Christopher Wiley | 0c732db | 2015-09-29 14:36:44 -0700 | [diff] [blame] | 85 | void ClassDecl::AddPublic(std::unique_ptr<Declaration> member) { |
| 86 | public_members_.push_back(std::move(member)); |
| 87 | } |
| 88 | |
| 89 | void ClassDecl::AddPrivate(std::unique_ptr<Declaration> member) { |
| 90 | private_members_.push_back(std::move(member)); |
| 91 | } |
| 92 | |
Christopher Wiley | a7a5c10 | 2015-09-29 16:26:52 -0700 | [diff] [blame] | 93 | Enum::EnumField::EnumField(const string& k, const string&v) |
| 94 | : key(k), |
| 95 | value(v) {} |
| 96 | |
| 97 | Enum::Enum(const string& name) : enum_name_(name) {} |
| 98 | |
| 99 | void Enum::Write(CodeWriter* to) const { |
| 100 | to->Write("enum %s {\n", enum_name_.c_str()); |
| 101 | for (const auto& field : fields_) { |
| 102 | if (field.value.empty()) { |
| 103 | to->Write(" %s,\n", field.key.c_str()); |
| 104 | } else { |
| 105 | to->Write(" %s = %s,\n", field.key.c_str(), field.value.c_str()); |
| 106 | } |
| 107 | } |
| 108 | to->Write("}\n"); |
| 109 | } |
| 110 | |
| 111 | void Enum::AddValue(const string& key, const string& value) { |
| 112 | fields_.emplace_back(key, value); |
| 113 | } |
| 114 | |
Christopher Wiley | 2328526 | 2015-10-09 15:06:14 -0700 | [diff] [blame^] | 115 | ArgList::ArgList(const std::string& single_argument) |
| 116 | : ArgList(vector<string>{single_argument}) {} |
| 117 | |
| 118 | ArgList::ArgList(const std::vector<std::string>& arg_list) |
| 119 | : arguments_(arg_list) {} |
| 120 | |
| 121 | void ArgList::Write(CodeWriter* to) const { |
| 122 | to->Write("("); |
| 123 | bool is_first = true; |
| 124 | for (const auto& s : arguments_) { |
| 125 | if (!is_first) { to->Write(", "); } |
| 126 | is_first = false; |
| 127 | to->Write("%s", s.c_str()); |
| 128 | } |
| 129 | to->Write(")"); |
| 130 | } |
| 131 | |
Christopher Wiley | a7a5c10 | 2015-09-29 16:26:52 -0700 | [diff] [blame] | 132 | ConstructorDecl::ConstructorDecl( |
| 133 | const std::string& name, |
| 134 | std::vector<std::string> arguments) |
| 135 | : name_(name), |
| 136 | arguments_(arguments) {} |
| 137 | |
Christopher Wiley | f944e79 | 2015-09-29 10:00:46 -0700 | [diff] [blame] | 138 | ConstructorDecl::ConstructorDecl( |
Casey Dahlin | a834dd4 | 2015-09-23 11:52:15 -0700 | [diff] [blame] | 139 | const std::string& name, |
| 140 | std::vector<std::string> arguments, |
Casey Dahlin | a834dd4 | 2015-09-23 11:52:15 -0700 | [diff] [blame] | 141 | bool is_virtual) |
| 142 | : name_(name), |
| 143 | arguments_(arguments), |
Casey Dahlin | a834dd4 | 2015-09-23 11:52:15 -0700 | [diff] [blame] | 144 | is_virtual_(is_virtual) {} |
| 145 | |
Christopher Wiley | f944e79 | 2015-09-29 10:00:46 -0700 | [diff] [blame] | 146 | void ConstructorDecl::Write(CodeWriter* to) const { |
Casey Dahlin | a834dd4 | 2015-09-23 11:52:15 -0700 | [diff] [blame] | 147 | if (is_virtual_) |
| 148 | to->Write("virtual "); |
| 149 | |
| 150 | to->Write("%s(", name_.c_str()); |
| 151 | |
| 152 | bool not_first = false; |
| 153 | |
| 154 | for (const auto& arg : arguments_) { |
| 155 | if (not_first) |
| 156 | to->Write(", "); |
| 157 | not_first = true; |
| 158 | to->Write("%s", arg.c_str()); |
| 159 | } |
| 160 | |
Christopher Wiley | a7a5c10 | 2015-09-29 16:26:52 -0700 | [diff] [blame] | 161 | to->Write(");\n"); |
Casey Dahlin | a834dd4 | 2015-09-23 11:52:15 -0700 | [diff] [blame] | 162 | } |
| 163 | |
Christopher Wiley | f944e79 | 2015-09-29 10:00:46 -0700 | [diff] [blame] | 164 | MethodDecl::MethodDecl(const std::string& return_type, |
| 165 | const std::string& name, |
Christopher Wiley | 0c732db | 2015-09-29 14:36:44 -0700 | [diff] [blame] | 166 | std::vector<std::string> arguments) |
| 167 | : return_type_(return_type), |
| 168 | name_(name), |
| 169 | arguments_(arguments) {} |
| 170 | |
| 171 | MethodDecl::MethodDecl(const std::string& return_type, |
| 172 | const std::string& name, |
Christopher Wiley | f944e79 | 2015-09-29 10:00:46 -0700 | [diff] [blame] | 173 | std::vector<std::string> arguments, |
Christopher Wiley | 0c732db | 2015-09-29 14:36:44 -0700 | [diff] [blame] | 174 | uint32_t modifiers) |
Casey Dahlin | 88924d6 | 2015-09-17 16:28:24 -0700 | [diff] [blame] | 175 | : return_type_(return_type), |
| 176 | name_(name), |
| 177 | arguments_(arguments), |
Christopher Wiley | 0c732db | 2015-09-29 14:36:44 -0700 | [diff] [blame] | 178 | is_const_(modifiers & IS_CONST), |
| 179 | is_virtual_(modifiers & IS_VIRTUAL), |
| 180 | is_override_(modifiers & IS_OVERRIDE), |
| 181 | is_pure_virtual_(modifiers & IS_PURE_VIRTUAL) {} |
Casey Dahlin | 88924d6 | 2015-09-17 16:28:24 -0700 | [diff] [blame] | 182 | |
Christopher Wiley | f944e79 | 2015-09-29 10:00:46 -0700 | [diff] [blame] | 183 | void MethodDecl::Write(CodeWriter* to) const { |
Casey Dahlin | 88924d6 | 2015-09-17 16:28:24 -0700 | [diff] [blame] | 184 | if (is_virtual_) |
| 185 | to->Write("virtual "); |
| 186 | |
Christopher Wiley | da69599 | 2015-10-05 11:31:41 -0700 | [diff] [blame] | 187 | to->Write("%s %s", return_type_.c_str(), name_.c_str()); |
Casey Dahlin | 88924d6 | 2015-09-17 16:28:24 -0700 | [diff] [blame] | 188 | |
Christopher Wiley | da69599 | 2015-10-05 11:31:41 -0700 | [diff] [blame] | 189 | WriteArgList(to, arguments_); |
Casey Dahlin | 88924d6 | 2015-09-17 16:28:24 -0700 | [diff] [blame] | 190 | |
| 191 | if (is_const_) |
| 192 | to->Write(" const"); |
| 193 | |
Christopher Wiley | 0c732db | 2015-09-29 14:36:44 -0700 | [diff] [blame] | 194 | if (is_override_) |
| 195 | to->Write(" override"); |
| 196 | |
| 197 | if (is_pure_virtual_) |
| 198 | to->Write(" = 0"); |
| 199 | |
Casey Dahlin | 88924d6 | 2015-09-17 16:28:24 -0700 | [diff] [blame] | 200 | to->Write(";\n"); |
Casey Dahlin | 60a4916 | 2015-09-17 14:23:10 -0700 | [diff] [blame] | 201 | } |
| 202 | |
Christopher Wiley | da69599 | 2015-10-05 11:31:41 -0700 | [diff] [blame] | 203 | void StatementBlock::AddStatement(unique_ptr<AstNode> statement) { |
| 204 | statements_.push_back(std::move(statement)); |
| 205 | } |
| 206 | |
Christopher Wiley | 2328526 | 2015-10-09 15:06:14 -0700 | [diff] [blame^] | 207 | void StatementBlock::AddStatement(AstNode* statement) { |
| 208 | statements_.emplace_back(statement); |
| 209 | } |
| 210 | |
Christopher Wiley | da69599 | 2015-10-05 11:31:41 -0700 | [diff] [blame] | 211 | void StatementBlock::AddLiteral(const std::string& expression, |
| 212 | bool add_semicolon) { |
| 213 | statements_.push_back(unique_ptr<AstNode>{ |
| 214 | new LiteralStatement{expression, add_semicolon}}); |
| 215 | } |
| 216 | |
| 217 | void StatementBlock::Write(CodeWriter* to) const { |
| 218 | to->Write("{\n"); |
| 219 | for (const auto& statement : statements_) { |
| 220 | statement->Write(to); |
| 221 | } |
| 222 | to->Write("}\n"); |
| 223 | } |
| 224 | |
| 225 | MethodImpl::MethodImpl(const string& return_type, |
| 226 | const string& class_name, |
| 227 | const string& method_name, |
| 228 | vector<string> arguments, |
| 229 | bool is_const_method) |
| 230 | : return_type_(return_type), |
| 231 | method_name_(method_name), |
| 232 | arguments_(arguments), |
| 233 | is_const_method_(is_const_method) { |
| 234 | if (!class_name.empty()) { |
| 235 | method_name_ = class_name + "::" + method_name; |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | void MethodImpl::AddStatement(unique_ptr<AstNode> statement) { |
| 240 | statements_.AddStatement(std::move(statement)); |
| 241 | } |
| 242 | |
| 243 | void MethodImpl::Write(CodeWriter* to) const { |
| 244 | to->Write("%s %s", return_type_.c_str(), method_name_.c_str()); |
| 245 | WriteArgList(to, arguments_); |
| 246 | to->Write("%s ", (is_const_method_) ? " const" : ""); |
| 247 | statements_.Write(to); |
| 248 | } |
| 249 | |
| 250 | SwitchStatement::SwitchStatement(const std::string& expression) |
| 251 | : switch_expression_(expression) {} |
| 252 | |
| 253 | StatementBlock* SwitchStatement::AddCase(const string& value_expression) { |
| 254 | auto it = std::find(case_values_.begin(), case_values_.end(), value_expression); |
| 255 | if (it != case_values_.end()) { |
| 256 | LOG(ERROR) << "internal error: duplicate switch case labels"; |
| 257 | return nullptr; |
| 258 | } |
| 259 | StatementBlock* ret = new StatementBlock(); |
| 260 | case_values_.push_back(value_expression); |
| 261 | case_logic_.push_back(unique_ptr<StatementBlock>{ret}); |
| 262 | return ret; |
| 263 | } |
| 264 | |
| 265 | void SwitchStatement::Write(CodeWriter* to) const { |
| 266 | to->Write("switch (%s) {\n", switch_expression_.c_str()); |
| 267 | for (size_t i = 0; i < case_values_.size(); ++i) { |
| 268 | const string& case_value = case_values_[i]; |
| 269 | const unique_ptr<StatementBlock>& statements = case_logic_[i]; |
| 270 | if (case_value.empty()) { |
| 271 | to->Write("default:\n"); |
| 272 | } else { |
| 273 | to->Write("case %s:\n", case_value.c_str()); |
| 274 | } |
| 275 | statements->Write(to); |
| 276 | to->Write("break;\n"); |
| 277 | } |
| 278 | to->Write("}\n"); |
| 279 | } |
| 280 | |
Christopher Wiley | 2328526 | 2015-10-09 15:06:14 -0700 | [diff] [blame^] | 281 | |
| 282 | Assignment::Assignment(const std::string& left, const std::string& right) |
| 283 | : Assignment(left, new LiteralExpression{right}) {} |
| 284 | |
| 285 | Assignment::Assignment(const std::string& left, AstNode* right) |
| 286 | : lhs_(left), |
| 287 | rhs_(right) {} |
| 288 | |
| 289 | void Assignment::Write(CodeWriter* to) const { |
| 290 | to->Write("%s = ", lhs_.c_str()); |
| 291 | rhs_->Write(to); |
| 292 | to->Write(";\n"); |
| 293 | } |
| 294 | |
| 295 | MethodCall::MethodCall(const std::string& method_name, |
| 296 | const std::string& single_argument) |
| 297 | : MethodCall(method_name, new ArgList{single_argument}) {} |
| 298 | |
| 299 | MethodCall::MethodCall(const std::string& method_name, ArgList* arg_list) |
| 300 | : method_name_(method_name), |
| 301 | arg_list_{arg_list} {} |
| 302 | |
| 303 | void MethodCall::Write(CodeWriter* to) const { |
| 304 | to->Write("%s", method_name_.c_str()); |
| 305 | arg_list_->Write(to); |
| 306 | } |
| 307 | |
Christopher Wiley | da69599 | 2015-10-05 11:31:41 -0700 | [diff] [blame] | 308 | LiteralStatement::LiteralStatement(const string& expression, bool use_semicolon) |
| 309 | : expression_(expression), |
| 310 | use_semicolon_(use_semicolon) {} |
| 311 | |
| 312 | void LiteralStatement::Write(CodeWriter* to) const { |
| 313 | to->Write("%s%s\n", expression_.c_str(), (use_semicolon_) ? ";" : ""); |
| 314 | } |
| 315 | |
Christopher Wiley | 2328526 | 2015-10-09 15:06:14 -0700 | [diff] [blame^] | 316 | LiteralExpression::LiteralExpression(const std::string& expression) |
| 317 | : expression_(expression) {} |
| 318 | |
| 319 | void LiteralExpression::Write(CodeWriter* to) const { |
| 320 | to->Write("%s", expression_.c_str()); |
| 321 | } |
| 322 | |
Casey Dahlin | 34b8610 | 2015-09-16 16:03:06 -0700 | [diff] [blame] | 323 | CppNamespace::CppNamespace(const std::string& name, |
Christopher Wiley | f944e79 | 2015-09-29 10:00:46 -0700 | [diff] [blame] | 324 | std::vector<unique_ptr<Declaration>> declarations) |
Casey Dahlin | b7d0f7f | 2015-09-22 17:21:08 -0700 | [diff] [blame] | 325 | : declarations_(std::move(declarations)), |
Casey Dahlin | 34b8610 | 2015-09-16 16:03:06 -0700 | [diff] [blame] | 326 | name_(name) {} |
Christopher Wiley | f600a55 | 2015-09-12 14:07:44 -0700 | [diff] [blame] | 327 | |
Christopher Wiley | 0c732db | 2015-09-29 14:36:44 -0700 | [diff] [blame] | 328 | CppNamespace::CppNamespace(const std::string& name, |
| 329 | unique_ptr<Declaration> declaration) |
| 330 | : name_(name) { |
| 331 | declarations_.push_back(std::move(declaration)); |
| 332 | } |
| 333 | CppNamespace::CppNamespace(const std::string& name) |
| 334 | : name_(name) {} |
| 335 | |
Casey Dahlin | 34b8610 | 2015-09-16 16:03:06 -0700 | [diff] [blame] | 336 | void CppNamespace::Write(CodeWriter* to) const { |
| 337 | to->Write("namespace %s {\n\n", name_.c_str()); |
| 338 | |
Casey Dahlin | 60a4916 | 2015-09-17 14:23:10 -0700 | [diff] [blame] | 339 | for (const auto& dec : declarations_) { |
Casey Dahlin | 34b8610 | 2015-09-16 16:03:06 -0700 | [diff] [blame] | 340 | dec->Write(to); |
Casey Dahlin | 60a4916 | 2015-09-17 14:23:10 -0700 | [diff] [blame] | 341 | to->Write("\n"); |
| 342 | } |
Casey Dahlin | 34b8610 | 2015-09-16 16:03:06 -0700 | [diff] [blame] | 343 | |
Casey Dahlin | 60a4916 | 2015-09-17 14:23:10 -0700 | [diff] [blame] | 344 | to->Write("} // namespace %s\n", name_.c_str()); |
Casey Dahlin | 34b8610 | 2015-09-16 16:03:06 -0700 | [diff] [blame] | 345 | } |
| 346 | |
Christopher Wiley | f944e79 | 2015-09-29 10:00:46 -0700 | [diff] [blame] | 347 | Document::Document(const std::vector<std::string>& include_list, |
| 348 | unique_ptr<CppNamespace> a_namespace) |
Casey Dahlin | 34b8610 | 2015-09-16 16:03:06 -0700 | [diff] [blame] | 349 | : include_list_(include_list), |
Casey Dahlin | b7d0f7f | 2015-09-22 17:21:08 -0700 | [diff] [blame] | 350 | namespace_(std::move(a_namespace)) {} |
Casey Dahlin | 34b8610 | 2015-09-16 16:03:06 -0700 | [diff] [blame] | 351 | |
Christopher Wiley | f944e79 | 2015-09-29 10:00:46 -0700 | [diff] [blame] | 352 | void Document::Write(CodeWriter* to) const { |
Casey Dahlin | 34b8610 | 2015-09-16 16:03:06 -0700 | [diff] [blame] | 353 | for (const auto& include : include_list_) { |
Christopher Wiley | f600a55 | 2015-09-12 14:07:44 -0700 | [diff] [blame] | 354 | to->Write("#include <%s>\n", include.c_str()); |
| 355 | } |
| 356 | to->Write("\n"); |
| 357 | |
Casey Dahlin | 34b8610 | 2015-09-16 16:03:06 -0700 | [diff] [blame] | 358 | namespace_->Write(to); |
Christopher Wiley | f600a55 | 2015-09-12 14:07:44 -0700 | [diff] [blame] | 359 | } |
| 360 | |
Christopher Wiley | f600a55 | 2015-09-12 14:07:44 -0700 | [diff] [blame] | 361 | CppHeader::CppHeader(const std::string& include_guard, |
| 362 | const std::vector<std::string>& include_list, |
Casey Dahlin | b7d0f7f | 2015-09-22 17:21:08 -0700 | [diff] [blame] | 363 | unique_ptr<CppNamespace> a_namespace) |
Christopher Wiley | f944e79 | 2015-09-29 10:00:46 -0700 | [diff] [blame] | 364 | : Document(include_list, std::move(a_namespace)), |
Casey Dahlin | 34b8610 | 2015-09-16 16:03:06 -0700 | [diff] [blame] | 365 | include_guard_(include_guard) {} |
Christopher Wiley | f600a55 | 2015-09-12 14:07:44 -0700 | [diff] [blame] | 366 | |
| 367 | void CppHeader::Write(CodeWriter* to) const { |
| 368 | to->Write("#ifndef %s\n", include_guard_.c_str()); |
| 369 | to->Write("#define %s\n\n", include_guard_.c_str()); |
| 370 | |
Christopher Wiley | f944e79 | 2015-09-29 10:00:46 -0700 | [diff] [blame] | 371 | Document::Write(to); |
Christopher Wiley | f600a55 | 2015-09-12 14:07:44 -0700 | [diff] [blame] | 372 | to->Write("\n"); |
| 373 | |
| 374 | to->Write("#endif // %s", include_guard_.c_str()); |
| 375 | } |
| 376 | |
Casey Dahlin | 34b8610 | 2015-09-16 16:03:06 -0700 | [diff] [blame] | 377 | CppSource::CppSource(const std::vector<std::string>& include_list, |
Casey Dahlin | b7d0f7f | 2015-09-22 17:21:08 -0700 | [diff] [blame] | 378 | unique_ptr<CppNamespace> a_namespace) |
Christopher Wiley | f944e79 | 2015-09-29 10:00:46 -0700 | [diff] [blame] | 379 | : Document(include_list, std::move(a_namespace)) {} |
Christopher Wiley | f600a55 | 2015-09-12 14:07:44 -0700 | [diff] [blame] | 380 | |
Christopher Wiley | f944e79 | 2015-09-29 10:00:46 -0700 | [diff] [blame] | 381 | } // namespace cpp |
Christopher Wiley | f600a55 | 2015-09-12 14:07:44 -0700 | [diff] [blame] | 382 | } // namespace aidl |
| 383 | } // namespace android |