Skip to content

Commit

Permalink
Driver, could have bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinDuarte committed Jul 11, 2015
1 parent 8925588 commit ac18e7a
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Driver/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
int main()
{
scannermain();
printf("Scanner successful");
printf("Scanner successful\n");
parsermain();
printf("Parsing and Code Generating successful");
printf("Parsing and Code Generating successful\n");
pmachinemain();
printf("Everything done");
printf("Everything done\n");
return 0;
}
5 changes: 5 additions & 0 deletions Driver/input.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
var x, y;
begin
y := 3; /* This is a comment */
x := y + 56;
end.
2 changes: 2 additions & 0 deletions Driver/parserwithcodegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,8 @@ void PROGRAM()
{
ERROR("Error number 9, period expected.");
}
//the halt at the end of the program
printToFile(9, 0, 2);
}


Expand Down
8 changes: 8 additions & 0 deletions mcode.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
6 0 6
1 0 3
4 0 5
3 0 5
1 0 56
2 0 2
4 0 5
9 0 2
11 changes: 11 additions & 0 deletions parseroutput.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
6 0 6
1 0 99
4 0 6
3 0 6
1 0 1
2 0 2
4 0 6
3 0 5
1 0 2
2 0 2
4 0 5
2 changes: 2 additions & 0 deletions parserwithcodegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,8 @@ void PROGRAM()
{
ERROR("Error number 9, period expected.");
}
//the halt at the end of the program
printToFile(9, 0, 2);
}


Expand Down
Binary file added parserwithcodegen.exe
Binary file not shown.
Binary file added pmachine.exe
Binary file not shown.
20 changes: 20 additions & 0 deletions stacktrace.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Line OP L M
0 inc 0 6
1 lit 0 3
2 sto 0 5
3 lod 0 5
4 lit 0 56
5 opr 0 2
6 sto 0 5
7 sio 0 2
pc bp sp stack
Initial values 0 1 0
0 inc 0 6 1 1 6 0 0 0 0 0 0
1 lit 0 3 2 1 7 0 0 0 0 0 0 3
2 sto 0 5 3 1 6 0 0 0 0 0 3
3 lod 0 5 4 1 7 0 0 0 0 0 3 3
4 lit 0 56 5 1 8 0 0 0 0 0 3 | 3 56
5 opr 0 2 6 1 7 0 0 0 0 0 3 59
6 sto 0 5 7 1 6 0 0 0 0 0 59
7 sio 0 2 8 1 6 0 0 0 0 0 59

0 comments on commit ac18e7a

Please sign in to comment.