diff options
author | bd-912 <bdunahu@colostate.edu> | 2024-05-03 17:50:02 -0600 |
---|---|---|
committer | bd-912 <bdunahu@colostate.edu> | 2024-05-03 17:50:02 -0600 |
commit | 8b481ec08efa60d462897a98bec3f6761c2933d1 (patch) | |
tree | 04e43861a364b8a9fe052057412f0c852c3ce334 /output/ex51.java | |
parent | e8be6dd157bed1b09312aa360ec8ee2f41813d0f (diff) |
Move creating temporaries to Expression statements in BoilVisitor
Diffstat (limited to 'output/ex51.java')
-rw-r--r-- | output/ex51.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/output/ex51.java b/output/ex51.java new file mode 100644 index 0000000..96a5d5a --- /dev/null +++ b/output/ex51.java @@ -0,0 +1,31 @@ +class ex51{ + public static void main(String[] a){ + System.out.println(new Test().start()); + } +} + +class Test { + + Test test; + int[] i; + + public int setval(int pos, int val) { i[pos] = val; return 0; } + public int getval(int pos) { int val; val = i[pos]; return val; } + + public int start(){ + Test foo; + int val; + foo = this; + i = new int[10]; + + test = (new Test()).next(); + val = foo.setval(2, 42); + test = this; + val = test.getval(2); + return val; + } + + public Test next() { + return test; + } +} |