Add api mapping dump feature to AIDL files
The aidl compiler can process files and dump mappings between JNI
signatures of generated methods and their corresponding position in
.aidl source files.
Test: make aidl-mappings
Change-Id: I256cfc50967a1781f6a26064263d5f623612d40e
diff --git a/aidl_language.h b/aidl_language.h
index 1793f65..49a4606 100644
--- a/aidl_language.h
+++ b/aidl_language.h
@@ -22,6 +22,16 @@
using std::unique_ptr;
using std::vector;
+class AidlNode;
+
+namespace android {
+namespace aidl {
+namespace mappings {
+std::string dump_location(const AidlNode& method);
+} // namespace mappings
+} // namespace aidl
+} // namespace android
+
class AidlToken {
public:
AidlToken(const std::string& text, const std::string& comments);
@@ -46,6 +56,7 @@
AidlLocation(const std::string& file, Point begin, Point end);
friend std::ostream& operator<<(std::ostream& os, const AidlLocation& l);
+ friend class AidlNode;
private:
const std::string file_;
@@ -75,8 +86,10 @@
// To be able to print AidlLocation (nothing else should use this information)
friend class AidlError;
+ friend std::string android::aidl::mappings::dump_location(const AidlNode&);
private:
+ std::string PrintLocation() const;
const AidlLocation location_;
};