Skip to content

Commit

Permalink
checkpoint (pre-A5)
Browse files Browse the repository at this point in the history
  • Loading branch information
SantriptaSharma committed Nov 30, 2023
1 parent 4bdbe92 commit 860c939
Show file tree
Hide file tree
Showing 16 changed files with 58 additions and 0 deletions.
Binary file added A5.pdf
Binary file not shown.
Binary file added A5_Tests/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions A5_Tests/test1.nc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
int a;
3 changes: 3 additions & 0 deletions A5_Tests/test2.nc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
int main(){
return 0;
}
14 changes: 14 additions & 0 deletions A5_Tests/test3.nc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
void func(int a, int *b);

void func(int a, int * b){

}
void main(){
int a = 1;
a = a + 1;
int b = 1 - a;
int c = 1/b;
c = c * 2 + 10;
int * d;
*d = c * c % a;
}
10 changes: 10 additions & 0 deletions A5_Tests/test4.nc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
int sum(int n){
if(n == 0) return n;
return sum(n-1) + n;
}

int main(){
int sum = 10;
sum = fun(sum);
return 0;
}
16 changes: 16 additions & 0 deletions A5_Tests/test5.nc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
int d = 99;

int fun(int c){
if(c%d == 0) return fun2(c);
else return fun(c+1);
}

int * fun2(int b){
int * e = 0;
return e;
}
int main(){
int a = 1;
int * ret = fun(a);
return 0;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions translator_tests/testinf.nc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
int main() {
for (;;) main();
}
11 changes: 11 additions & 0 deletions translator_tests/testrecursivemult.nc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
int multiplyNumbers(int n)
{
if (n>=1)
{
return n * multiplyNumbers(n - 1);
}
else
{
return 1;
}
}
File renamed without changes.
File renamed without changes.

0 comments on commit 860c939

Please sign in to comment.