diff --git a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructor.java b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructor.java index ce548e3..a27eded 100644 --- a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructor.java +++ b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructor.java @@ -52,21 +52,33 @@ public class AbstractSyntax_ClassWithConstructor { ); List statementList = List.of( new Assignment( - new Id("x"), + new FieldId( + true, + null, + new Id("x")), new IntLiteral(10) ), new For( new Assignment( - new Id("i"), + new FieldId( + false, + null, + new Id("i")), new IntLiteral(0) ), new Binary( - new Id("i"), + new FieldId( + false, + null, + new Id("i")), Operator.LT, new IntLiteral(6) ), new Assignment( - new Id("i"), + new FieldId( + false, + null, + new Id("i")), new Binary( new Id("i"), Operator.ADD, @@ -83,7 +95,10 @@ public class AbstractSyntax_ClassWithConstructor { List.of( new For( new Assignment( - new Id("j"), + new FieldId( + false, + null, + new Id("j")), new IntLiteral(0) ), new Binary( @@ -92,14 +107,27 @@ public class AbstractSyntax_ClassWithConstructor { new Id("x") ), new Assignment( - new Id("j"), - new IntLiteral(1) + new FieldId( + false, + null, + new Id("j")), + new Binary( + new FieldId( + false, + null, + new Id("j")), + Operator.ADD, + new IntLiteral(1) + ) ), new Block( List.of(), List.of( new Assignment( - new Id("x"), + new FieldId( + true, + null, + new Id("x")), new Binary( new Id("x"), Operator.MUL, @@ -112,6 +140,7 @@ public class AbstractSyntax_ClassWithConstructor { ) ) ) + ); Block block = new Block( localVariables, diff --git a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructorAndMethodCall.java b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructorAndMethodCall.java index e644748..3514a81 100644 --- a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructorAndMethodCall.java +++ b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructorAndMethodCall.java @@ -53,7 +53,10 @@ public class AbstractSyntax_ClassWithConstructorAndMethodCall { List.of(), List.of( new Assignment( - new Id("x"), + new FieldId( + true, + null, + new Id("x")), new IntLiteral(10) ), new While( @@ -67,7 +70,10 @@ public class AbstractSyntax_ClassWithConstructorAndMethodCall { List.of(), List.of( new Assignment( - new Id("x"), + new FieldId( + true, + null, + new Id("x")), new Binary( new Id("x"), Operator.MUL, diff --git a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructorWithParameters.java b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructorWithParameters.java index 57fb4f3..eba9cea 100644 --- a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructorWithParameters.java +++ b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithConstructorWithParameters.java @@ -57,7 +57,10 @@ public class AbstractSyntax_ClassWithConstructorWithParameters { List.of(), List.of( new Assignment( - new Id("x"), + new FieldId( + true, + null, + new Id("x")), new Id("startValue") ), new While( @@ -75,12 +78,15 @@ public class AbstractSyntax_ClassWithConstructorWithParameters { ), List.of( new Assignment( - new Id("innerRepetitions"), + new FieldId( + false, + null, + new Id("innerRepetitions")), new Id("x") ), new While( new Binary( - new Id("repetitions"), + new Id("innerRepetitions"), Operator.GT, new IntLiteral(0) ), @@ -88,7 +94,10 @@ public class AbstractSyntax_ClassWithConstructorWithParameters { List.of(), List.of( new Assignment( - new Id("x"), + new FieldId( + true, + null, + new Id("x")), new Binary( new Id("x"), Operator.MUL, @@ -96,7 +105,10 @@ public class AbstractSyntax_ClassWithConstructorWithParameters { ) ), new Assignment( - new Id("innerRepetitions"), + new FieldId( + false, + null, + new Id("innerRepetitions")), new Binary(new Id("innerRepetitions"), Operator.SUB, new IntLiteral(1)) @@ -106,7 +118,10 @@ public class AbstractSyntax_ClassWithConstructorWithParameters { ) ), new Assignment( - new Id("repetitions"), + new FieldId( + false, + null, + new Id("repetitions")), new Binary(new Id("repetitions"), Operator.SUB, new IntLiteral(1) diff --git a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMethodAndField.java b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMethodAndField.java index c05eff0..58c966f 100644 --- a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMethodAndField.java +++ b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMethodAndField.java @@ -53,7 +53,10 @@ class AbstractSyntax_ClassWithMethodAndField { List.of(), List.of( new Assignment( - new Id("c"), + new FieldId( + true, + null, + new Id("c")), new Id("character") ) ) diff --git a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMoreComplexMethodAndMain.java b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMoreComplexMethodAndMain.java index 25b8d3e..4bb480c 100644 --- a/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMoreComplexMethodAndMain.java +++ b/src/main/resources/AbstractSyntax/AbstractSyntax_ClassWithMoreComplexMethodAndMain.java @@ -63,11 +63,17 @@ public class AbstractSyntax_ClassWithMoreComplexMethodAndMain { ), List.of( new Assignment( - new Id("i"), + new FieldId( + false, + null, + new Id("i")), new IntLiteral(11) ), new Assignment( - new Id("returnValue"), + new FieldId( + false, + null, + new Id("returnValue")), new BoolLiteral(false) ), new While( @@ -80,14 +86,20 @@ public class AbstractSyntax_ClassWithMoreComplexMethodAndMain { List.of(), List.of( new Assignment( - new Id("i"), + new FieldId( + true, + null, + new Id("i")), new Binary(new Id("i"), Operator.SUB, new IntLiteral(1)) ), new Assignment( - new Id("returnValue"), + new FieldId( + false, + null, + new Id("returnValue")), new Unary( UnaryOperator.NOT, new Id("returnValue") @@ -115,7 +127,10 @@ public class AbstractSyntax_ClassWithMoreComplexMethodAndMain { TypeClassWithMoreComplexMethodAndMain.setObjectType(new Id("ClassWithMoreComplexMethodAndMain")); List statementList = List.of( new Assignment( - new Id("instance"), + new FieldId( + true, + null, + new Id("instance")), new New( TypeClassWithMoreComplexMethodAndMain, List.of()