Skip to content

Commit e38a95e

Browse files
committed
modified some files not sure what happened
1 parent 1df0a0f commit e38a95e

21 files changed

+31
-3473
lines changed

Exam1/Untitled.png

45.3 KB
Loading

Exam1/submission.epub

121 KB
Binary file not shown.

Exam1/submission.jpeg

3.6 KB
Loading

Exam1/submission.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Ziad Arafat

Exam1/submission.pdf

12.4 KB
Binary file not shown.

Exam1/submission.png

9.94 KB
Loading

Exam1/submission_.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Ziad Arafat
2+
3+
| State | a | b | a + $\epsilon$ | b + $\epsilon$ |
4+
|---------|-------|---------|----------------|----------------|
5+
| A:{0} | {1,2} | {1} | {1,2,3} | {1,3} |
6+
| B:{1,2,3} | {1} | {3,4} | {1,3} | {3,4,2} |
7+
| C:{1,3} | {} | {3,4} | {} | {3,4,2} |
8+
| D:{3,4,2} | {0,1} | {4} | {0,1,3} | {4,2,3} |
9+
| E:{0,1,3} | {1,2} | {1,3,4} | {1,2,3} | {3,4,2} |
10+
11+
![alt](Untitled.png)

Exam1/submission_.png

105 KB
Loading

LAB2_2/lab2docalc.l

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ int yylex();VAR
2828
[ \t] {
2929
if (mydebug) fprintf(stderr,"Whitespace found\n");
3030
}
31-
[=\-+*/%&|()] {
31+
[=\-+*/%&|()\^] {
3232
if (mydebug) fprintf(stderr,"return a token %c\n",*yytext);
3333
return (*yytext);
3434
}

LAB2_2/lab2docalc.y

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
%{
22
#include <stdio.h>
33
#include <ctype.h>
4+
#include <math.h>
45
int yylex();
56

67
int regs[26];
@@ -24,6 +25,7 @@ void yyerror (s) /* Called by yyparse on error */
2425
%left '|'
2526
%left '&'
2627
%left '+' '-'
28+
%left '^'
2729

2830
%left '*' '/' '%' '(' /*add a opening parenthesis */
2931
%left UMINUS
@@ -64,6 +66,8 @@ expr : '(' expr ')'
6466
{ $$ = $1 % $3; }
6567
| expr '&' expr
6668
{ $$ = $1 & $3; }
69+
| expr '^' expr
70+
{ $$ = pow($1, $3); }
6771
| expr '|' expr
6872
{ $$ = $1 | $3; }
6973
| expr '*' expr { $$ = $1 * $3; }

0 commit comments

Comments
 (0)