diff options
author | bd-912 <bdunahu@colostate.edu> | 2024-04-06 22:36:22 -0600 |
---|---|---|
committer | bd-912 <bdunahu@colostate.edu> | 2024-04-06 22:38:00 -0600 |
commit | 8f1eeb71061e4009abec9356c9430075c0a7f7ee (patch) | |
tree | 5d4f35717bd90711b19acbb4feab37f469be19ac /typecheck/tests | |
parent | 1eac68a0e5fd00ee563ac43cb6f4dac3a4fb2c33 (diff) |
Add SymTableTopDown, changes to SymbolTable to make it possible
Delete SymTableVis
Diffstat (limited to 'typecheck/tests')
-rw-r--r-- | typecheck/tests/FactorialEdit.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/typecheck/tests/FactorialEdit.java b/typecheck/tests/FactorialEdit.java new file mode 100644 index 0000000..919ed82 --- /dev/null +++ b/typecheck/tests/FactorialEdit.java @@ -0,0 +1,20 @@ +class Factorial{ + public static void main(String[] a){ + System.out.println(new Fac().ComputeFac(10)); + } +} + +class Fac { + int[] useless_var ; + 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 ; + } +} + +class Fac2 extends Fac { +} |