1 /* 2 * Copyright (C) 2021, The Android Open Source Project * 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #pragma once 16 17 #include "aidl_language.h" 18 #include "code_writer.h" 19 20 namespace android { 21 namespace aidl { 22 23 struct DumpVisitor : AidlVisitor { 24 CodeWriter& out; 25 bool inline_constants; DumpVisitorDumpVisitor26 DumpVisitor(CodeWriter& out, bool inline_constants) 27 : out(out), inline_constants(inline_constants) {} 28 29 void DumpType(const AidlDefinedType& dt, const string& type); 30 void DumpMembers(const AidlDefinedType& dt); 31 void DumpComments(const AidlCommentable& c); 32 void DumpAnnotations(const AidlAnnotatable& a); 33 void DumpConstantValue(const AidlTypeSpecifier& type, const AidlConstantValue& c); 34 35 void Visit(const AidlInterface& t) override; 36 void Visit(const AidlParcelable& t) override; 37 void Visit(const AidlStructuredParcelable& t) override; 38 void Visit(const AidlUnionDecl& t) override; 39 void Visit(const AidlEnumDeclaration& t) override; 40 void Visit(const AidlMethod& m) override; 41 void Visit(const AidlVariableDeclaration& v) override; 42 void Visit(const AidlConstantDeclaration& c) override; 43 void Visit(const AidlTypeSpecifier& t) override; 44 void Visit(const AidlConstantValue& c) override; 45 void Visit(const AidlConstantReference& r) override; 46 void Visit(const AidlBinaryConstExpression& b) override; 47 void Visit(const AidlUnaryConstExpression& u) override; 48 }; 49 50 bool dump_api(const Options& options, const IoDelegate& io_delegate); 51 52 } // namespace aidl 53 } // namespace android 54