From 340bec4fe8f6367e23ad37c05c365fa484ca94b4 Mon Sep 17 00:00:00 2001
From: Cody <6558800+Bl3nd@users.noreply.github.com>
Date: Wed, 2 Oct 2024 21:24:15 -0600
Subject: [PATCH] Attempt at making the code more understandable and a few
other things.
- Added examples on what visitor visits
- Moved away from the line, columnStart and columnEnd variables for each visitor, instead we use the Value class.
- Added a few more values we parse.
---
.../classcontainer/parser/MyVoidVisitor.java | 1719 -----------------
.../parser/visitors/ArrayParser.java | 122 ++
.../parser/visitors/AssignParser.java | 100 +
.../parser/visitors/ConditionalParser.java | 54 +
.../parser/visitors/FieldAccessParser.java | 122 ++
.../parser/visitors/MethodCallParser.java | 140 ++
.../parser/visitors/MyVoidVisitor.java | 1172 +++++++++++
.../parser/visitors/ParameterParser.java | 36 +
.../parser/visitors/ParserUtil.java | 514 +++++
9 files changed, 2260 insertions(+), 1719 deletions(-)
delete mode 100644 src/main/java/the/bytecode/club/bytecodeviewer/resources/classcontainer/parser/MyVoidVisitor.java
create mode 100644 src/main/java/the/bytecode/club/bytecodeviewer/resources/classcontainer/parser/visitors/ArrayParser.java
create mode 100644 src/main/java/the/bytecode/club/bytecodeviewer/resources/classcontainer/parser/visitors/AssignParser.java
create mode 100644 src/main/java/the/bytecode/club/bytecodeviewer/resources/classcontainer/parser/visitors/ConditionalParser.java
create mode 100644 src/main/java/the/bytecode/club/bytecodeviewer/resources/classcontainer/parser/visitors/FieldAccessParser.java
create mode 100644 src/main/java/the/bytecode/club/bytecodeviewer/resources/classcontainer/parser/visitors/MethodCallParser.java
create mode 100644 src/main/java/the/bytecode/club/bytecodeviewer/resources/classcontainer/parser/visitors/MyVoidVisitor.java
create mode 100644 src/main/java/the/bytecode/club/bytecodeviewer/resources/classcontainer/parser/visitors/ParameterParser.java
create mode 100644 src/main/java/the/bytecode/club/bytecodeviewer/resources/classcontainer/parser/visitors/ParserUtil.java
diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/classcontainer/parser/MyVoidVisitor.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/classcontainer/parser/MyVoidVisitor.java
deleted file mode 100644
index b5b25283..00000000
--- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/classcontainer/parser/MyVoidVisitor.java
+++ /dev/null
@@ -1,1719 +0,0 @@
-package the.bytecode.club.bytecodeviewer.resources.classcontainer.parser;
-
-import com.github.javaparser.Range;
-import com.github.javaparser.ast.CompilationUnit;
-import com.github.javaparser.ast.NodeList;
-import com.github.javaparser.ast.body.*;
-import com.github.javaparser.ast.expr.*;
-import com.github.javaparser.ast.stmt.*;
-import com.github.javaparser.ast.type.ClassOrInterfaceType;
-import com.github.javaparser.ast.visitor.VoidVisitorAdapter;
-import com.github.javaparser.resolution.UnsolvedSymbolException;
-import com.github.javaparser.resolution.declarations.ResolvedConstructorDeclaration;
-import com.github.javaparser.resolution.declarations.ResolvedMethodDeclaration;
-import com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration;
-import com.github.javaparser.resolution.declarations.ResolvedValueDeclaration;
-import com.github.javaparser.resolution.types.ResolvedType;
-import the.bytecode.club.bytecodeviewer.resources.classcontainer.ClassFileContainer;
-import the.bytecode.club.bytecodeviewer.resources.classcontainer.locations.*;
-
-/**
- * Our custom visitor that allows us to get the information from JavaParser we need.
- *
- * Created by Bl3nd.
- * Date: 9/5/2024
- */
-@SuppressWarnings("OptionalGetWithoutIsPresent")
-public class MyVoidVisitor extends VoidVisitorAdapter