diff --git a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithAssignment.java b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithAssignment.java deleted file mode 100644 index 5d8ea03..0000000 --- a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithAssignment.java +++ /dev/null @@ -1,3 +0,0 @@ -//public class ClassWithAssignment { -// int x = 10; -//} \ No newline at end of file diff --git a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructor.java b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructor.java index e11d449..692c764 100644 --- a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructor.java +++ b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructor.java @@ -1,11 +1,135 @@ //public class ClassWithConstructor { -// int x = 10; +// int x; // public classWithConstructor() { // this.x = 10; -// for (int i = 0; i < 6; i++) { -// for (int j = 0; j < this.x; j++) { +// int i; +// for (i = 0; i < 6; i = i + 1) { +// int j; +// for (j = 0; j < this.x; j += 1) { // this.x = this.x * this.x; // } // } // } -//} \ No newline at end of file +//} + +import de.maishai.ast.*; +import de.maishai.ast.records.*; +import de.maishai.ast.records.Class; + +import java.util.List; + +public class AbstractSyntax_ClassWithConstructor { + public static Class get() { + List fields = List.of( + new Field( + new Id("x"), + Type.INT + ) + ); + List methods = List.of(); + List constructors = getConstructors(); + return new Class( + true, + new Id("ClassWithConstructor"), + fields, + methods, + null, + constructors + ); + } + + private static List getConstructors() { + return List.of(getConstructor1()); + } + + private static Constructor getConstructor1() { + List parameters = List.of(); + + List localVariables = List.of( + new LocalVariable( + new Id("i"), + Type.INT + ) + ); + List statementList = List.of( + new Assignment( + new Id("x"), + AssignSign.ASSIGN, + new IntLiteral(10) + ), + new For( + new Assignment( + new Id("i"), + AssignSign.ASSIGN, + new IntLiteral(0) + ), + new Binary( + new Id("i"), + Operator.LT, + new IntLiteral(6) + ), + new Assignment( + new Id("i"), + AssignSign.ASSIGN, + new Binary( + new Id("i"), + Operator.ADD, + new IntLiteral(1) + ) + ), + new Block( + List.of( + new LocalVariable( + new Id("j"), + Type.INT + ) + ), + List.of( + new For( + new Assignment( + new Id("j"), + AssignSign.ASSIGN, + new IntLiteral(0) + ), + new Binary( + new Id("j"), + Operator.LT, + new Id("x") + ), + new Assignment( + new Id("j"), + AssignSign.ADD_ASSIGN, + new IntLiteral(1) + ), + new Block( + List.of(), + List.of( + new Assignment( + new Id("x"), + AssignSign.ASSIGN, + new Binary( + new Id("x"), + Operator.MUL, + new Id("x") + ) + ) + ) + ) + ) + ) + ) + ) + ); + Block block = new Block( + localVariables, + statementList + ); + + return new Constructor( + true, + new Id("ClassWithConstructor"), + parameters, + block + ); + } +} \ No newline at end of file diff --git a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructorAndMethodCall.java b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructorAndMethodCall.java index 3023566..1d025f4 100644 --- a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructorAndMethodCall.java +++ b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructorAndMethodCall.java @@ -1,6 +1,7 @@ //public class ClassWithConstructorAndMethodCall { -// int x = 10; -// public classWithConstructorAndMethodCall() { +// int x; +// +// public ClassWithConstructorAndMethodCall() { // this.x = 10; // while (methodCall()) { // this.x = this.x * this.x; @@ -8,10 +9,127 @@ // } // // public boolean methodCall() { -// if (x > 100) { +// if (this.x > 100) { // return false; // } else { // return true; // } // } -//} \ No newline at end of file +//} + + +import de.maishai.ast.AssignSign; +import de.maishai.ast.Operator; +import de.maishai.ast.ReturnType; +import de.maishai.ast.Type; +import de.maishai.ast.records.*; +import de.maishai.ast.records.Class; + +import java.util.List; + +public class AbstractSyntax_ClassWithConstructorAndMethodCall { + public static Class get() { + List fieldList = List.of( + new Field( + new Id("x"), + Type.INT + ) + ); + List methodList = getMethods(); + List constructorList = getConstructors(); + return new Class( + true, + new Id("ClassWithConstructorAndMethodCall"), + fieldList, + methodList, + null, + constructorList + ); + } + + private static List getConstructors() { + return List.of(getConstructor1()); + } + + private static Constructor getConstructor1() { + Block block = new Block( + List.of(), + List.of( + new Assignment( + new Id("x"), + AssignSign.ASSIGN, + new IntLiteral(10) + ), + new While( + new MethodCall( + true, + null, + new Id("methodCall"), + List.of() + ), + new Block( + List.of(), + List.of( + new Assignment( + new Id("x"), + AssignSign.ASSIGN, + new Binary( + new Id("x"), + Operator.MUL, + new Id("x") + ) + ) + ) + ) + ) + ) + ); + return new Constructor( + true, + new Id("ClassWithConstructorAndMethodCall"), + List.of(), + block + ); + } + + private static List getMethods() { + return List.of(getMethod1()); + } + + private static Method getMethod1() { + return new Method( + true, + ReturnType.BOOL, + new Id("methodCall"), + List.of(), + new Block( + List.of(), + List.of( + new IfElse( + new Binary( + new Id("x"), + Operator.GT, + new IntLiteral(100) + ), + new Block( + List.of(), + List.of( + new Return( + new BoolLiteral(false) + ) + ) + ), + new Block( + List.of(), + List.of( + new Return( + new BoolLiteral(true) + ) + ) + ) + ) + ) + ) + ); + } +} \ No newline at end of file diff --git a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructorWithParameters.java b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructorWithParameters.java index e6ead19..70e7fb0 100644 --- a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructorWithParameters.java +++ b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructorWithParameters.java @@ -1,14 +1,130 @@ //public class ClassWithConstructorWithParameters { -// int x = 0; -// public classWithConstructorWithParameters(int startvalue, int repitions) { -// this.x = startvalue; -// while (repitions > 0) { -// int innerRepititions = this.x; -// while (innerRepititions > 0) { +// int x; +// public classWithConstructorWithParameters(int startValue, int repetitions) { +// this.x = startValue; +// while (repetitions > 0) { +// int innerRepetitions; +// innerRepetitions = this.x; +// while (innerRepetitions > 0) { // this.x = this.x * this.x; -// innerRepititions--; +// innerRepetitions -= 1; // } -// repitions--; +// repetitions -= 1; // } // } -//} \ No newline at end of file +//} +import de.maishai.ast.AssignSign; +import de.maishai.ast.Operator; +import de.maishai.ast.records.*; +import de.maishai.ast.Type; +import de.maishai.ast.records.Class; + +import java.util.List; + +public class AbstractSyntax_ClassWithConstructorWithParameters { + public static Class get() { + List fields = List.of( + new Field( + new Id("x"), + Type.INT + ) + ); + List constructors = getConstructors(); + return new Class( + true, + new Id("ClassWithConstructorWithParameters"), + fields, + List.of(), + null, + constructors + ); + } + + private static List getConstructors() { + return List.of(getConstructor1()); + } + + private static Constructor getConstructor1() { + List parameters = List.of( + new Parameter( + "startValue", + Type.INT + ), + new Parameter( + "repetitions", + Type.INT + ) + ); + Block block = new Block( + List.of(), + List.of( + new Assignment( + new Id("x"), + AssignSign.ASSIGN, + new Id("startValue") + ), + new While( + new Binary( + new Id("repetitions"), + Operator.GT, + new IntLiteral(0) + ), + new Block( + List.of( + new LocalVariable( + new Id("innerRepetitions"), + Type.INT + ) + ), + List.of( + new Assignment( + new Id("innerRepetitions"), + AssignSign.ASSIGN, + new Id("x") + ), + new While( + new Binary( + new Id("repetitions"), + Operator.GT, + new IntLiteral(0) + ), + new Block( + List.of(), + List.of( + new Assignment( + new Id("x"), + AssignSign.ASSIGN, + new Binary( + new Id("x"), + Operator.MUL, + new Id("x") + ) + ), + new Assignment( + new Id("innerRepetitions"), + AssignSign.SUB_ASSIGN, + new IntLiteral(1) + ) + ) + ) + ), + new Assignment( + new Id("repetitions"), + AssignSign.SUB_ASSIGN, + new IntLiteral(1) + + ) + ) + ) + ) + ) + ); + return new Constructor( + true, + new Id("classWithConstructorWithParameters"), + parameters, + block + ); + } + +} \ No newline at end of file diff --git a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithField.java b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithField.java new file mode 100644 index 0000000..a4ec849 --- /dev/null +++ b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithField.java @@ -0,0 +1,33 @@ +//public class ClassWithField { +// int x; +//} + +import de.maishai.ast.records.Class; +import de.maishai.ast.Type; +import de.maishai.ast.records.Constructor; +import de.maishai.ast.records.Field; +import de.maishai.ast.records.Id; +import de.maishai.ast.records.Method; + +import java.util.List; + +public class AbstractSyntax_ClassWithField { + public static Class get() { + List fields = List.of( + new Field( + new Id("x"), + Type.INT + ) + ); + List methods = List.of(); + List constructors = List.of(); + return new Class( + true, + new Id("ClassWithAssignment"), + fields, + methods, + null, + constructors + ); + } +} \ No newline at end of file diff --git a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMethod.java b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMethod.java index dadfa09..1466e08 100644 --- a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMethod.java +++ b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMethod.java @@ -1,4 +1,46 @@ //public class ClassWithMethod { // public boolean method() { +// return false; // } -//} \ No newline at end of file +//} + +import de.maishai.ast.ReturnType; +import de.maishai.ast.records.Class; +import de.maishai.ast.records.*; + +import java.util.List; + +public class AbstractSyntax_ClassWithMethod { + public static Class get() { + List methods = getMethods(); + return new Class( + true, + new Id("ClassWithMethod"), + List.of(), + methods, + null, + List.of() + ); + } + + private static List getMethods() { + return List.of(getMethod1()); + } + + private static Method getMethod1() { + return new Method( + true, + ReturnType.BOOL, + new Id("method"), + List.of(), + new Block( + List.of(), + List.of( + new Return( + new BoolLiteral(false) + ) + ) + ) + ); + } +} \ No newline at end of file diff --git a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMethodAndAssignement.java b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMethodAndAssignement.java deleted file mode 100644 index 5550a77..0000000 --- a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMethodAndAssignement.java +++ /dev/null @@ -1,6 +0,0 @@ -//public class ClassWithMethodAndAssignement { -// char c = 'c'; -// -// public boolean method() { -// } -//} \ No newline at end of file diff --git a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMethodAndField.java b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMethodAndField.java new file mode 100644 index 0000000..bd024fc --- /dev/null +++ b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMethodAndField.java @@ -0,0 +1,86 @@ +//public class ClassWithMethodAndField { +// char c; +// +// public ClassWithMethodAndField(char character) { +// this.c = character; +// } +// +// public boolean method() { +// return true; +// } +//} + +import de.maishai.ast.*; +import de.maishai.ast.records.*; +import de.maishai.ast.records.Class; + +import java.util.List; + +class AbstractSyntax_ClassWithMethodAndField { + public static Class get() { + List fields = List.of( + new Field( + new Id("c"), + Type.CHAR + ) + ); + List methods = getMethods(); + List constructors = getConstructors(); + return new Class( + false, + new Id("ClassWithMethodAndField"), + fields, + methods, + null, + constructors + ); + } + + private static List getConstructors() { + return List.of(getConstructor1()); + } + + private static Constructor getConstructor1() { + return new Constructor( + true, + new Id("ClassWithMethodAndField"), + List.of( + new Parameter( + "character", + Type.CHAR + ) + ), + new Block( + List.of(), + List.of( + new Assignment( + new Id("c"), + AssignSign.ASSIGN, + new Id("character") + ) + ) + ) + ); + } + + private static List getMethods() { + return List.of(getMethod1()); + } + + private static Method getMethod1() { + return new Method( + true, + ReturnType.BOOL, + new Id("method"), + List.of(), + new Block( + List.of(), + List.of( + new Return( + new BoolLiteral(true) + ) + ) + ) + ); + } +} \ No newline at end of file diff --git a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMoreComplexMethod.java b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMoreComplexMethod.java deleted file mode 100644 index 366e587..0000000 --- a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMoreComplexMethod.java +++ /dev/null @@ -1,6 +0,0 @@ -//public class ClassWithMoreComplexMethod { -// public boolean moreComplexMethod() { -// int i = 0; -// return true; -// } -//} \ No newline at end of file diff --git a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMoreComplexMethodAndMain.java b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMoreComplexMethodAndMain.java new file mode 100644 index 0000000..467e24d --- /dev/null +++ b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMoreComplexMethodAndMain.java @@ -0,0 +1,137 @@ +//public class ClassWithMoreComplexMethodAndMain { +// ClassWithMoreComplexMethodAndMain instance; +// +// public boolean moreComplexMethod() { +// int i; +// i = 11; +// boolean returnValue; +// returnValue = false; +// while (i > 0) { +// i -= 1; +// returnValue = !returnValue; +// } +// return returnValue; +// } +// +// public static void main(String[] args) { +// instance = new ClassWithMoreComplexMethodAndMain() +// } +//} + +import de.maishai.ast.*; +import de.maishai.ast.records.*; +import de.maishai.ast.records.Class; + +import java.util.List; + +public class AbstractSyntax_ClassWithMoreComplexMethodAndMain { + public static Class get() { + Type TypeClassWithMoreComplexMethodAndMain = Type.OBJECT; + TypeClassWithMoreComplexMethodAndMain.setObjectType(new Id("ClassWithMoreComplexMethodAndMain")); + List fields = List.of( + new Field( + new Id("instance"), + TypeClassWithMoreComplexMethodAndMain + ) + ); + List methods = getMethods(); + List constructors = List.of(); + return new Class( + true, + new Id("ClassWithMoreComplexMethodAndMain"), + fields, + methods, + getMainMethod(), + constructors + ); + } + + private static List getMethods() { + return List.of(getMethod1()); + } + + private static Method getMethod1() { + Block block = new Block( + List.of( + new LocalVariable( + new Id("i"), + Type.INT + ), + new LocalVariable( + new Id("returnValue"), + Type.BOOL + ) + ), + List.of( + new Assignment( + new Id("i"), + AssignSign.ASSIGN, + new IntLiteral(11) + ), + new Assignment( + new Id("returnValue"), + AssignSign.ASSIGN, + new BoolLiteral(false) + ), + new While( + new Binary( + new Id("i"), + Operator.GT, + new IntLiteral(0) + ), + new Block( + List.of(), + List.of( + new Assignment( + new Id("i"), + AssignSign.SUB_ASSIGN, + new IntLiteral(1) + ), + new Assignment( + new Id("returnValue"), + AssignSign.ASSIGN, + new Unary( + UnaryOperator.NOT, + new Id("returnValue") + ) + ) + ) + ) + ), + new Return( + new Id("returnValue") + ) + ) + ); + return new Method( + true, + ReturnType.BOOL, + new Id("moreComplexMethod"), + List.of(), + block + ); + } + + + private static MainMethod getMainMethod() { + Type TypeClassWithMoreComplexMethodAndMain = Type.OBJECT; + TypeClassWithMoreComplexMethodAndMain.setObjectType(new Id("ClassWithMoreComplexMethodAndMain")); + List statementList = List.of( + new Assignment( + new Id("instance"), + AssignSign.ASSIGN, + new New( + TypeClassWithMoreComplexMethodAndMain, + List.of() + ) + ) + ); + Block block = new Block( + List.of(), + statementList + ); + return new MainMethod( + block + ); + } +} \ No newline at end of file diff --git a/src/main/resources/AbstractSyntax/AbstractSyntax_OnlyClass.java b/src/main/resources/AbstractSyntax/AbstractSyntax_OnlyClass.java index ce444a9..d3737df 100644 --- a/src/main/resources/AbstractSyntax/AbstractSyntax_OnlyClass.java +++ b/src/main/resources/AbstractSyntax/AbstractSyntax_OnlyClass.java @@ -1,2 +1,20 @@ //class OnlyClass { -//} \ No newline at end of file +//} + +import de.maishai.ast.records.*; +import de.maishai.ast.records.Class; + +import java.util.List; + +public class AbstractSyntax_OnlyClass { + public static Class get() { + return new Class( + true, + new Id("OnlyClass"), + List.of(), + List.of(), + null, + List.of() + ); + } +} \ No newline at end of file diff --git a/src/main/resources/AbstractSyntax/AbstractSyntax_PublicClass.java b/src/main/resources/AbstractSyntax/AbstractSyntax_PublicClass.java index e7813cd..820aaea 100644 --- a/src/main/resources/AbstractSyntax/AbstractSyntax_PublicClass.java +++ b/src/main/resources/AbstractSyntax/AbstractSyntax_PublicClass.java @@ -1,2 +1,20 @@ //public class PublicClass { -//} \ No newline at end of file +//} + +import de.maishai.ast.records.Class; +import de.maishai.ast.records.Id; + +import java.util.List; + +public class AbstractSyntax_PublicClass { + public static Class get() { + return new Class( + true, + new Id("PublicClass"), + List.of(), + List.of(), + null, + List.of() + ); + } +} \ No newline at end of file diff --git a/src/main/resources/JavaTestfiles/ClassWithAssignment.java b/src/main/resources/JavaTestfiles/ClassWithAssignment.java deleted file mode 100644 index 7782c46..0000000 --- a/src/main/resources/JavaTestfiles/ClassWithAssignment.java +++ /dev/null @@ -1,3 +0,0 @@ -public class ClassWithAssignment { - int x = 10; -} \ No newline at end of file diff --git a/src/main/resources/JavaTestfiles/ClassWithConstructor.java b/src/main/resources/JavaTestfiles/ClassWithConstructor.java index f58386d..0052585 100644 --- a/src/main/resources/JavaTestfiles/ClassWithConstructor.java +++ b/src/main/resources/JavaTestfiles/ClassWithConstructor.java @@ -1,9 +1,11 @@ public class ClassWithConstructor { - int x = 10; + int x; public classWithConstructor() { this.x = 10; - for (int i = 0; i < 6; i++) { - for (int j = 0; j < this.x; j++) { + int i; + for (i = 0; i < 6; i = i + 1) { + int j; + for (j = 0; j < this.x; j += 1) { this.x = this.x * this.x; } } diff --git a/src/main/resources/JavaTestfiles/ClassWithConstructorAndMethodCall.java b/src/main/resources/JavaTestfiles/ClassWithConstructorAndMethodCall.java index 43c58e4..d91d385 100644 --- a/src/main/resources/JavaTestfiles/ClassWithConstructorAndMethodCall.java +++ b/src/main/resources/JavaTestfiles/ClassWithConstructorAndMethodCall.java @@ -1,6 +1,7 @@ public class ClassWithConstructorAndMethodCall { - int x = 10; - public classWithConstructorAndMethodCall() { + int x; + + public ClassWithConstructorAndMethodCall() { this.x = 10; while (methodCall()) { this.x = this.x * this.x; @@ -8,10 +9,10 @@ public class ClassWithConstructorAndMethodCall { } public boolean methodCall() { - if (x > 100) { + if (this.x > 100) { return false; } else { return true; } } -} \ No newline at end of file +} diff --git a/src/main/resources/JavaTestfiles/ClassWithConstructorWithParameters.java b/src/main/resources/JavaTestfiles/ClassWithConstructorWithParameters.java index 3ad3e5a..e7eb5fa 100644 --- a/src/main/resources/JavaTestfiles/ClassWithConstructorWithParameters.java +++ b/src/main/resources/JavaTestfiles/ClassWithConstructorWithParameters.java @@ -1,14 +1,15 @@ public class ClassWithConstructorWithParameters { - int x = 0; - public classWithConstructorWithParameters(int startvalue, int repitions) { - this.x = startvalue; - while (repitions > 0) { - int innerRepititions = this.x; - while (innerRepititions > 0) { + int x; + public classWithConstructorWithParameters(int startValue, int repetitions) { + this.x = startValue; + while (repetitions > 0) { + int innerRepetitions; + innerRepetitions = this.x; + while (innerRepetitions > 0) { this.x = this.x * this.x; - innerRepititions--; + innerRepetitions -= 1; } - repitions--; + repetitions -= 1; } } } \ No newline at end of file diff --git a/src/main/resources/JavaTestfiles/ClassWithField.java b/src/main/resources/JavaTestfiles/ClassWithField.java new file mode 100644 index 0000000..d205a21 --- /dev/null +++ b/src/main/resources/JavaTestfiles/ClassWithField.java @@ -0,0 +1,3 @@ +public class ClassWithField { + int x; +} \ No newline at end of file diff --git a/src/main/resources/JavaTestfiles/ClassWithMethod.java b/src/main/resources/JavaTestfiles/ClassWithMethod.java index eadb3da..4b04fea 100644 --- a/src/main/resources/JavaTestfiles/ClassWithMethod.java +++ b/src/main/resources/JavaTestfiles/ClassWithMethod.java @@ -1,4 +1,5 @@ public class ClassWithMethod { public boolean method() { + return false; } } \ No newline at end of file diff --git a/src/main/resources/JavaTestfiles/ClassWithMethodAndAssignement.java b/src/main/resources/JavaTestfiles/ClassWithMethodAndAssignement.java deleted file mode 100644 index 11ee656..0000000 --- a/src/main/resources/JavaTestfiles/ClassWithMethodAndAssignement.java +++ /dev/null @@ -1,6 +0,0 @@ -public class ClassWithMethodAndAssignement { - char c = 'c'; - - public boolean method() { - } -} \ No newline at end of file diff --git a/src/main/resources/JavaTestfiles/ClassWithMethodAndField.java b/src/main/resources/JavaTestfiles/ClassWithMethodAndField.java new file mode 100644 index 0000000..264e099 --- /dev/null +++ b/src/main/resources/JavaTestfiles/ClassWithMethodAndField.java @@ -0,0 +1,11 @@ +public class ClassWithMethodAndField { + char c; + + public ClassWithMethodAndField(char character) { + this.c = character; + } + + public boolean method() { + return true; + } +} \ No newline at end of file diff --git a/src/main/resources/JavaTestfiles/ClassWithMoreComplexMethod.java b/src/main/resources/JavaTestfiles/ClassWithMoreComplexMethod.java deleted file mode 100644 index 9dca185..0000000 --- a/src/main/resources/JavaTestfiles/ClassWithMoreComplexMethod.java +++ /dev/null @@ -1,6 +0,0 @@ -public class ClassWithMoreComplexMethod { - public boolean moreComplexMethod() { - int i = 0; - return true; - } -} \ No newline at end of file diff --git a/src/main/resources/JavaTestfiles/ClassWithMoreComplexMethodAndMain.java b/src/main/resources/JavaTestfiles/ClassWithMoreComplexMethodAndMain.java new file mode 100644 index 0000000..09a9150 --- /dev/null +++ b/src/main/resources/JavaTestfiles/ClassWithMoreComplexMethodAndMain.java @@ -0,0 +1,19 @@ +public class ClassWithMoreComplexMethodAndMain { + ClassWithMoreComplexMethodAndMain instance; + + public boolean moreComplexMethod() { + int i; + i = 11; + boolean returnValue; + returnValue = false; + while (i > 0) { + i -= 1; + returnValue = !returnValue; + } + return returnValue; + } + + public static void main(String[] args) { + instance = new ClassWithMoreComplexMethodAndMain() + } +} \ No newline at end of file