Commit de631d9c authored by updjx's avatar updjx

10 test cases

parent 52750a64
/**
* TODO 2 testcases?
*/
class semanticClass {
class CompareClassAttributes {
public A objectA;
public B object B;
Please register or sign in to reply
publis static void main(String Args[]) {
public static void main(String args[]) {
Please register or sign in to reply
objectA.init();
objectB.init();
......
class semanticAlgorithm {
/**
* Check if attribute can be initializsed with expression and then used for initializing other local variable
*/
class LocalVariableOverwriteAttribute {
public int varInt;
......@@ -8,20 +11,8 @@ class semanticAlgorithm {
int localVar = varInt;
localVar = varInt + 4;
int counter = 0;
while (localVar != 0) {
counter++;
localVar--;
}
System.out.prntln(counter);
//is System global and in standart miniJava?
Please register or sign in to reply
//System.out.println(localVar)
Please register or sign in to reply
}
......
/**
* Check if local variable can be initializsed with class
*/
class localInitClass {
public int algorithm() {
TestlocalVar = Test;
}
}
//maybe as inner class?
  • /* maybe as inner class? */

    There are no inner classes in MiniJava?

Please register or sign in to reply
class Test{
}
\ No newline at end of file
class semanticAlgorithm {
public int algorithm() {
int localVar = varInt;
int counter = 0;
while (localVar != 0) {
counter++;
localVar--;
}
return counter;
}
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment