I tried source code analysis

Trigger

Let's do an Advent calendar this year at the University Department to which I belong! I was asked to participate, so I also participated. (See here for articles by other members) ... so I thought about what to do, but I just wanted to introduce what I'm doing now, so I decided to write about parsing Java source code. Please note that the purpose of this article is to analyze the source code itself rather than the language Java.

Overview

This time, as the title says, we will analyze the source code, but as mentioned above, the language to be analyzed is Java. The code is analyzed using the more famous IDE Eclipse and the plug-in for creating the syntax tree AST (Abstract Syntax Tree) (detailed procedure is here. It is also described on the site of osaka-u.ac.jp/~s-kimura/jdtdoc/jdt.html).

Class diagram

Here's a diagram of the class relationships. クラス図.png

It will be a fairly simple diagram, so I would like to expand it further in the future.

Run

For the time being, as an output result, we were able to output the information of each decorator.

Future outlook

Finally, using this result, I analyzed the source code and found out "There are private methods and public methods, but in what order the developers develop and define such methods. I would like to analyze it.

Finally

I wrote this because I have an Advent calendar, but it's very simple because I don't have time. Please see My Page on "GitHub" for the progress of future projects.

Then (・ ω ・) Noshi

Recommended Posts

I tried source code analysis
I tried morphological analysis with MeCab
I tried migrating Processing to VS Code
I tried Spring.
I tried youtubeDataApi.
I tried refactoring ①
I tried to build Ruby 3.0.0 from source
I tried FizzBuzz.
I tried JHipster 5.1
I tried running Autoware
I tried using Gson
I tried QUARKUS immediately
I tried using TestNG
I tried using Galasa
I tried node-jt400 (Programs)
I tried node-jt400 (execute)
I tried node-jt400 (Transactions)
05. I tried to stub the source of Spring Boot
I tried calling Java / Objective-C native code from Flutter
I tried node-jt400 (Environment construction)
I tried DI with Ruby
I tried node-jt400 (IFS write)
I tried node-jt400 (SQL Update)
I tried using azure cloud-init
I tried Spring State machine
I tried Drools (Java, InputStream)
I tried Rails beginner [Chapter 1]
I tried the Docker tutorial!
I tried using Apache Wicket
I tried the VueJS tutorial!
I tried node-jt400 (SQL query)
I tried the FizzBuzz problem
I tried node-jt400 (SQL stream)
I tried node-jt400 (IFS read)
I tried putting XcodeGen + SwiftPM
I tried Rails beginner [Chapter 2]
I tried UPSERT with PostgreSQL.
I tried to touch JavaScript Part.1 Basic processing code system
I tried BIND with Docker
I tried to verify yum-cron
I tried Jets (ruby serverless)
I tried Facebook's Java concurrency bug analysis tool "Racer D"
I tried using Android's open source file download manager Fetch
I tried metaprogramming in Java
When reading the source code
I was curious about how gRPC-Java works, so I tried code reading
I tried to generate a C language program source from cURL
I tried low code IoT with OKI AE2100 & Node-RED. Part 2 Construction
I tried using anakia + Jing now
I tried Angular tutorial + SpringBoot + PostgreSQL
I tried to chew C # (indexer)
I tried something called recursive search
I tried using Spring + Mybatis + DbUnit
I tried using JOOQ with Gradle
[K8s] I tried communication between pods!
I read the source of ArrayList I read
I read the source of Integer
I tried to interact with Java
I tried UDP communication with Java
I tried to explain the method
I tried putting Domino11 in CentOS7