Fixing ReflectionTests
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run

This commit is contained in:
Purplumbi504 2024-07-04 18:57:36 +02:00
parent 8eba420d48
commit 435697053a
31 changed files with 54 additions and 2167 deletions

View File

@ -95,14 +95,6 @@ Tests and execution:
- Typing and Type checking -> (src/test/java/semantic/EndToTypedAstTest)
## Used Tools
- [Maven 4.0](https://maven.apache.org/index.html)
- Used for automating the build process and managing dependencies.
- [ANTLR4 v.13.1](https://www.antlr.org/)
- Used to parse the input Java code into the Abstract Syntax Tree.
## Used Tools
- [Maven 4.0](https://maven.apache.org/index.html)
@ -140,10 +132,3 @@ Example (jar needs to be in the target directory)
```
DgenClass=true
```
## How to run tests
```bash
mvn test
```
Or start them manually in your IDE

BIN
ast.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

View File

@ -15,7 +15,6 @@ import java.io.IOException;
import java.nio.file.Paths;
import java.util.Optional;
/**
* Start miniCompiler using make:
* <p> <code> cd .\src\test\ </code>

View File

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +0,0 @@
class Char {
char a;
public Char(char a){
this.a = testMethod(a);
}
char testMethod(char a){
return a;
}
}

View File

@ -1,8 +0,0 @@
/*
Mutliple Line Comment. Ignore
*/
class Comments{
private int a; // Ignore
}

View File

@ -1,12 +0,0 @@
public class ConstructorMethodCall {
int a;
public ConstructorMethodCall(){
this.a = testMethod();
}
int testMethod(){
return 1;
}
}

View File

@ -1,12 +0,0 @@
class ConstructorMethodCallParameters {
int a;
public ConstructorMethodCallParameters(int a){
this.a = testMethod(a);
}
int testMethod(int a){
return a;
}
}

View File

@ -1,5 +0,0 @@
class ConstructorParameter {
public ConstructorParameter(int a, int b){
}
}

View File

@ -1,8 +0,0 @@
class ConstructorThisDot {
private int a;
public ConstructorThisDot(int a){
this.a = a;
}
}

View File

@ -1,10 +0,0 @@
class DoWhile{
public DoWhile(){
int i = 0;
do{
i++;
}while(i < 10);
}
}

View File

@ -1 +0,0 @@
class EmptyClass {}

View File

@ -1,5 +0,0 @@
public class EmptyClassWithConstructor {
public EmptyClassWithConstructor() {
}
}

View File

@ -1,3 +0,0 @@
class Field {
int a;
}

View File

@ -1,3 +0,0 @@
public class FieldWithAccessModifier {
public int a;
}

View File

@ -1,8 +0,0 @@
class For{
public For(){
for(int i = 0; i < 10; i++){
int a;
}
}
}

View File

@ -1,8 +0,0 @@
public class If {
public If() {
int intValue = 5;
if(intValue == 5) {
intValue--;
}
}
}

View File

@ -1,10 +0,0 @@
public class IfElse {
public IfElse() {
int intValue = 5;
if(intValue == 5) {
intValue--;
} else {
intValue++;
}
}
}

View File

@ -1,12 +0,0 @@
public class IfElseIfElse {
public IfElseIfElse() {
int intValue = 5;
if(intValue == 5) {
intValue--;
} else if(intValue ==4) {
intValue++;
} else {
intValue++;
}
}
}

View File

@ -1,12 +0,0 @@
public class Increment {
public int test;
public void increment(int p) {
test = p++;
for(int i = 1; i<=10; i++) {
int a = 5;
}
}
}

View File

@ -1,5 +0,0 @@
class MainMethod{
public static void main(String[] args) {
}
}

View File

@ -1,3 +0,0 @@
class MultipleClasses {}
class TestClass2{}

View File

@ -1,8 +0,0 @@
class Null{
Null a;
public Null(){
this.a = null;
}
}

View File

@ -1,18 +0,0 @@
class SelfReference{
SelfReference selfReference;
int testMethod1() {
return this.testMethod2();
}
int testMethod2() {
return 1;
}
int testMethod3(){
SelfReference selfReference1 = new SelfReference();
return selfReference1.selfReference.testMethod1();
}
}

View File

@ -1,8 +0,0 @@
class ThisDot {
public int a;
public ThisDot() {
this.a = 1;
}
}

View File

@ -1,34 +0,0 @@
class VariableCalculation{
int aPlusB(int a, int b){
return a + b;
}
int aMinusB(int a, int b){
return a - b;
}
int aTimeB(int a, int b){
return a * b;
}
int aDivB(int a, int b){
return a / b;
}
int complexCalc (int a, int b){
return a * b / 1 * 3;
}
boolean aSmallerB (int a, int b){
return a < b;
}
boolean aGreaterB (int a, int b){
return a > b;
}
boolean aEqualsB (int a, int b){
return a == b;
}
}

View File

@ -1,30 +0,0 @@
class VariableCompare{
boolean trueMethod() {
return true;
}
boolean falseMethod(){
return false;
}
boolean trueAndTrueMethod(){
return true && true;
}
boolean trueAndFalseMethod(){
return true && false;
}
boolean falseAndFalseMethod(){
return false && false;
}
boolean trueOrTrueMethod(){
return true || true;
}
boolean falseOrFalseMethod(){
return false || false;
}
}

View File

@ -1,3 +0,0 @@
class VoidMethod{
void test(){}
}

View File

@ -1,10 +0,0 @@
class While{
public While(){
int i = 10;
while ( i > 0){
i--;
}
}
}

View File