Skip to content

Commit e9396ea

Browse files
authored
Add files via upload
1 parent 403c9d7 commit e9396ea

File tree

7 files changed

+189
-160
lines changed

7 files changed

+189
-160
lines changed

R Language/input.txt

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ root:
6161
5>2;
6262
2<5;
6363
5==5;
64+
2!=5;
6465

6566

6667
#///////////////// Loops \\\\\\\\\\\\\\\\\\

R Language/lex.yy.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
286286
#define YY_END_OF_BUFFER 34
287287
static yyconst short int yy_accept[118] =
288288
{ 0,
289-
29, 29, 34, 32, 30, 29, 31, 26, 6, 4,
289+
29, 29, 34, 32, 30, 29, 31, 6, 26, 4,
290290
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
291291
5, 5, 5, 5, 5, 5, 5, 12, 13, 30,
292292
29, 31, 26, 4, 0, 0, 0, 0, 0, 0,
@@ -306,13 +306,13 @@ static yyconst int yy_ec[256] =
306306
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
307307
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
308308
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
309-
1, 4, 1, 1, 5, 1, 6, 1, 1, 6,
310-
6, 6, 6, 6, 6, 1, 6, 7, 7, 7,
311-
7, 7, 7, 7, 7, 7, 7, 6, 6, 6,
312-
6, 6, 1, 1, 8, 9, 10, 11, 12, 13,
309+
1, 4, 5, 1, 6, 1, 5, 1, 1, 5,
310+
5, 5, 5, 5, 5, 1, 5, 7, 7, 7,
311+
7, 7, 7, 7, 7, 7, 7, 5, 5, 5,
312+
5, 5, 1, 1, 8, 9, 10, 11, 12, 13,
313313
14, 15, 16, 14, 17, 18, 19, 20, 21, 22,
314314
14, 23, 24, 25, 26, 14, 27, 14, 28, 14,
315-
1, 1, 1, 6, 1, 1, 29, 14, 30, 14,
315+
1, 1, 1, 5, 1, 1, 29, 14, 30, 14,
316316

317317
14, 31, 14, 32, 33, 14, 14, 34, 35, 36,
318318
37, 38, 14, 39, 14, 40, 14, 14, 14, 14,
@@ -344,7 +344,7 @@ static yyconst int yy_meta[43] =
344344

345345
static yyconst short int yy_base[120] =
346346
{ 0,
347-
0, 0, 134, 135, 131, 129, 127, 0, 135, 123,
347+
0, 0, 134, 135, 131, 129, 127, 135, 0, 123,
348348
106, 105, 35, 115, 108, 36, 135, 34, 113, 32,
349349
116, 108, 90, 87, 10, 81, 82, 135, 135, 116,
350350
114, 112, 0, 108, 91, 101, 88, 87, 97, 85,
@@ -361,7 +361,7 @@ static yyconst short int yy_base[120] =
361361

362362
static yyconst short int yy_def[120] =
363363
{ 0,
364-
117, 1, 117, 117, 117, 117, 117, 118, 117, 117,
364+
117, 1, 117, 117, 117, 117, 117, 117, 118, 117,
365365
117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
366366
117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
367367
117, 117, 118, 117, 117, 117, 117, 117, 117, 117,

R Language/main.l

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ header "import ".*
2727
yylval = *yytext - 'a';
2828
return VAR;
2929
}
30-
[-+/*<>=,():;%^] {
30+
[-+/*<>=,():;%^!] {
3131
yylval = yytext[0];
3232
return *yytext;
3333
}

R Language/main.tab.c

+163-146
Large diffs are not rendered by default.

R Language/main.y

+8-4
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,14 @@ expression: NUM { printf("\nNumber : %d\n",$1 ); $$ = $1; }
199199

200200
| expression '>' expression {printf("\nGreater-Than functionality :%d > %d \n ",$1,$3,$1 > $3); $$ = $1 > $3; }
201201
| expression '=''=' expression {
202-
if($1> $4){}
203-
else if ($1<$4) {}
204-
else{
205-
printf("\nEqual functionality: %d == %d\n",$1,$4);}
202+
203+
printf("\nEqual functionality: %d == %d\n",$1,$4);
204+
$$ = $1 == $4;
205+
}
206+
| expression '!''=' expression {
207+
208+
printf("\nInequal functionality: %d == %d\n",$1,$4);
209+
$$ = $1 != $4;
206210
}
207211

208212
| '(' expression ')' {$$ = $2; }

R Language/output.txt

+8-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,14 @@ Number : 5
9898
Number : 5
9999

100100
Equal functionality: 5 == 5
101-
value of expression: 5
101+
value of expression: 1
102+
103+
Number : 2
104+
105+
Number : 5
106+
107+
Inequal functionality: 2 == 5
108+
value of expression: 1
102109
#///////////////// Loops \\\\\\\\\\\\\\\\\\
103110

104111
Adding Two Numbers : 6+2 = 8

R Language/test.exe

512 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)