mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-28 17:28:03 +00:00
added what can be typed
This commit is contained in:
parent
5a5b467407
commit
a38ea3ad02
@ -14,7 +14,7 @@ import java.io.IOException;
|
||||
* Decaf language Compiler
|
||||
*/
|
||||
public class Compiler {
|
||||
|
||||
/*
|
||||
public static void main(String[] args) {
|
||||
generateAST("""
|
||||
public class ClassWithConstructorWithParameters {
|
||||
@ -33,7 +33,7 @@ public class Compiler {
|
||||
}
|
||||
}
|
||||
""");
|
||||
}
|
||||
} */
|
||||
|
||||
public static Class generateAST(String fromSource) {
|
||||
CharStream input = CharStreams.fromString(fromSource);
|
||||
@ -83,7 +83,7 @@ public class Compiler {
|
||||
CodeGenUtils.writeClassfile(bytes, classname);
|
||||
}
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// generateByteCodeFileFromFile("src/main/resources/JavaTestfiles/ClassWithConstructor.java", "ClassWithConstructor");
|
||||
// }
|
||||
public static void main(String[] args) {
|
||||
generateByteCodeFileFromFile("src/main/resources/JavaTestfiles/ClassCanBeTyped.java", "ClassCanBeTyped");
|
||||
}
|
||||
}
|
||||
|
@ -17,11 +17,6 @@ public class ClassCanBeTyped {
|
||||
this.y = this.y + 1;
|
||||
} while (this.y < 10)
|
||||
|
||||
if(this.x > 10) {
|
||||
this.x = 10;
|
||||
} else {
|
||||
this.x = 20;
|
||||
}
|
||||
int k;
|
||||
k = 0;
|
||||
for (k = 0; k < 10; k = k + 1) {
|
||||
@ -31,21 +26,14 @@ public class ClassCanBeTyped {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public ClassCanBeTyped(int x, int y, char z) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
|
||||
}
|
||||
public int getY() {
|
||||
return this.y;
|
||||
}
|
||||
public int getX() {
|
||||
return this.x;
|
||||
}
|
||||
|
||||
public char getZ() {
|
||||
return this.z;
|
||||
public int getX(char z) {
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user