diff options
author | bd-912 <bdunahu@colostate.edu> | 2024-04-26 15:50:38 -0600 |
---|---|---|
committer | bd-912 <bdunahu@colostate.edu> | 2024-04-26 15:50:38 -0600 |
commit | 1851f5e76018ec1df3b55dce6cc9a64c9497bf7a (patch) | |
tree | 30f629f7b137a494d4202487f4e22df2d9456481 | |
parent | 012298517078170762112abe2654dc69b2f146e1 (diff) |
Rearrange directory structure
-rw-r--r-- | J2V.java | 2 | ||||
-rw-r--r-- | Typecheck.java | 2 | ||||
-rw-r--r-- | V2VM.java | 2 | ||||
-rw-r--r-- | base/BinaryTree-error.java (renamed from typecheck/tests/BinaryTree-error.java) | 0 | ||||
-rw-r--r-- | base/BinaryTree.java (renamed from boil/tests/BinaryTree.java) | 0 | ||||
-rw-r--r-- | base/BinaryTree.names.vaporm (renamed from vaporize/tests/BinaryTree.names.vaporm) | 0 | ||||
-rw-r--r-- | base/BinaryTree.opt.names.vaporm (renamed from vaporize/tests/BinaryTree.opt.names.vaporm) | 0 | ||||
-rw-r--r-- | base/BinaryTree.opt.regalloc (renamed from vaporize/tests/BinaryTree.opt.regalloc) | 0 | ||||
-rw-r--r-- | base/BinaryTree.opt.vapor (renamed from vaporize/tests/BinaryTree.opt.vapor) | 0 | ||||
-rw-r--r-- | base/BinaryTree.opt.vaporm (renamed from vaporize/tests/BinaryTree.opt.vaporm) | 0 | ||||
-rw-r--r-- | base/BinaryTree.regalloc (renamed from vaporize/tests/BinaryTree.regalloc) | 0 | ||||
-rw-r--r-- | base/BinaryTree.vapor (renamed from vaporize/tests/BinaryTree.vapor) | 0 | ||||
-rw-r--r-- | base/BinaryTree.vaporm (renamed from vaporize/tests/BinaryTree.vaporm) | 0 | ||||
-rw-r--r-- | base/Branch-error.java (renamed from typecheck/tests/Branch-error.java) | 0 | ||||
-rw-r--r-- | base/Branch.java (renamed from typecheck/tests/Branch.java) | 0 | ||||
-rw-r--r-- | base/BubbleSort-error.java (renamed from typecheck/tests/BubbleSort-error.java) | 0 | ||||
-rw-r--r-- | base/BubbleSort.java (renamed from boil/tests/BubbleSort.java) | 0 | ||||
-rw-r--r-- | base/BubbleSort.names.vaporm (renamed from vaporize/tests/BubbleSort.names.vaporm) | 0 | ||||
-rw-r--r-- | base/BubbleSort.opt.names.vaporm (renamed from vaporize/tests/BubbleSort.opt.names.vaporm) | 0 | ||||
-rw-r--r-- | base/BubbleSort.opt.regalloc (renamed from vaporize/tests/BubbleSort.opt.regalloc) | 0 | ||||
-rw-r--r-- | base/BubbleSort.opt.vapor (renamed from vaporize/tests/BubbleSort.opt.vapor) | 0 | ||||
-rw-r--r-- | base/BubbleSort.opt.vaporm (renamed from vaporize/tests/BubbleSort.opt.vaporm) | 0 | ||||
-rw-r--r-- | base/BubbleSort.regalloc (renamed from vaporize/tests/BubbleSort.regalloc) | 0 | ||||
-rw-r--r-- | base/BubbleSort.vapor (renamed from vaporize/tests/BubbleSort.vapor) | 0 | ||||
-rw-r--r-- | base/BubbleSort.vaporm (renamed from vaporize/tests/BubbleSort.vaporm) | 0 | ||||
-rw-r--r-- | base/DeclareNone.java (renamed from typecheck/tests/DeclareNone.java) | 0 | ||||
-rw-r--r-- | base/Empty.java (renamed from typecheck/tests/Empty.java) | 0 | ||||
-rw-r--r-- | base/Factorial-error.java (renamed from typecheck/tests/Factorial-error.java) | 0 | ||||
-rw-r--r-- | base/Factorial.java (renamed from boil/tests/Factorial.java) | 0 | ||||
-rw-r--r-- | base/Factorial.names.vaporm (renamed from vaporize/tests/Factorial.names.vaporm) | 0 | ||||
-rw-r--r-- | base/Factorial.opt.names.vaporm (renamed from vaporize/tests/Factorial.opt.names.vaporm) | 0 | ||||
-rw-r--r-- | base/Factorial.opt.regalloc (renamed from vaporize/tests/Factorial.opt.regalloc) | 0 | ||||
-rw-r--r-- | base/Factorial.opt.vapor (renamed from vaporize/tests/Factorial.opt.vapor) | 0 | ||||
-rw-r--r-- | base/Factorial.opt.vaporm (renamed from vaporize/tests/Factorial.opt.vaporm) | 0 | ||||
-rw-r--r-- | base/Factorial.regalloc (renamed from vaporize/tests/Factorial.regalloc) | 0 | ||||
-rw-r--r-- | base/Factorial.vapor (renamed from vaporize/tests/Factorial.vapor) | 0 | ||||
-rw-r--r-- | base/Factorial.vaporm (renamed from vaporize/tests/Factorial.vaporm) | 0 | ||||
-rw-r--r-- | base/FactorialEdit.java (renamed from typecheck/tests/FactorialEdit.java) | 0 | ||||
-rw-r--r-- | base/IsPositive.java (renamed from typecheck/tests/IsPositive.java) | 0 | ||||
-rw-r--r-- | base/LinearSearch-error.java (renamed from typecheck/tests/LinearSearch-error.java) | 0 | ||||
-rw-r--r-- | base/LinearSearch.java (renamed from boil/tests/LinearSearch.java) | 0 | ||||
-rw-r--r-- | base/LinearSearch.names.vaporm (renamed from vaporize/tests/LinearSearch.names.vaporm) | 0 | ||||
-rw-r--r-- | base/LinearSearch.opt.names.vaporm (renamed from vaporize/tests/LinearSearch.opt.names.vaporm) | 0 | ||||
-rw-r--r-- | base/LinearSearch.opt.regalloc (renamed from vaporize/tests/LinearSearch.opt.regalloc) | 0 | ||||
-rw-r--r-- | base/LinearSearch.opt.vapor (renamed from vaporize/tests/LinearSearch.opt.vapor) | 0 | ||||
-rw-r--r-- | base/LinearSearch.opt.vaporm (renamed from vaporize/tests/LinearSearch.opt.vaporm) | 0 | ||||
-rw-r--r-- | base/LinearSearch.regalloc (renamed from vaporize/tests/LinearSearch.regalloc) | 0 | ||||
-rw-r--r-- | base/LinearSearch.vapor (renamed from vaporize/tests/LinearSearch.vapor) | 0 | ||||
-rw-r--r-- | base/LinearSearch.vaporm (renamed from vaporize/tests/LinearSearch.vaporm) | 0 | ||||
-rw-r--r-- | base/LinkedList-error.java (renamed from typecheck/tests/LinkedList-error.java) | 0 | ||||
-rw-r--r-- | base/LinkedList.java (renamed from boil/tests/LinkedList.java) | 0 | ||||
-rw-r--r-- | base/LinkedList.names.vaporm (renamed from vaporize/tests/LinkedList.names.vaporm) | 0 | ||||
-rw-r--r-- | base/LinkedList.opt.names.vaporm (renamed from vaporize/tests/LinkedList.opt.names.vaporm) | 0 | ||||
-rw-r--r-- | base/LinkedList.opt.regalloc (renamed from vaporize/tests/LinkedList.opt.regalloc) | 0 | ||||
-rw-r--r-- | base/LinkedList.opt.vapor (renamed from vaporize/tests/LinkedList.opt.vapor) | 0 | ||||
-rw-r--r-- | base/LinkedList.opt.vaporm (renamed from vaporize/tests/LinkedList.opt.vaporm) | 0 | ||||
-rw-r--r-- | base/LinkedList.regalloc (renamed from vaporize/tests/LinkedList.regalloc) | 0 | ||||
-rw-r--r-- | base/LinkedList.vapor (renamed from vaporize/tests/LinkedList.vapor) | 0 | ||||
-rw-r--r-- | base/LinkedList.vaporm (renamed from vaporize/tests/LinkedList.vaporm) | 0 | ||||
-rw-r--r-- | base/MoreThan4-error.java (renamed from typecheck/tests/MoreThan4-error.java) | 0 | ||||
-rw-r--r-- | base/MoreThan4.java (renamed from boil/tests/MoreThan4.java) | 0 | ||||
-rw-r--r-- | base/MoreThan4.names.vaporm (renamed from vaporize/tests/MoreThan4.names.vaporm) | 0 | ||||
-rw-r--r-- | base/MoreThan4.opt.names.vaporm (renamed from vaporize/tests/MoreThan4.opt.names.vaporm) | 0 | ||||
-rw-r--r-- | base/MoreThan4.opt.regalloc (renamed from vaporize/tests/MoreThan4.opt.regalloc) | 0 | ||||
-rw-r--r-- | base/MoreThan4.opt.vapor (renamed from vaporize/tests/MoreThan4.opt.vapor) | 0 | ||||
-rw-r--r-- | base/MoreThan4.opt.vaporm (renamed from vaporize/tests/MoreThan4.opt.vaporm) | 0 | ||||
-rw-r--r-- | base/MoreThan4.regalloc (renamed from vaporize/tests/MoreThan4.regalloc) | 0 | ||||
-rw-r--r-- | base/MoreThan4.vapor (renamed from vaporize/tests/MoreThan4.vapor) | 0 | ||||
-rw-r--r-- | base/MoreThan4.vaporm (renamed from vaporize/tests/MoreThan4.vaporm) | 0 | ||||
-rw-r--r-- | base/NewNone.java (renamed from typecheck/tests/NewNone.java) | 0 | ||||
-rw-r--r-- | base/Operator.java (renamed from typecheck/tests/Operator.java) | 0 | ||||
-rw-r--r-- | base/Printer-error.java (renamed from typecheck/tests/Printer-error.java) | 0 | ||||
-rw-r--r-- | base/Printer.java (renamed from typecheck/tests/Printer.java) | 0 | ||||
-rw-r--r-- | base/QuickSort-error.java (renamed from typecheck/tests/QuickSort-error.java) | 0 | ||||
-rw-r--r-- | base/QuickSort.java (renamed from boil/tests/QuickSort.java) | 0 | ||||
-rw-r--r-- | base/QuickSort.names.vaporm (renamed from vaporize/tests/QuickSort.names.vaporm) | 0 | ||||
-rw-r--r-- | base/QuickSort.opt.names.vaporm (renamed from vaporize/tests/QuickSort.opt.names.vaporm) | 0 | ||||
-rw-r--r-- | base/QuickSort.opt.regalloc (renamed from vaporize/tests/QuickSort.opt.regalloc) | 0 | ||||
-rw-r--r-- | base/QuickSort.opt.vapor (renamed from vaporize/tests/QuickSort.opt.vapor) | 0 | ||||
-rw-r--r-- | base/QuickSort.opt.vaporm (renamed from vaporize/tests/QuickSort.opt.vaporm) | 0 | ||||
-rw-r--r-- | base/QuickSort.regalloc (renamed from vaporize/tests/QuickSort.regalloc) | 0 | ||||
-rw-r--r-- | base/QuickSort.vapor (renamed from vaporize/tests/QuickSort.vapor) | 0 | ||||
-rw-r--r-- | base/QuickSort.vaporm (renamed from vaporize/tests/QuickSort.vaporm) | 0 | ||||
-rw-r--r-- | base/RetrieveInteger.java (renamed from typecheck/tests/RetrieveInteger.java) | 0 | ||||
-rw-r--r-- | base/ShortCircuit.opt.vapor (renamed from vaporize/tests/ShortCircuit.opt.vapor) | 0 | ||||
-rw-r--r-- | base/ShortCircuit.vapor (renamed from vaporize/tests/ShortCircuit.vapor) | 0 | ||||
-rw-r--r-- | base/SimpleArithmetic.java (renamed from typecheck/tests/SimpleArithmetic.java) | 0 | ||||
-rw-r--r-- | base/SimpleArray-error.java (renamed from typecheck/tests/SimpleArray-error.java) | 0 | ||||
-rw-r--r-- | base/SimpleArray.java (renamed from typecheck/tests/SimpleArray.java) | 0 | ||||
-rw-r--r-- | base/TreeVisitor-error.java (renamed from typecheck/tests/TreeVisitor-error.java) | 0 | ||||
-rw-r--r-- | base/TreeVisitor.java (renamed from boil/tests/TreeVisitor.java) | 0 | ||||
-rw-r--r-- | base/TreeVisitor.names.vaporm (renamed from vaporize/tests/TreeVisitor.names.vaporm) | 0 | ||||
-rw-r--r-- | base/TreeVisitor.opt.names.vaporm (renamed from vaporize/tests/TreeVisitor.opt.names.vaporm) | 0 | ||||
-rw-r--r-- | base/TreeVisitor.opt.regalloc (renamed from vaporize/tests/TreeVisitor.opt.regalloc) | 0 | ||||
-rw-r--r-- | base/TreeVisitor.opt.vapor (renamed from vaporize/tests/TreeVisitor.opt.vapor) | 0 | ||||
-rw-r--r-- | base/TreeVisitor.opt.vaporm (renamed from vaporize/tests/TreeVisitor.opt.vaporm) | 0 | ||||
-rw-r--r-- | base/TreeVisitor.regalloc (renamed from vaporize/tests/TreeVisitor.regalloc) | 0 | ||||
-rw-r--r-- | base/TreeVisitor.vapor (renamed from vaporize/tests/TreeVisitor.vapor) | 0 | ||||
-rw-r--r-- | base/TreeVisitor.vaporm (renamed from vaporize/tests/TreeVisitor.vaporm) | 0 | ||||
-rw-r--r-- | base/ex29.java (renamed from boil/tests/ex29.java) | 0 | ||||
-rw-r--r-- | base/ex30.java (renamed from boil/tests/ex30.java) | 0 | ||||
-rw-r--r-- | base/ex31.java (renamed from boil/tests/ex31.java) | 0 | ||||
-rw-r--r-- | base/ex32.java (renamed from boil/tests/ex32.java) | 0 | ||||
-rw-r--r-- | base/ex33.java (renamed from boil/tests/ex33.java) | 0 | ||||
-rw-r--r-- | base/ex34.java (renamed from boil/tests/ex34.java) | 0 | ||||
-rw-r--r-- | base/ex35.java (renamed from boil/tests/ex35.java) | 0 | ||||
-rw-r--r-- | base/ex36.java (renamed from boil/tests/ex36.java) | 0 | ||||
-rw-r--r-- | base/ex37.java (renamed from boil/tests/ex37.java) | 0 | ||||
-rw-r--r-- | base/ex38.java (renamed from boil/tests/ex38.java) | 0 | ||||
-rw-r--r-- | base/ex39.java (renamed from boil/tests/ex39.java) | 0 | ||||
-rw-r--r-- | base/ex40.java (renamed from boil/tests/ex40.java) | 0 | ||||
-rw-r--r-- | base/ex41.java (renamed from boil/tests/ex41.java) | 0 | ||||
-rw-r--r-- | base/ex42.java (renamed from boil/tests/ex42.java) | 0 | ||||
-rw-r--r-- | base/ex43.java (renamed from boil/tests/ex43.java) | 0 | ||||
-rw-r--r-- | base/ex44.java (renamed from boil/tests/ex44.java) | 0 | ||||
-rw-r--r-- | base/ex45.java (renamed from boil/tests/ex45.java) | 0 | ||||
-rw-r--r-- | base/ex46.java (renamed from boil/tests/ex46.java) | 0 | ||||
-rw-r--r-- | base/ex47.java (renamed from boil/tests/ex47.java) | 0 | ||||
-rw-r--r-- | base/ex48.java (renamed from boil/tests/ex48.java) | 0 | ||||
-rw-r--r-- | base/ex49.java (renamed from boil/tests/ex49.java) | 0 | ||||
-rw-r--r-- | base/ex50.java (renamed from boil/tests/ex50.java) | 0 | ||||
-rw-r--r-- | boil/BoilVisitor.java (renamed from boil/library/BoilVisitor.java) | 2 | ||||
-rw-r--r-- | boil/TypeFactory.java (renamed from boil/library/TypeFactory.java) | 2 | ||||
-rwxr-xr-x | test.sh | 2 | ||||
-rw-r--r-- | typecheck/TypeCheckSimp.java (renamed from typecheck/library/TypeCheckSimp.java) | 6 | ||||
-rw-r--r-- | typecheck/tests/BinaryTree.java | 334 | ||||
-rw-r--r-- | typecheck/tests/BubbleSort.java | 93 | ||||
-rw-r--r-- | typecheck/tests/Factorial.java | 16 | ||||
-rw-r--r-- | typecheck/tests/LinearSearch.java | 99 | ||||
-rw-r--r-- | typecheck/tests/LinkedList.java | 278 | ||||
-rw-r--r-- | typecheck/tests/MoreThan4.java | 29 | ||||
-rw-r--r-- | typecheck/tests/QuickSort.java | 112 | ||||
-rw-r--r-- | typecheck/tests/TreeVisitor.java | 374 | ||||
-rw-r--r-- | vaporize/Kettle.java (renamed from vaporize/library/Kettle.java) | 2 | ||||
-rw-r--r-- | vaporize/LIRDict.java (renamed from vaporize/library/LIRDict.java) | 2 | ||||
-rw-r--r-- | vaporize/LIRVar.java (renamed from vaporize/library/LIRVar.java) | 9 | ||||
-rw-r--r-- | vaporize/LIRVisitor.java (renamed from vaporize/library/LIRVisitor.java) | 2 | ||||
-rw-r--r-- | vaporize/RegisterAlloc.java (renamed from vaporize/library/RegisterAlloc.java) | 2 | ||||
-rw-r--r-- | vaporize/SpillEverywhere.java (renamed from vaporize/library/SpillEverywhere.java) | 2 | ||||
-rw-r--r-- | vaporize/TransientInterval.java (renamed from vaporize/library/TransientInterval.java) | 2 | ||||
-rw-r--r-- | vaporize/VaporizeVisitor.java (renamed from vaporize/library/VaporizeVisitor.java) | 4 | ||||
-rw-r--r-- | vaporize/tests/ex32.vapor | 15 | ||||
-rw-r--r-- | vaporize/tests/ex32.vaporm | 35 |
143 files changed, 22 insertions, 1406 deletions
@@ -5,7 +5,7 @@ import syntaxtree.*; import java.util.*; import st.*; import misc.*; -import boil.library.*; +import boil.*; public class J2V { public static void main(String[] args) { diff --git a/Typecheck.java b/Typecheck.java index 755ce36..8c4559b 100644 --- a/Typecheck.java +++ b/Typecheck.java @@ -5,7 +5,7 @@ import syntaxtree.*; import java.util.*; import st.*; import misc.*; -import typecheck.library.*; +import typecheck.*; public class Typecheck { public static void main(String[] args) { @@ -16,7 +16,7 @@ import java.util.Arrays; import cfg.*; import misc.*; -import vaporize.library.*; +import vaporize.*; public class V2VM { diff --git a/typecheck/tests/BinaryTree-error.java b/base/BinaryTree-error.java index d9be857..d9be857 100644 --- a/typecheck/tests/BinaryTree-error.java +++ b/base/BinaryTree-error.java diff --git a/boil/tests/BinaryTree.java b/base/BinaryTree.java index 18d1464..18d1464 100644 --- a/boil/tests/BinaryTree.java +++ b/base/BinaryTree.java diff --git a/vaporize/tests/BinaryTree.names.vaporm b/base/BinaryTree.names.vaporm index e5785ee..e5785ee 100644 --- a/vaporize/tests/BinaryTree.names.vaporm +++ b/base/BinaryTree.names.vaporm diff --git a/vaporize/tests/BinaryTree.opt.names.vaporm b/base/BinaryTree.opt.names.vaporm index fa61f97..fa61f97 100644 --- a/vaporize/tests/BinaryTree.opt.names.vaporm +++ b/base/BinaryTree.opt.names.vaporm diff --git a/vaporize/tests/BinaryTree.opt.regalloc b/base/BinaryTree.opt.regalloc index 635f436..635f436 100644 --- a/vaporize/tests/BinaryTree.opt.regalloc +++ b/base/BinaryTree.opt.regalloc diff --git a/vaporize/tests/BinaryTree.opt.vapor b/base/BinaryTree.opt.vapor index ef6ac4e..ef6ac4e 100644 --- a/vaporize/tests/BinaryTree.opt.vapor +++ b/base/BinaryTree.opt.vapor diff --git a/vaporize/tests/BinaryTree.opt.vaporm b/base/BinaryTree.opt.vaporm index f3bee43..f3bee43 100644 --- a/vaporize/tests/BinaryTree.opt.vaporm +++ b/base/BinaryTree.opt.vaporm diff --git a/vaporize/tests/BinaryTree.regalloc b/base/BinaryTree.regalloc index 68a8265..68a8265 100644 --- a/vaporize/tests/BinaryTree.regalloc +++ b/base/BinaryTree.regalloc diff --git a/vaporize/tests/BinaryTree.vapor b/base/BinaryTree.vapor index 275cfe3..275cfe3 100644 --- a/vaporize/tests/BinaryTree.vapor +++ b/base/BinaryTree.vapor diff --git a/vaporize/tests/BinaryTree.vaporm b/base/BinaryTree.vaporm index ad25de5..ad25de5 100644 --- a/vaporize/tests/BinaryTree.vaporm +++ b/base/BinaryTree.vaporm diff --git a/typecheck/tests/Branch-error.java b/base/Branch-error.java index bc58ff4..bc58ff4 100644 --- a/typecheck/tests/Branch-error.java +++ b/base/Branch-error.java diff --git a/typecheck/tests/Branch.java b/base/Branch.java index 43df01f..43df01f 100644 --- a/typecheck/tests/Branch.java +++ b/base/Branch.java diff --git a/typecheck/tests/BubbleSort-error.java b/base/BubbleSort-error.java index 97a1c1d..97a1c1d 100644 --- a/typecheck/tests/BubbleSort-error.java +++ b/base/BubbleSort-error.java diff --git a/boil/tests/BubbleSort.java b/base/BubbleSort.java index e5645a9..e5645a9 100644 --- a/boil/tests/BubbleSort.java +++ b/base/BubbleSort.java diff --git a/vaporize/tests/BubbleSort.names.vaporm b/base/BubbleSort.names.vaporm index 9984ffe..9984ffe 100644 --- a/vaporize/tests/BubbleSort.names.vaporm +++ b/base/BubbleSort.names.vaporm diff --git a/vaporize/tests/BubbleSort.opt.names.vaporm b/base/BubbleSort.opt.names.vaporm index 943b295..943b295 100644 --- a/vaporize/tests/BubbleSort.opt.names.vaporm +++ b/base/BubbleSort.opt.names.vaporm diff --git a/vaporize/tests/BubbleSort.opt.regalloc b/base/BubbleSort.opt.regalloc index 5696e19..5696e19 100644 --- a/vaporize/tests/BubbleSort.opt.regalloc +++ b/base/BubbleSort.opt.regalloc diff --git a/vaporize/tests/BubbleSort.opt.vapor b/base/BubbleSort.opt.vapor index a118894..a118894 100644 --- a/vaporize/tests/BubbleSort.opt.vapor +++ b/base/BubbleSort.opt.vapor diff --git a/vaporize/tests/BubbleSort.opt.vaporm b/base/BubbleSort.opt.vaporm index 41c6ac4..41c6ac4 100644 --- a/vaporize/tests/BubbleSort.opt.vaporm +++ b/base/BubbleSort.opt.vaporm diff --git a/vaporize/tests/BubbleSort.regalloc b/base/BubbleSort.regalloc index bd27d17..bd27d17 100644 --- a/vaporize/tests/BubbleSort.regalloc +++ b/base/BubbleSort.regalloc diff --git a/vaporize/tests/BubbleSort.vapor b/base/BubbleSort.vapor index cedba69..cedba69 100644 --- a/vaporize/tests/BubbleSort.vapor +++ b/base/BubbleSort.vapor diff --git a/vaporize/tests/BubbleSort.vaporm b/base/BubbleSort.vaporm index f64e2b3..f64e2b3 100644 --- a/vaporize/tests/BubbleSort.vaporm +++ b/base/BubbleSort.vaporm diff --git a/typecheck/tests/DeclareNone.java b/base/DeclareNone.java index 0790056..0790056 100644 --- a/typecheck/tests/DeclareNone.java +++ b/base/DeclareNone.java diff --git a/typecheck/tests/Empty.java b/base/Empty.java index 975ac63..975ac63 100644 --- a/typecheck/tests/Empty.java +++ b/base/Empty.java diff --git a/typecheck/tests/Factorial-error.java b/base/Factorial-error.java index 46ec59a..46ec59a 100644 --- a/typecheck/tests/Factorial-error.java +++ b/base/Factorial-error.java diff --git a/boil/tests/Factorial.java b/base/Factorial.java index d938bb6..d938bb6 100644 --- a/boil/tests/Factorial.java +++ b/base/Factorial.java diff --git a/vaporize/tests/Factorial.names.vaporm b/base/Factorial.names.vaporm index 7c2c2d7..7c2c2d7 100644 --- a/vaporize/tests/Factorial.names.vaporm +++ b/base/Factorial.names.vaporm diff --git a/vaporize/tests/Factorial.opt.names.vaporm b/base/Factorial.opt.names.vaporm index bbc6604..bbc6604 100644 --- a/vaporize/tests/Factorial.opt.names.vaporm +++ b/base/Factorial.opt.names.vaporm diff --git a/vaporize/tests/Factorial.opt.regalloc b/base/Factorial.opt.regalloc index 21e46f5..21e46f5 100644 --- a/vaporize/tests/Factorial.opt.regalloc +++ b/base/Factorial.opt.regalloc diff --git a/vaporize/tests/Factorial.opt.vapor b/base/Factorial.opt.vapor index aca17fe..aca17fe 100644 --- a/vaporize/tests/Factorial.opt.vapor +++ b/base/Factorial.opt.vapor diff --git a/vaporize/tests/Factorial.opt.vaporm b/base/Factorial.opt.vaporm index fb5f8e6..fb5f8e6 100644 --- a/vaporize/tests/Factorial.opt.vaporm +++ b/base/Factorial.opt.vaporm diff --git a/vaporize/tests/Factorial.regalloc b/base/Factorial.regalloc index e07e8d1..e07e8d1 100644 --- a/vaporize/tests/Factorial.regalloc +++ b/base/Factorial.regalloc diff --git a/vaporize/tests/Factorial.vapor b/base/Factorial.vapor index 28e1126..28e1126 100644 --- a/vaporize/tests/Factorial.vapor +++ b/base/Factorial.vapor diff --git a/vaporize/tests/Factorial.vaporm b/base/Factorial.vaporm index a7e981c..a7e981c 100644 --- a/vaporize/tests/Factorial.vaporm +++ b/base/Factorial.vaporm diff --git a/typecheck/tests/FactorialEdit.java b/base/FactorialEdit.java index 919ed82..919ed82 100644 --- a/typecheck/tests/FactorialEdit.java +++ b/base/FactorialEdit.java diff --git a/typecheck/tests/IsPositive.java b/base/IsPositive.java index 09bcf1d..09bcf1d 100644 --- a/typecheck/tests/IsPositive.java +++ b/base/IsPositive.java diff --git a/typecheck/tests/LinearSearch-error.java b/base/LinearSearch-error.java index f8c48fe..f8c48fe 100644 --- a/typecheck/tests/LinearSearch-error.java +++ b/base/LinearSearch-error.java diff --git a/boil/tests/LinearSearch.java b/base/LinearSearch.java index daddd94..daddd94 100644 --- a/boil/tests/LinearSearch.java +++ b/base/LinearSearch.java diff --git a/vaporize/tests/LinearSearch.names.vaporm b/base/LinearSearch.names.vaporm index 7dbe0c8..7dbe0c8 100644 --- a/vaporize/tests/LinearSearch.names.vaporm +++ b/base/LinearSearch.names.vaporm diff --git a/vaporize/tests/LinearSearch.opt.names.vaporm b/base/LinearSearch.opt.names.vaporm index de6b96a..de6b96a 100644 --- a/vaporize/tests/LinearSearch.opt.names.vaporm +++ b/base/LinearSearch.opt.names.vaporm diff --git a/vaporize/tests/LinearSearch.opt.regalloc b/base/LinearSearch.opt.regalloc index abfdfeb..abfdfeb 100644 --- a/vaporize/tests/LinearSearch.opt.regalloc +++ b/base/LinearSearch.opt.regalloc diff --git a/vaporize/tests/LinearSearch.opt.vapor b/base/LinearSearch.opt.vapor index 302de05..302de05 100644 --- a/vaporize/tests/LinearSearch.opt.vapor +++ b/base/LinearSearch.opt.vapor diff --git a/vaporize/tests/LinearSearch.opt.vaporm b/base/LinearSearch.opt.vaporm index 4fa8c5c..4fa8c5c 100644 --- a/vaporize/tests/LinearSearch.opt.vaporm +++ b/base/LinearSearch.opt.vaporm diff --git a/vaporize/tests/LinearSearch.regalloc b/base/LinearSearch.regalloc index 817df4f..817df4f 100644 --- a/vaporize/tests/LinearSearch.regalloc +++ b/base/LinearSearch.regalloc diff --git a/vaporize/tests/LinearSearch.vapor b/base/LinearSearch.vapor index db4884a..db4884a 100644 --- a/vaporize/tests/LinearSearch.vapor +++ b/base/LinearSearch.vapor diff --git a/vaporize/tests/LinearSearch.vaporm b/base/LinearSearch.vaporm index 094cfe1..094cfe1 100644 --- a/vaporize/tests/LinearSearch.vaporm +++ b/base/LinearSearch.vaporm diff --git a/typecheck/tests/LinkedList-error.java b/base/LinkedList-error.java index 181b599..181b599 100644 --- a/typecheck/tests/LinkedList-error.java +++ b/base/LinkedList-error.java diff --git a/boil/tests/LinkedList.java b/base/LinkedList.java index 69adc33..69adc33 100644 --- a/boil/tests/LinkedList.java +++ b/base/LinkedList.java diff --git a/vaporize/tests/LinkedList.names.vaporm b/base/LinkedList.names.vaporm index a04d039..a04d039 100644 --- a/vaporize/tests/LinkedList.names.vaporm +++ b/base/LinkedList.names.vaporm diff --git a/vaporize/tests/LinkedList.opt.names.vaporm b/base/LinkedList.opt.names.vaporm index e0b60f8..e0b60f8 100644 --- a/vaporize/tests/LinkedList.opt.names.vaporm +++ b/base/LinkedList.opt.names.vaporm diff --git a/vaporize/tests/LinkedList.opt.regalloc b/base/LinkedList.opt.regalloc index 30991e8..30991e8 100644 --- a/vaporize/tests/LinkedList.opt.regalloc +++ b/base/LinkedList.opt.regalloc diff --git a/vaporize/tests/LinkedList.opt.vapor b/base/LinkedList.opt.vapor index aaca62c..aaca62c 100644 --- a/vaporize/tests/LinkedList.opt.vapor +++ b/base/LinkedList.opt.vapor diff --git a/vaporize/tests/LinkedList.opt.vaporm b/base/LinkedList.opt.vaporm index b9bef66..b9bef66 100644 --- a/vaporize/tests/LinkedList.opt.vaporm +++ b/base/LinkedList.opt.vaporm diff --git a/vaporize/tests/LinkedList.regalloc b/base/LinkedList.regalloc index 7b3da4e..7b3da4e 100644 --- a/vaporize/tests/LinkedList.regalloc +++ b/base/LinkedList.regalloc diff --git a/vaporize/tests/LinkedList.vapor b/base/LinkedList.vapor index bebdf94..bebdf94 100644 --- a/vaporize/tests/LinkedList.vapor +++ b/base/LinkedList.vapor diff --git a/vaporize/tests/LinkedList.vaporm b/base/LinkedList.vaporm index 80c3a99..80c3a99 100644 --- a/vaporize/tests/LinkedList.vaporm +++ b/base/LinkedList.vaporm diff --git a/typecheck/tests/MoreThan4-error.java b/base/MoreThan4-error.java index 9e8f63e..9e8f63e 100644 --- a/typecheck/tests/MoreThan4-error.java +++ b/base/MoreThan4-error.java diff --git a/boil/tests/MoreThan4.java b/base/MoreThan4.java index 4960f01..4960f01 100644 --- a/boil/tests/MoreThan4.java +++ b/base/MoreThan4.java diff --git a/vaporize/tests/MoreThan4.names.vaporm b/base/MoreThan4.names.vaporm index 366618c..366618c 100644 --- a/vaporize/tests/MoreThan4.names.vaporm +++ b/base/MoreThan4.names.vaporm diff --git a/vaporize/tests/MoreThan4.opt.names.vaporm b/base/MoreThan4.opt.names.vaporm index a07f7e7..a07f7e7 100644 --- a/vaporize/tests/MoreThan4.opt.names.vaporm +++ b/base/MoreThan4.opt.names.vaporm diff --git a/vaporize/tests/MoreThan4.opt.regalloc b/base/MoreThan4.opt.regalloc index ceb8927..ceb8927 100644 --- a/vaporize/tests/MoreThan4.opt.regalloc +++ b/base/MoreThan4.opt.regalloc diff --git a/vaporize/tests/MoreThan4.opt.vapor b/base/MoreThan4.opt.vapor index a59d1b5..a59d1b5 100644 --- a/vaporize/tests/MoreThan4.opt.vapor +++ b/base/MoreThan4.opt.vapor diff --git a/vaporize/tests/MoreThan4.opt.vaporm b/base/MoreThan4.opt.vaporm index d1d663b..d1d663b 100644 --- a/vaporize/tests/MoreThan4.opt.vaporm +++ b/base/MoreThan4.opt.vaporm diff --git a/vaporize/tests/MoreThan4.regalloc b/base/MoreThan4.regalloc index 0748f62..0748f62 100644 --- a/vaporize/tests/MoreThan4.regalloc +++ b/base/MoreThan4.regalloc diff --git a/vaporize/tests/MoreThan4.vapor b/base/MoreThan4.vapor index 6067f8e..6067f8e 100644 --- a/vaporize/tests/MoreThan4.vapor +++ b/base/MoreThan4.vapor diff --git a/vaporize/tests/MoreThan4.vaporm b/base/MoreThan4.vaporm index bf549b2..bf549b2 100644 --- a/vaporize/tests/MoreThan4.vaporm +++ b/base/MoreThan4.vaporm diff --git a/typecheck/tests/NewNone.java b/base/NewNone.java index 7858853..7858853 100644 --- a/typecheck/tests/NewNone.java +++ b/base/NewNone.java diff --git a/typecheck/tests/Operator.java b/base/Operator.java index 732c905..732c905 100644 --- a/typecheck/tests/Operator.java +++ b/base/Operator.java diff --git a/typecheck/tests/Printer-error.java b/base/Printer-error.java index 3f6469f..3f6469f 100644 --- a/typecheck/tests/Printer-error.java +++ b/base/Printer-error.java diff --git a/typecheck/tests/Printer.java b/base/Printer.java index 3c4fa2f..3c4fa2f 100644 --- a/typecheck/tests/Printer.java +++ b/base/Printer.java diff --git a/typecheck/tests/QuickSort-error.java b/base/QuickSort-error.java index ff4ea2e..ff4ea2e 100644 --- a/typecheck/tests/QuickSort-error.java +++ b/base/QuickSort-error.java diff --git a/boil/tests/QuickSort.java b/base/QuickSort.java index 5893390..5893390 100644 --- a/boil/tests/QuickSort.java +++ b/base/QuickSort.java diff --git a/vaporize/tests/QuickSort.names.vaporm b/base/QuickSort.names.vaporm index 0029cf0..0029cf0 100644 --- a/vaporize/tests/QuickSort.names.vaporm +++ b/base/QuickSort.names.vaporm diff --git a/vaporize/tests/QuickSort.opt.names.vaporm b/base/QuickSort.opt.names.vaporm index 9946042..9946042 100644 --- a/vaporize/tests/QuickSort.opt.names.vaporm +++ b/base/QuickSort.opt.names.vaporm diff --git a/vaporize/tests/QuickSort.opt.regalloc b/base/QuickSort.opt.regalloc index cb7fb8c..cb7fb8c 100644 --- a/vaporize/tests/QuickSort.opt.regalloc +++ b/base/QuickSort.opt.regalloc diff --git a/vaporize/tests/QuickSort.opt.vapor b/base/QuickSort.opt.vapor index 6e14e5a..6e14e5a 100644 --- a/vaporize/tests/QuickSort.opt.vapor +++ b/base/QuickSort.opt.vapor diff --git a/vaporize/tests/QuickSort.opt.vaporm b/base/QuickSort.opt.vaporm index 61f1151..61f1151 100644 --- a/vaporize/tests/QuickSort.opt.vaporm +++ b/base/QuickSort.opt.vaporm diff --git a/vaporize/tests/QuickSort.regalloc b/base/QuickSort.regalloc index 02b4418..02b4418 100644 --- a/vaporize/tests/QuickSort.regalloc +++ b/base/QuickSort.regalloc diff --git a/vaporize/tests/QuickSort.vapor b/base/QuickSort.vapor index 3fe3798..3fe3798 100644 --- a/vaporize/tests/QuickSort.vapor +++ b/base/QuickSort.vapor diff --git a/vaporize/tests/QuickSort.vaporm b/base/QuickSort.vaporm index 2aaa582..2aaa582 100644 --- a/vaporize/tests/QuickSort.vaporm +++ b/base/QuickSort.vaporm diff --git a/typecheck/tests/RetrieveInteger.java b/base/RetrieveInteger.java index 1997e38..1997e38 100644 --- a/typecheck/tests/RetrieveInteger.java +++ b/base/RetrieveInteger.java diff --git a/vaporize/tests/ShortCircuit.opt.vapor b/base/ShortCircuit.opt.vapor index 8275acd..8275acd 100644 --- a/vaporize/tests/ShortCircuit.opt.vapor +++ b/base/ShortCircuit.opt.vapor diff --git a/vaporize/tests/ShortCircuit.vapor b/base/ShortCircuit.vapor index 31cc088..31cc088 100644 --- a/vaporize/tests/ShortCircuit.vapor +++ b/base/ShortCircuit.vapor diff --git a/typecheck/tests/SimpleArithmetic.java b/base/SimpleArithmetic.java index 94c780e..94c780e 100644 --- a/typecheck/tests/SimpleArithmetic.java +++ b/base/SimpleArithmetic.java diff --git a/typecheck/tests/SimpleArray-error.java b/base/SimpleArray-error.java index 61ff06f..61ff06f 100644 --- a/typecheck/tests/SimpleArray-error.java +++ b/base/SimpleArray-error.java diff --git a/typecheck/tests/SimpleArray.java b/base/SimpleArray.java index 9a98d99..9a98d99 100644 --- a/typecheck/tests/SimpleArray.java +++ b/base/SimpleArray.java diff --git a/typecheck/tests/TreeVisitor-error.java b/base/TreeVisitor-error.java index b41f3d1..b41f3d1 100644 --- a/typecheck/tests/TreeVisitor-error.java +++ b/base/TreeVisitor-error.java diff --git a/boil/tests/TreeVisitor.java b/base/TreeVisitor.java index 8debfe6..8debfe6 100644 --- a/boil/tests/TreeVisitor.java +++ b/base/TreeVisitor.java diff --git a/vaporize/tests/TreeVisitor.names.vaporm b/base/TreeVisitor.names.vaporm index 0eefb6e..0eefb6e 100644 --- a/vaporize/tests/TreeVisitor.names.vaporm +++ b/base/TreeVisitor.names.vaporm diff --git a/vaporize/tests/TreeVisitor.opt.names.vaporm b/base/TreeVisitor.opt.names.vaporm index 69a62c4..69a62c4 100644 --- a/vaporize/tests/TreeVisitor.opt.names.vaporm +++ b/base/TreeVisitor.opt.names.vaporm diff --git a/vaporize/tests/TreeVisitor.opt.regalloc b/base/TreeVisitor.opt.regalloc index 985ead2..985ead2 100644 --- a/vaporize/tests/TreeVisitor.opt.regalloc +++ b/base/TreeVisitor.opt.regalloc diff --git a/vaporize/tests/TreeVisitor.opt.vapor b/base/TreeVisitor.opt.vapor index dfa80a6..dfa80a6 100644 --- a/vaporize/tests/TreeVisitor.opt.vapor +++ b/base/TreeVisitor.opt.vapor diff --git a/vaporize/tests/TreeVisitor.opt.vaporm b/base/TreeVisitor.opt.vaporm index 0ff4fc4..0ff4fc4 100644 --- a/vaporize/tests/TreeVisitor.opt.vaporm +++ b/base/TreeVisitor.opt.vaporm diff --git a/vaporize/tests/TreeVisitor.regalloc b/base/TreeVisitor.regalloc index 3edb0c1..3edb0c1 100644 --- a/vaporize/tests/TreeVisitor.regalloc +++ b/base/TreeVisitor.regalloc diff --git a/vaporize/tests/TreeVisitor.vapor b/base/TreeVisitor.vapor index d8aa63b..d8aa63b 100644 --- a/vaporize/tests/TreeVisitor.vapor +++ b/base/TreeVisitor.vapor diff --git a/vaporize/tests/TreeVisitor.vaporm b/base/TreeVisitor.vaporm index 392cf0c..392cf0c 100644 --- a/vaporize/tests/TreeVisitor.vaporm +++ b/base/TreeVisitor.vaporm diff --git a/boil/tests/ex29.java b/base/ex29.java index 30ea154..30ea154 100644 --- a/boil/tests/ex29.java +++ b/base/ex29.java diff --git a/boil/tests/ex30.java b/base/ex30.java index 4a5064d..4a5064d 100644 --- a/boil/tests/ex30.java +++ b/base/ex30.java diff --git a/boil/tests/ex31.java b/base/ex31.java index d276e68..d276e68 100644 --- a/boil/tests/ex31.java +++ b/base/ex31.java diff --git a/boil/tests/ex32.java b/base/ex32.java index f38ef62..f38ef62 100644 --- a/boil/tests/ex32.java +++ b/base/ex32.java diff --git a/boil/tests/ex33.java b/base/ex33.java index d7f23ed..d7f23ed 100644 --- a/boil/tests/ex33.java +++ b/base/ex33.java diff --git a/boil/tests/ex34.java b/base/ex34.java index eb5b18f..eb5b18f 100644 --- a/boil/tests/ex34.java +++ b/base/ex34.java diff --git a/boil/tests/ex35.java b/base/ex35.java index 52585af..52585af 100644 --- a/boil/tests/ex35.java +++ b/base/ex35.java diff --git a/boil/tests/ex36.java b/base/ex36.java index 333bd7d..333bd7d 100644 --- a/boil/tests/ex36.java +++ b/base/ex36.java diff --git a/boil/tests/ex37.java b/base/ex37.java index 867116a..867116a 100644 --- a/boil/tests/ex37.java +++ b/base/ex37.java diff --git a/boil/tests/ex38.java b/base/ex38.java index 2a021eb..2a021eb 100644 --- a/boil/tests/ex38.java +++ b/base/ex38.java diff --git a/boil/tests/ex39.java b/base/ex39.java index 23526de..23526de 100644 --- a/boil/tests/ex39.java +++ b/base/ex39.java diff --git a/boil/tests/ex40.java b/base/ex40.java index f2f121d..f2f121d 100644 --- a/boil/tests/ex40.java +++ b/base/ex40.java diff --git a/boil/tests/ex41.java b/base/ex41.java index e07e962..e07e962 100644 --- a/boil/tests/ex41.java +++ b/base/ex41.java diff --git a/boil/tests/ex42.java b/base/ex42.java index 9ee7efa..9ee7efa 100644 --- a/boil/tests/ex42.java +++ b/base/ex42.java diff --git a/boil/tests/ex43.java b/base/ex43.java index 80657d9..80657d9 100644 --- a/boil/tests/ex43.java +++ b/base/ex43.java diff --git a/boil/tests/ex44.java b/base/ex44.java index 06c8d55..06c8d55 100644 --- a/boil/tests/ex44.java +++ b/base/ex44.java diff --git a/boil/tests/ex45.java b/base/ex45.java index 72f85d4..72f85d4 100644 --- a/boil/tests/ex45.java +++ b/base/ex45.java diff --git a/boil/tests/ex46.java b/base/ex46.java index 55724d6..55724d6 100644 --- a/boil/tests/ex46.java +++ b/base/ex46.java diff --git a/boil/tests/ex47.java b/base/ex47.java index ea4e342..ea4e342 100644 --- a/boil/tests/ex47.java +++ b/base/ex47.java diff --git a/boil/tests/ex48.java b/base/ex48.java index 21424ba..21424ba 100644 --- a/boil/tests/ex48.java +++ b/base/ex48.java diff --git a/boil/tests/ex49.java b/base/ex49.java index d28a887..d28a887 100644 --- a/boil/tests/ex49.java +++ b/base/ex49.java diff --git a/boil/tests/ex50.java b/base/ex50.java index 576af0e..576af0e 100644 --- a/boil/tests/ex50.java +++ b/base/ex50.java diff --git a/boil/library/BoilVisitor.java b/boil/BoilVisitor.java index 001b6e6..e8bafe3 100644 --- a/boil/library/BoilVisitor.java +++ b/boil/BoilVisitor.java @@ -1,4 +1,4 @@ -package boil.library; +package boil; import syntaxtree.*; import visitor.*; diff --git a/boil/library/TypeFactory.java b/boil/TypeFactory.java index ddf54c8..d5b61f3 100644 --- a/boil/library/TypeFactory.java +++ b/boil/TypeFactory.java @@ -1,4 +1,4 @@ -package boil.library; +package boil; import misc.*; import java.util.HashMap; @@ -20,7 +20,7 @@ case "$1" in ext="vaporm" ;; *) - echo "usage $0 [java|typecheck|boil|vaporize|condense]" + echo "usage $0 [typecheck|boil|vaporize|condense]" exit 1 ;; esac diff --git a/typecheck/library/TypeCheckSimp.java b/typecheck/TypeCheckSimp.java index b330c65..99fa187 100644 --- a/typecheck/library/TypeCheckSimp.java +++ b/typecheck/TypeCheckSimp.java @@ -1,4 +1,4 @@ -package typecheck.library; +package typecheck; import syntaxtree.*; import visitor.*; @@ -115,8 +115,8 @@ public class TypeCheckSimp extends GJDepthFirst<TypeInstance,SymbolTable> { for (int i=0; i < this.offset; ++i) str += "."; MinimalLogger.info(String.format("%sLeaving %s => %s", - str, - n.getClass().getSimpleName(), + str, + n.getClass().getSimpleName(), n.toString())); return null; } diff --git a/typecheck/tests/BinaryTree.java b/typecheck/tests/BinaryTree.java deleted file mode 100644 index 18d1464..0000000 --- a/typecheck/tests/BinaryTree.java +++ /dev/null @@ -1,334 +0,0 @@ -class BinaryTree{ - public static void main(String[] a){ - System.out.println(new BT().Start()); - } -} - - -// This class invokes the methods to create a tree, -// insert, delete and serach for elements on it -class BT { - - public int Start(){ - Tree root ; - boolean ntb ; - int nti ; - - root = new Tree(); - ntb = root.Init(16); - ntb = root.Print(); - System.out.println(100000000); - ntb = root.Insert(8) ; - ntb = root.Print(); - ntb = root.Insert(24) ; - ntb = root.Insert(4) ; - ntb = root.Insert(12) ; - ntb = root.Insert(20) ; - ntb = root.Insert(28) ; - ntb = root.Insert(14) ; - ntb = root.Print(); - System.out.println(root.Search(24)); - System.out.println(root.Search(12)); - System.out.println(root.Search(16)); - System.out.println(root.Search(50)); - System.out.println(root.Search(12)); - ntb = root.Delete(12); - ntb = root.Print(); - System.out.println(root.Search(12)); - - return 0 ; - } - -} - -class Tree{ - Tree left ; - Tree right; - int key ; - boolean has_left ; - boolean has_right ; - Tree my_null ; - - // Initialize a node with a key value and no children - public boolean Init(int v_key){ - key = v_key ; - has_left = false ; - has_right = false ; - return true ; - } - - // Update the right child with rn - public boolean SetRight(Tree rn){ - right = rn ; - return true ; - } - - // Update the left child with ln - public boolean SetLeft(Tree ln){ - left = ln ; - return true ; - } - - public Tree GetRight(){ - return right ; - } - - public Tree GetLeft(){ - return left; - } - - public int GetKey(){ - return key ; - } - - public boolean SetKey(int v_key){ - key = v_key ; - return true ; - } - - public boolean GetHas_Right(){ - return has_right ; - } - - public boolean GetHas_Left(){ - return has_left ; - } - - public boolean SetHas_Left(boolean val){ - has_left = val ; - return true ; - } - - public boolean SetHas_Right(boolean val){ - has_right = val ; - return true ; - } - - // This method compares two integers and - // returns true if they are equal and false - // otherwise - public boolean Compare(int num1 , int num2){ - boolean ntb ; - int nti ; - - ntb = false ; - nti = num2 + 1 ; - if (num1 < num2) ntb = false ; - else if (!(num1 < nti)) ntb = false ; - else ntb = true ; - return ntb ; - } - - - // Insert a new element in the tree - public boolean Insert(int v_key){ - Tree new_node ; - boolean ntb ; - boolean cont ; - int key_aux ; - Tree current_node ; - - new_node = new Tree(); - ntb = new_node.Init(v_key) ; - current_node = this ; - cont = true ; - while (cont){ - key_aux = current_node.GetKey(); - if (v_key < key_aux){ - if (current_node.GetHas_Left()) - current_node = current_node.GetLeft() ; - else { - cont = false ; - ntb = current_node.SetHas_Left(true); - ntb = current_node.SetLeft(new_node); - } - } - else{ - if (current_node.GetHas_Right()) - current_node = current_node.GetRight() ; - else { - cont = false ; - ntb = current_node.SetHas_Right(true); - ntb = current_node.SetRight(new_node); - } - } - } - return true ; - } - - - // Delete an element from the tree - public boolean Delete(int v_key){ - Tree current_node ; - Tree parent_node ; - boolean cont ; - boolean found ; - boolean is_root ; - int key_aux ; - boolean ntb ; - - current_node = this ; - parent_node = this ; - cont = true ; - found = false ; - is_root = true ; - while (cont){ - key_aux = current_node.GetKey(); - if (v_key < key_aux) - if (current_node.GetHas_Left()){ - parent_node = current_node ; - current_node = current_node.GetLeft() ; - } - else cont = false ; - else - if (key_aux < v_key) - if (current_node.GetHas_Right()){ - parent_node = current_node ; - current_node = current_node.GetRight() ; - } - else cont = false ; - else { - if (is_root) - if ((!current_node.GetHas_Right()) && - (!current_node.GetHas_Left()) ) - ntb = true ; - else - ntb = this.Remove(parent_node,current_node); - else ntb = this.Remove(parent_node,current_node); - found = true ; - cont = false ; - } - is_root = false ; - } - return found ; - } - - - // Check if the element to be removed will use the - // righ or left subtree if one exists - public boolean Remove(Tree p_node, Tree c_node){ - boolean ntb ; - int auxkey1 ; - int auxkey2 ; - - if (c_node.GetHas_Left()) - ntb = this.RemoveLeft(p_node,c_node) ; - else - if (c_node.GetHas_Right()) - ntb = this.RemoveRight(p_node,c_node) ; - else { - auxkey1 = c_node.GetKey(); - //auxtree01 = p_node.GetLeft() ; - //auxkey2 = auxtree01.GetKey() ; - auxkey2 = (p_node.GetLeft()).GetKey() ; - if (this.Compare(auxkey1,auxkey2)) { - ntb = p_node.SetLeft(my_null); - ntb = p_node.SetHas_Left(false); - } - else { - ntb = p_node.SetRight(my_null); - ntb = p_node.SetHas_Right(false); - } - } - return true ; - } - - - // Copy the child key to the parent until a leaf is - // found and remove the leaf. This is done with the - // right subtree - public boolean RemoveRight(Tree p_node, Tree c_node){ - boolean ntb ; - - while (c_node.GetHas_Right()){ - //auxtree01 = c_node.GetRight() ; - //auxint02 = auxtree01.GetKey(); - //ntb = c_node.SetKey(auxint02); - ntb = c_node.SetKey((c_node.GetRight()).GetKey()); - p_node = c_node ; - c_node = c_node.GetRight() ; - } - ntb = p_node.SetRight(my_null); - ntb = p_node.SetHas_Right(false); - return true ; - } - - - // Copy the child key to the parent until a leaf is - // found and remove the leaf. This is done with the - // left subtree - public boolean RemoveLeft(Tree p_node, Tree c_node){ - boolean ntb ; - - while (c_node.GetHas_Left()){ - //auxtree01 = c_node.GetLeft() ; - //auxint02 = auxtree01.GetKey(); - //ntb = c_node.SetKey(auxint02); - ntb = c_node.SetKey((c_node.GetLeft()).GetKey()); - p_node = c_node ; - c_node = c_node.GetLeft() ; - } - ntb = p_node.SetLeft(my_null); - ntb = p_node.SetHas_Left(false); - return true ; - } - - // Search for an elemnt in the tree - public int Search(int v_key){ - boolean cont ; - int ifound ; - Tree current_node; - int key_aux ; - - current_node = this ; - cont = true ; - ifound = 0 ; - while (cont){ - key_aux = current_node.GetKey(); - if (v_key < key_aux) - if (current_node.GetHas_Left()) - current_node = current_node.GetLeft() ; - else cont = false ; - else - if (key_aux < v_key) - if (current_node.GetHas_Right()) - current_node = current_node.GetRight() ; - else cont = false ; - else { - ifound = 1 ; - cont = false ; - } - } - return ifound ; - } - - // Invoke the method to really print the tree elements - public boolean Print(){ - Tree current_node; - boolean ntb ; - - current_node = this ; - ntb = this.RecPrint(current_node); - return true ; - } - - // Print the elements of the tree - public boolean RecPrint(Tree node){ - boolean ntb ; - - if (node.GetHas_Left()){ - //auxtree01 = node.GetLeft() ; - //ntb = this.RecPrint(auxtree01); - ntb = this.RecPrint(node.GetLeft()); - } else ntb = true ; - System.out.println(node.GetKey()); - if (node.GetHas_Right()){ - //auxtree01 = node.GetRight() ; - //ntb = this.RecPrint(auxtree01); - ntb = this.RecPrint(node.GetRight()); - } else ntb = true ; - return true ; - } - -} - diff --git a/typecheck/tests/BubbleSort.java b/typecheck/tests/BubbleSort.java deleted file mode 100644 index e5645a9..0000000 --- a/typecheck/tests/BubbleSort.java +++ /dev/null @@ -1,93 +0,0 @@ -class BubbleSort{ - public static void main(String[] a){ - System.out.println(new BBS().Start(10)); - } -} - - -// This class contains the array of integers and -// methods to initialize, print and sort the array -// using Bublesort -class BBS{ - - int[] number ; - int size ; - - // Invoke the Initialization, Sort and Printing - // Methods - public int Start(int sz){ - int aux01 ; - aux01 = this.Init(sz); - aux01 = this.Print(); - System.out.println(99999); - aux01 = this.Sort(); - aux01 = this.Print(); - return 0 ; - } - - - // Sort array of integers using Bublesort method - public int Sort(){ - int nt ; - int i ; - int aux02 ; - int aux04 ; - int aux05 ; - int aux06 ; - int aux07 ; - int j ; - int t ; - i = size - 1 ; - aux02 = 0 - 1 ; - while (aux02 < i) { - j = 1 ; - //aux03 = i+1 ; - while (j < (i+1)){ - aux07 = j - 1 ; - aux04 = number[aux07] ; - aux05 = number[j] ; - if (aux05 < aux04) { - aux06 = j - 1 ; - t = number[aux06] ; - number[aux06] = number[j] ; - number[j] = t; - } - else nt = 0 ; - j = j + 1 ; - } - i = i - 1 ; - } - return 0 ; - } - - // Printing method - public int Print(){ - int j ; - j = 0 ; - while (j < (size)) { - System.out.println(number[j]); - j = j + 1 ; - } - return 0 ; - } - - // Initialize array of integers - public int Init(int sz){ - size = sz ; - number = new int[sz] ; - - number[0] = 20 ; - number[1] = 7 ; - number[2] = 12 ; - number[3] = 18 ; - number[4] = 2 ; - number[5] = 11 ; - number[6] = 6 ; - number[7] = 9 ; - number[8] = 19 ; - number[9] = 5 ; - - return 0 ; - } - -} diff --git a/typecheck/tests/Factorial.java b/typecheck/tests/Factorial.java deleted file mode 100644 index d938bb6..0000000 --- a/typecheck/tests/Factorial.java +++ /dev/null @@ -1,16 +0,0 @@ -class Factorial{
- public static void main(String[] a){
- System.out.println(new Fac().ComputeFac(10));
- }
-}
-
-class Fac {
- public int ComputeFac(int num){
- int num_aux ;
- if (num < 1)
- num_aux = 1 ;
- else
- num_aux = num * (this.ComputeFac(num-1)) ;
- return num_aux ;
- }
-}
diff --git a/typecheck/tests/LinearSearch.java b/typecheck/tests/LinearSearch.java deleted file mode 100644 index daddd94..0000000 --- a/typecheck/tests/LinearSearch.java +++ /dev/null @@ -1,99 +0,0 @@ -class LinearSearch{ - public static void main(String[] a){ - System.out.println(new LS().Start(10)); - } -} - - -// This class contains an array of integers and -// methods to initialize, print and search the array -// using Linear Search -class LS { - int[] number ; - int size ; - - // Invoke methods to initialize, print and search - // for elements on the array - public int Start(int sz){ - int aux01 ; - int aux02 ; - - aux01 = this.Init(sz); - aux02 = this.Print(); - System.out.println(9999); - System.out.println(this.Search(8)); - System.out.println(this.Search(12)) ; - System.out.println(this.Search(17)) ; - System.out.println(this.Search(50)) ; - return 55 ; - } - - // Print array of integers - public int Print(){ - int j ; - - j = 1 ; - while (j < (size)) { - System.out.println(number[j]); - j = j + 1 ; - } - return 0 ; - } - - // Search for a specific value (num) using - // linear search - public int Search(int num){ - int j ; - boolean ls01 ; - int ifound ; - int aux01 ; - int aux02 ; - int nt ; - - j = 1 ; - ls01 = false ; - ifound = 0 ; - - //System.out.println(num); - while (j < (size)) { - aux01 = number[j] ; - aux02 = num + 1 ; - if (aux01 < num) nt = 0 ; - else if (!(aux01 < aux02)) nt = 0 ; - else { - ls01 = true ; - ifound = 1 ; - j = size ; - } - j = j + 1 ; - } - - return ifound ; - } - - - - // initialize array of integers with some - // some sequence - public int Init(int sz){ - int j ; - int k ; - int aux01 ; - int aux02 ; - - size = sz ; - number = new int[sz] ; - - j = 1 ; - k = size + 1 ; - while (j < (size)) { - aux01 = 2 * j ; - aux02 = k - 3 ; - number[j] = aux01 + aux02 ; - j = j + 1 ; - k = k - 1 ; - } - return 0 ; - } - -} diff --git a/typecheck/tests/LinkedList.java b/typecheck/tests/LinkedList.java deleted file mode 100644 index 69adc33..0000000 --- a/typecheck/tests/LinkedList.java +++ /dev/null @@ -1,278 +0,0 @@ -class LinkedList{ - public static void main(String[] a){ - System.out.println(new LL().Start()); - } -} - -class Element { - int Age ; - int Salary ; - boolean Married ; - - // Initialize some class variables - public boolean Init(int v_Age, int v_Salary, boolean v_Married){ - Age = v_Age ; - Salary = v_Salary ; - Married = v_Married ; - return true ; - } - - public int GetAge(){ - return Age ; - } - - public int GetSalary(){ - return Salary ; - } - - public boolean GetMarried(){ - return Married ; - } - - // This method returns true if the object "other" - // has the same values for age, salary and - public boolean Equal(Element other){ - boolean ret_val ; - int aux01 ; - int aux02 ; - int nt ; - ret_val = true ; - - aux01 = other.GetAge(); - if (!this.Compare(aux01,Age)) ret_val = false ; - else { - aux02 = other.GetSalary(); - if (!this.Compare(aux02,Salary)) ret_val = false ; - else - if (Married) - if (!other.GetMarried()) ret_val = false; - else nt = 0 ; - else - if (other.GetMarried()) ret_val = false; - else nt = 0 ; - } - - return ret_val ; - } - - // This method compares two integers and - // returns true if they are equal and false - // otherwise - public boolean Compare(int num1 , int num2){ - boolean retval ; - int aux02 ; - retval = false ; - aux02 = num2 + 1 ; - if (num1 < num2) retval = false ; - else if (!(num1 < aux02)) retval = false ; - else retval = true ; - return retval ; - } - -} - -class List{ - Element elem ; - List next ; - boolean end ; - - // Initialize the node list as the last node - public boolean Init(){ - end = true ; - return true ; - } - - // Initialize the values of a new node - public boolean InitNew(Element v_elem, List v_next, boolean v_end){ - end = v_end ; - elem = v_elem ; - next = v_next ; - return true ; - } - - // Insert a new node at the beginning of the list - public List Insert(Element new_elem){ - boolean ret_val ; - List aux03 ; - List aux02 ; - aux03 = this ; - aux02 = new List(); - ret_val = aux02.InitNew(new_elem,aux03,false); - return aux02 ; - } - - - // Update the the pointer to the next node - public boolean SetNext(List v_next){ - next = v_next ; - return true ; - } - - // Delete an element e from the list - public List Delete(Element e){ - List my_head ; - boolean ret_val ; - boolean aux05; - List aux01 ; - List prev ; - boolean var_end ; - Element var_elem ; - int aux04 ; - int nt ; - - - my_head = this ; - ret_val = false ; - aux04 = 0 - 1 ; - aux01 = this ; - prev = this ; - var_end = end; - var_elem = elem ; - while ((!var_end) && (!ret_val)){ - if (e.Equal(var_elem)){ - ret_val = true ; - if (aux04 < 0) { - // delete first element - my_head = aux01.GetNext() ; - } - else{ // delete a non first element - System.out.println(0-555); - aux05 = prev.SetNext(aux01.GetNext()); - System.out.println(0-555); - - } - } else nt = 0 ; - if (!ret_val){ - prev = aux01 ; - aux01 = aux01.GetNext() ; - var_end = aux01.GetEnd(); - var_elem = aux01.GetElem(); - aux04 = 1 ; - } else nt = 0 ; - } - return my_head ; - } - - - // Search for an element e on the list - public int Search(Element e){ - int int_ret_val ; - List aux01 ; - Element var_elem ; - boolean var_end ; - int nt ; - - int_ret_val = 0 ; - aux01 = this ; - var_end = end; - var_elem = elem ; - while (!var_end){ - if (e.Equal(var_elem)){ - int_ret_val = 1 ; - } - else nt = 0 ; - aux01 = aux01.GetNext() ; - var_end = aux01.GetEnd(); - var_elem = aux01.GetElem(); - } - return int_ret_val ; - } - - public boolean GetEnd(){ - return end ; - } - - public Element GetElem(){ - return elem ; - } - - public List GetNext(){ - return next ; - } - - - // Print the linked list - public boolean Print(){ - List aux01 ; - boolean var_end ; - Element var_elem ; - - aux01 = this ; - var_end = end ; - var_elem = elem ; - while (!var_end){ - System.out.println(var_elem.GetAge()); - aux01 = aux01.GetNext() ; - var_end = aux01.GetEnd(); - var_elem = aux01.GetElem(); - } - - return true ; - } -} - - -// this class invokes the methods to insert, delete, -// search and print the linked list -class LL{ - - public int Start(){ - - List head ; - List last_elem ; - boolean aux01 ; - Element el01 ; - Element el02 ; - Element el03 ; - - last_elem = new List(); - aux01 = last_elem.Init(); - head = last_elem ; - aux01 = head.Init(); - aux01 = head.Print(); - - // inserting first element - el01 = new Element(); - aux01 = el01.Init(25,37000,false); - head = head.Insert(el01); - aux01 = head.Print(); - System.out.println(10000000); - // inserting second element - el01 = new Element(); - aux01 = el01.Init(39,42000,true); - el02 = el01 ; - head = head.Insert(el01); - aux01 = head.Print(); - System.out.println(10000000); - // inserting third element - el01 = new Element(); - aux01 = el01.Init(22,34000,false); - head = head.Insert(el01); - aux01 = head.Print(); - el03 = new Element(); - aux01 = el03.Init(27,34000,false); - System.out.println(head.Search(el02)); - System.out.println(head.Search(el03)); - System.out.println(10000000); - // inserting fourth element - el01 = new Element(); - aux01 = el01.Init(28,35000,false); - head = head.Insert(el01); - aux01 = head.Print(); - System.out.println(2220000); - - head = head.Delete(el02); - aux01 = head.Print(); - System.out.println(33300000); - - - head = head.Delete(el01); - aux01 = head.Print(); - System.out.println(44440000); - - return 0 ; - - - } - -} diff --git a/typecheck/tests/MoreThan4.java b/typecheck/tests/MoreThan4.java deleted file mode 100644 index 4960f01..0000000 --- a/typecheck/tests/MoreThan4.java +++ /dev/null @@ -1,29 +0,0 @@ -class MoreThan4{ - public static void main(String[] a){ - System.out.println(new MT4().Start(1,2,3,4,5,6)); - } -} - -class MT4 { - public int Start(int p1, int p2, int p3 , int p4, int p5, int p6){ - int aux ; - System.out.println(p1); - System.out.println(p2); - System.out.println(p3); - System.out.println(p4); - System.out.println(p5); - System.out.println(p6); - aux = this.Change(p6,p5,p4,p3,p2,p1); - return aux ; - } - - public int Change(int p1, int p2, int p3 , int p4, int p5, int p6){ - System.out.println(p1); - System.out.println(p2); - System.out.println(p3); - System.out.println(p4); - System.out.println(p5); - System.out.println(p6); - return 0 ; - } -} diff --git a/typecheck/tests/QuickSort.java b/typecheck/tests/QuickSort.java deleted file mode 100644 index 5893390..0000000 --- a/typecheck/tests/QuickSort.java +++ /dev/null @@ -1,112 +0,0 @@ -class QuickSort{ - public static void main(String[] a){ - System.out.println(new QS().Start(10)); - } -} - - -// This class contains the array of integers and -// methods to initialize, print and sort the array -// using Quicksort -class QS{ - - int[] number ; - int size ; - - // Invoke the Initialization, Sort and Printing - // Methods - public int Start(int sz){ - int aux01 ; - aux01 = this.Init(sz); - aux01 = this.Print(); - System.out.println(9999); - aux01 = size - 1 ; - aux01 = this.Sort(0,aux01); - aux01 = this.Print(); - return 0 ; - } - - - // Sort array of integers using Quicksort method - public int Sort(int left, int right){ - int v ; - int i ; - int j ; - int nt; - int t ; - boolean cont01; - boolean cont02; - int aux03 ; - t = 0 ; - if (left < right){ - v = number[right] ; - i = left - 1 ; - j = right ; - cont01 = true ; - while (cont01){ - cont02 = true ; - while (cont02){ - i = i + 1 ; - aux03 = number[i] ; - if (!(aux03<v)) cont02 = false ; - else cont02 = true ; - } - cont02 = true ; - while (cont02){ - j = j - 1 ; - aux03 = number[j] ; - if (!(v < aux03)) cont02 = false ; - else cont02 = true ; - } - - - t = number[i] ; - number[i] = number[j] ; - number[j] = t ; - //aux03 = i + 1 ; - if ( j < (i+1)) cont01 = false ; - else cont01 = true ; - } - number[j] = number[i] ; - number[i] = number[right] ; - number[right] = t ; - nt = this.Sort(left,i-1); - nt = this.Sort(i+1,right); - } - else nt = 0 ; - return 0 ; - } - - - // Print array of integers - public int Print(){ - int j ; - j = 0 ; - while (j < (size)) { - System.out.println(number[j]); - j = j + 1 ; - } - return 0 ; - } - - - // Initialize array of integers - public int Init(int sz){ - size = sz ; - number = new int[sz] ; - - number[0] = 20 ; - number[1] = 7 ; - number[2] = 12 ; - number[3] = 18 ; - number[4] = 2 ; - number[5] = 11 ; - number[6] = 6 ; - number[7] = 9 ; - number[8] = 19 ; - number[9] = 5 ; - - return 0 ; - } - -} diff --git a/typecheck/tests/TreeVisitor.java b/typecheck/tests/TreeVisitor.java deleted file mode 100644 index 8debfe6..0000000 --- a/typecheck/tests/TreeVisitor.java +++ /dev/null @@ -1,374 +0,0 @@ -// The classes are basically the same as the BinaryTree -// file except the visitor classes and the accept method -// in the Tree class - -class TreeVisitor{ - public static void main(String[] a){ - System.out.println(new TV().Start()); - } -} - -class TV { - - public int Start(){ - Tree root ; - boolean ntb ; - int nti ; - MyVisitor v ; - - root = new Tree(); - ntb = root.Init(16); - ntb = root.Print(); - System.out.println(100000000); - ntb = root.Insert(8) ; - ntb = root.Insert(24) ; - ntb = root.Insert(4) ; - ntb = root.Insert(12) ; - ntb = root.Insert(20) ; - ntb = root.Insert(28) ; - ntb = root.Insert(14) ; - ntb = root.Print(); - System.out.println(100000000); - v = new MyVisitor(); - System.out.println(50000000); - nti = root.accept(v); - System.out.println(100000000); - System.out.println(root.Search(24)); - System.out.println(root.Search(12)); - System.out.println(root.Search(16)); - System.out.println(root.Search(50)); - System.out.println(root.Search(12)); - ntb = root.Delete(12); - ntb = root.Print(); - System.out.println(root.Search(12)); - - return 0 ; - } - -} - - -class Tree{ - Tree left ; - Tree right; - int key ; - boolean has_left ; - boolean has_right ; - Tree my_null ; - - - - //Tree new_node ; - //Tree current_node ; - //Tree parent_node ; - - // boolean ntb ; - //boolean cont ; - //boolean found ; - //int ifound ; - // boolean is_root ; - // int nti ; - // int key_aux ; - // int auxkey1 ; - // int auxkey2 ; - - public boolean Init(int v_key){ - key = v_key ; - has_left = false ; - has_right = false ; - return true ; - } - - public boolean SetRight(Tree rn){ - right = rn ; - return true ; - } - - public boolean SetLeft(Tree ln){ - left = ln ; - return true ; - } - - public Tree GetRight(){ - return right ; - } - - public Tree GetLeft(){ - return left; - } - - public int GetKey(){ - return key ; - } - - public boolean SetKey(int v_key){ - key = v_key ; - return true ; - } - - public boolean GetHas_Right(){ - return has_right ; - } - - public boolean GetHas_Left(){ - return has_left ; - } - - public boolean SetHas_Left(boolean val){ - has_left = val ; - return true ; - } - - public boolean SetHas_Right(boolean val){ - has_right = val ; - return true ; - } - - public boolean Compare(int num1 , int num2){ - boolean ntb ; - int nti ; - - ntb = false ; - nti = num2 + 1 ; - if (num1 < num2) ntb = false ; - else if (!(num1 < nti)) ntb = false ; - else ntb = true ; - return ntb ; - } - - public boolean Insert(int v_key){ - Tree new_node ; - boolean ntb ; - Tree current_node ; - boolean cont ; - int key_aux ; - - new_node = new Tree(); - ntb = new_node.Init(v_key) ; - current_node = this ; - cont = true ; - while (cont){ - key_aux = current_node.GetKey(); - if (v_key < key_aux){ - if (current_node.GetHas_Left()) - current_node = current_node.GetLeft() ; - else { - cont = false ; - ntb = current_node.SetHas_Left(true); - ntb = current_node.SetLeft(new_node); - } - } - else{ - if (current_node.GetHas_Right()) - current_node = current_node.GetRight() ; - else { - cont = false ; - ntb = current_node.SetHas_Right(true); - ntb = current_node.SetRight(new_node); - } - } - } - return true ; - } - - public boolean Delete(int v_key){ - Tree current_node ; - Tree parent_node ; - boolean cont ; - boolean found ; - boolean ntb ; - boolean is_root ; - int key_aux ; - - current_node = this ; - parent_node = this ; - cont = true ; - found = false ; - is_root = true ; - while (cont){ - key_aux = current_node.GetKey(); - if (v_key < key_aux) - if (current_node.GetHas_Left()){ - parent_node = current_node ; - current_node = current_node.GetLeft() ; - } - else cont = false ; - else - if (key_aux < v_key) - if (current_node.GetHas_Right()){ - parent_node = current_node ; - current_node = current_node.GetRight() ; - } - else cont = false ; - else { - if (is_root) - if (!current_node.GetHas_Right() && - !current_node.GetHas_Left() ) - ntb = true ; - else - ntb = this.Remove(parent_node,current_node); - else ntb = this.Remove(parent_node,current_node); - found = true ; - cont = false ; - } - is_root = false ; - } - return found ; - } - - public boolean Remove(Tree p_node, Tree c_node){ - boolean ntb ; - int auxkey1 ; - int auxkey2 ; - - if (c_node.GetHas_Left()) - ntb = this.RemoveLeft(p_node,c_node) ; - else - if (c_node.GetHas_Right()) - ntb = this.RemoveRight(p_node,c_node) ; - else { - auxkey1 = c_node.GetKey(); - auxkey2 = (p_node.GetLeft()).GetKey() ; - if (this.Compare(auxkey1,auxkey2)) { - ntb = p_node.SetLeft(my_null); - ntb = p_node.SetHas_Left(false); - } - else { - ntb = p_node.SetRight(my_null); - ntb = p_node.SetHas_Right(false); - } - } - return true ; - } - - public boolean RemoveRight(Tree p_node, Tree c_node){ - boolean ntb ; - while (c_node.GetHas_Right()){ - ntb = c_node.SetKey((c_node.GetRight()).GetKey()); - p_node = c_node ; - c_node = c_node.GetRight() ; - } - ntb = p_node.SetRight(my_null); - ntb = p_node.SetHas_Right(false); - return true ; - } - - public boolean RemoveLeft(Tree p_node, Tree c_node){ - boolean ntb ; - while (c_node.GetHas_Left()){ - ntb = c_node.SetKey((c_node.GetLeft()).GetKey()); - p_node = c_node ; - c_node = c_node.GetLeft() ; - } - ntb = p_node.SetLeft(my_null); - ntb = p_node.SetHas_Left(false); - return true ; - } - - - public int Search(int v_key){ - Tree current_node ; - int ifound ; - boolean cont ; - int key_aux ; - - current_node = this ; - cont = true ; - ifound = 0 ; - while (cont){ - key_aux = current_node.GetKey(); - if (v_key < key_aux) - if (current_node.GetHas_Left()) - current_node = current_node.GetLeft() ; - else cont = false ; - else - if (key_aux < v_key) - if (current_node.GetHas_Right()) - current_node = current_node.GetRight() ; - else cont = false ; - else { - ifound = 1 ; - cont = false ; - } - } - return ifound ; - } - - public boolean Print(){ - boolean ntb ; - Tree current_node ; - - current_node = this ; - ntb = this.RecPrint(current_node); - return true ; - } - - public boolean RecPrint(Tree node){ - boolean ntb ; - - if (node.GetHas_Left()){ - ntb = this.RecPrint(node.GetLeft()); - } else ntb = true ; - System.out.println(node.GetKey()); - if (node.GetHas_Right()){ - ntb = this.RecPrint(node.GetRight()); - } else ntb = true ; - return true ; - } - - public int accept(Visitor v){ - int nti ; - - System.out.println(333); - nti = v.visit(this) ; - return 0 ; - } - -} - - - -class Visitor { - Tree l ; - Tree r ; - - public int visit(Tree n){ - int nti ; - - if (n.GetHas_Right()){ - r = n.GetRight() ; - nti = r.accept(this) ; } - else nti = 0 ; - - if (n.GetHas_Left()) { - l = n.GetLeft(); - nti = l.accept(this) ; } - else nti = 0 ; - - return 0; - } - -} - - -class MyVisitor extends Visitor { - - public int visit(Tree n){ - int nti ; - - if (n.GetHas_Right()){ - r = n.GetRight() ; - nti = r.accept(this) ; } - else nti = 0 ; - - System.out.println(n.GetKey()); - - if (n.GetHas_Left()) { - l = n.GetLeft(); - nti =l.accept(this) ; } - else nti = 0 ; - - return 0; - } - -} diff --git a/vaporize/library/Kettle.java b/vaporize/Kettle.java index ffbf2dd..4d7a3db 100644 --- a/vaporize/library/Kettle.java +++ b/vaporize/Kettle.java @@ -1,4 +1,4 @@ -package vaporize.library; +package vaporize; import cs132.vapor.ast.*; import misc.*; diff --git a/vaporize/library/LIRDict.java b/vaporize/LIRDict.java index d924d5e..4f3d3c1 100644 --- a/vaporize/library/LIRDict.java +++ b/vaporize/LIRDict.java @@ -1,4 +1,4 @@ -package vaporize.library; +package vaporize; import cs132.vapor.ast.VFunction; import cs132.vapor.ast.VInstr; diff --git a/vaporize/library/LIRVar.java b/vaporize/LIRVar.java index d388797..da23af5 100644 --- a/vaporize/library/LIRVar.java +++ b/vaporize/LIRVar.java @@ -1,4 +1,4 @@ -package vaporize.library; +package vaporize; import misc.*; @@ -67,15 +67,14 @@ public class LIRVar implements Comparable<LIRVar> { } public int getFirstDef() { - return this.interval.first_def; + return this.interval.first_def; } public int getLastUse() { - return this.interval.last_use; + return this.interval.last_use; } public String getAssignedRegister() { - return this.register; + return this.register; } } - diff --git a/vaporize/library/LIRVisitor.java b/vaporize/LIRVisitor.java index a962775..d336ffe 100644 --- a/vaporize/library/LIRVisitor.java +++ b/vaporize/LIRVisitor.java @@ -1,4 +1,4 @@ -package vaporize.library; +package vaporize; import cs132.vapor.ast.*; import graphviz.*; diff --git a/vaporize/library/RegisterAlloc.java b/vaporize/RegisterAlloc.java index b316b96..4b956d0 100644 --- a/vaporize/library/RegisterAlloc.java +++ b/vaporize/RegisterAlloc.java @@ -1,4 +1,4 @@ -package vaporize.library; +package vaporize; import java.util.*; import misc.*; diff --git a/vaporize/library/SpillEverywhere.java b/vaporize/SpillEverywhere.java index 993bfa6..317c79d 100644 --- a/vaporize/library/SpillEverywhere.java +++ b/vaporize/SpillEverywhere.java @@ -1,4 +1,4 @@ -package vaporize.library; +package vaporize; import cs132.vapor.ast.*; import st.*; diff --git a/vaporize/library/TransientInterval.java b/vaporize/TransientInterval.java index faf7637..3399092 100644 --- a/vaporize/library/TransientInterval.java +++ b/vaporize/TransientInterval.java @@ -1,4 +1,4 @@ -package vaporize.library; +package vaporize; import misc.*; diff --git a/vaporize/library/VaporizeVisitor.java b/vaporize/VaporizeVisitor.java index 0dfca02..3562887 100644 --- a/vaporize/library/VaporizeVisitor.java +++ b/vaporize/VaporizeVisitor.java @@ -1,4 +1,4 @@ -package vaporize.library; +package vaporize; import cs132.vapor.ast.*; import misc.*; @@ -106,6 +106,8 @@ public class VaporizeVisitor extends VInstr.VisitorP<LIRDict, RuntimeException> String reg = (n.args[i] instanceof VVarRef.Local) ? d.getInterval(n.args[i].toString()).getAssignedRegister() : n.args[i].toString(); + MinimalLogger.info(String.format("Adding argument for %s", + n.args[i].toString)); this.addVaporm(String.format(" %s = %s", this.arg_pass[i], reg)); diff --git a/vaporize/tests/ex32.vapor b/vaporize/tests/ex32.vapor deleted file mode 100644 index 8a8dc62..0000000 --- a/vaporize/tests/ex32.vapor +++ /dev/null @@ -1,15 +0,0 @@ -func Main() - t.3 = HeapAllocZ(4) - [t.3+0] = :functable_A - t.4 = [t.3+0] - t.5 = [t.4+0] - t.6 = 12 - t.10 = call t.5(t.3 t.6) - PrintIntS(t.10) - ret - -const functable_A - :A_foo - -func A_foo(this t.1) - ret t.1 diff --git a/vaporize/tests/ex32.vaporm b/vaporize/tests/ex32.vaporm deleted file mode 100644 index 7ef23aa..0000000 --- a/vaporize/tests/ex32.vaporm +++ /dev/null @@ -1,35 +0,0 @@ -func Main [in 0, out 0, local 4] - local[0] = $s0 - local[1] = $s1 - local[2] = $s2 - $s0 = HeapAllocZ(4) - local[3] = $s0 - $s0 = local[3] - [$s0] = :functable_A - $local[4] = $s0 - $t1 = [$t0] - $t2 = [$t1] - $a0 = $t0 - $a1 = 12 - call $t2 - $t1 = $v0 - PrintIntS($t1) - $s0 = local[0] - $s1 = local[1] - $s2 = local[2] - ret - -const functable_A - :A_foo - -func A_foo [in 0, out 0, local 6] - local[0] = $s0 - local[1] = $s1 - local[2] = $s2 - $t0 = $a0 - $s0 = $a1 - $v0 = $s0 - $s0 = local[0] - $s1 = local[1] - $s2 = local[2] - ret |