SlideShare a Scribd company logo
Mukesh Kumar
1110751908
CSE 7th
Sem
Course: Bachelor of Technology
Branch: Computer Science & Engineering
Semester: 7th
GURU JAMBHESHWAR UNIVERSITY OF
SCIENCE & TECHNOLOGY, HISAR
Submitted To: - Submitted By:-
Er. Isha Nagpal Mukesh Kumar
Asstt. Professor in CSE Deptt. 1110751908
Department of Computer Science & Engineering
Prannath Parnami Institute of Management & Technology, Hisar
Prannath Parnami Universe, Website: ppu.edu.in
Mukesh Kumar
1110751908
CSE 7th
Sem
INDEX
Sr.
No.
Name of Experiment Date Sign.
1. Write a program to design lexical analyzer.
2. Write a program to generate three address codes
for assignment, arithmetic and relational
expressions.
3. Write a program to check whether a string to the
grammar or not.
4. Write a program to find the number of
whitespaces & newline characters.
5. Write a program to find the leading terminals.
6. Write a program to find the trailing terminals.
7. Write a program for computation of first.
8. Write a program to show the operations of stack.
9. Write a program to perform the operations on
stack by using linked list.
10. Write a program to perform the operations on file.
Mukesh Kumar
1110751908
CSE 7th
Sem
Program-01
Write a program to design lexical analyzer.
#include<ctype.h>
#include<stdio.h>
#include<string.h>
void keyword(char str[10])
{
if(strcmp("for",str)==0||strcmp("while",str)==0||
strcmp("do",str)==0||strcmp("int",str)==0||strcmp
("float",str)==0||strcmp("char",str)==0||strcmp
("double",str)==0||strcmp("static",str)==0||strcmp
("switch",str)==0||strcmp("case",str)==0)
printf("n%s is a keyword", str);
else
printf("n%s is an identifier", str);
}
void main()
{
FILE *f1,*f2,*f3;
char c,str[10],st1[10];
int num[100],lineno=0,tokenvalue=0,i=0,j=0,k=0;
printf("n enter the c program");
gets(st1);
f1=fopen("input.txt","w");
while((c=getchar())!=EOF)
putc(c,f1);
fclose(f1);
f1=fopen ("input.txt","r");
f2=fopen ("identifier.txt","w");
f3=fopen ("specialchar.txt","w");
while((c=getc(f1))!=EOF)
{
if(isdigit(c))
{
tokenvalue=c-'0';
Mukesh Kumar
1110751908
CSE 7th
Sem
c=getc(f1);
while(isdigit(c))
{
tokenvalue*=10+c-'0';
c=getc(f1);
}
num[i++]=tokenvalue;
ungetc(c,f1);
}
else
if(isalpha(c))
{
putc(c,f2);
c=getc(f1);
while(isdigit(c)||isalpha(c)||c=='_'||c=='$')
{
putc(c,f2);
c=getc(f1);
}
putc(' ',f2);
ungetc(c,f1);//to get unsigned char to the spcified stream
}
else
if(c==' '||c=='t')
printf("");
else
if(c=='n')
lineno++;
else
putc(c,f3);
}
fclose(f2);
fclose(f3);
fclose(f1);
printf("n the no's in the program are");
for(j=0;j<i;j++)
printf("%d",num[j]);
printf("n");
f2=fopen("identifier.txt","r");
Mukesh Kumar
1110751908
CSE 7th
Sem
k=0;
printf("the keyword and identifiers are:");
while((c=getc(f2))!=EOF)
{
if(c!=' ')
str[k++]=c;
else
{
str[k]='0';
keyword(str);
k=0;
}
}
fclose(f2);
f3=fopen ("n Specialchar.txt","r");
printf("n special characters are");
while((c=getc(f3))!=EOF)
printf("%c",c);
printf("n");
fclose(f3);
printf("Total no. os lines are: %d", lineno);
getch();
}
Mukesh Kumar
1110751908
CSE 7th
Sem
OUTPUT
Mukesh Kumar
1110751908
CSE 7th
Sem
Program-02
Write a program to generate three address code for assignment, arithmetic and
relational expressions.
#include<stdio.h>
#include<string.h>
int i,ch,j,l,addr=100;
char ex[10],exp[10],exp1[10],exp2[10],id1[5],op[5],id2[5];
void main()
{
clrscr();
while(1)
{
printf("n 1. Assignment Expression or Arithmetic Expression n 2. Relational or Expression n
3. Exit n Enter the choice:");
scanf("%d", &ch);
switch(ch)
{
case 1:
printf("n Enter the expression with Assignment Expression Operator or Arithmetic Operator:");
scanf("%s",exp);
l=strlen(exp);
exp2[0]='0';
i=0;
while(exp[i]!='=')
{
i++;
}
strncat(exp2,exp,i);
strrev(exp);
exp1[0]='0';
strncat(exp1,exp,l-(i+1));
strrev(exp1);
printf("three address code:ntemp=%sn%s=tempn",exp1,exp2);
break;
case 2:
Mukesh Kumar
1110751908
CSE 7th
Sem
printf("Enter the expression with relational operator");
scanf("%s%s%s",&id1,&op,&id2);
if(((strcmp(op,"<")==0)||(strcmp(op,">")==0)||(strcmp(op,"<=")
==0)||(strcmp(op,">=")==0)||(strcmp(op,"==")==0)||(strcmp(op,"!=")==0))==0)
printf("Expression is error");
else
{
printf("n %dtif%s%s%s goto %d",addr,id1,op,id2,addr+3);
addr++;
printf("n %dt T:=0",addr);
addr++;
printf("n %dt goto %d",addr,addr+2);
addr++;
printf("n %dt T:=1",addr);
}
break;
case 3:
exit(0);
}
}
}
Mukesh Kumar
1110751908
CSE 7th
Sem
OUTPUT
Mukesh Kumar
1110751908
CSE 7th
Sem
Program-03
Write a program to check whether a string to the grammar or not.
#include<stdio.h>
#include<string.h>
#include<conio.h>
void main()
{
char a1[100],b1[100],c1[100],p1[10],s1;
int v=0,i,j,k,m,n=0,x,a=0,l1,l2,l3,loc,lx,lx1,loc1,s;
clrscr();
printf("enter the start symbol");
scanf("%c", & s1);
printf("enter the production");
scanf("%s",&a1);
printf("enter the string to be searching");
scanf("%s",&p1);
strcpy(b1,a1);
printf("b1=%s" ,b1);
l1=strlen(a1);
l2=strlen(b1);
l3=strlen(p1);
lx=l1;
lx1=l1;
printf("a1=%s", a1);
printf("l1=%d", l1);
while(((2*(13+2))>11))
{
for(i=0;i<11;i++)
{
if(a1[i]==s1)
{
loc=i;
}}
printf("n loc=%d", loc);
x=strcmp(a1,p1);
if(x==0)
{
printf("n string present");
Mukesh Kumar
1110751908
CSE 7th
Sem
}
else
{
l1=l1+l1;
for(j=loc;j<11;j++)
{
s=j+lx1;
a1[s]=a1[j];
}
printf("shift=%s",a1);
v=loc;
for(i=0;i<lx;i++)
{
a1[v]=b1[i];
v=v+1;
}
v=0;
m=0;
printf("string with start symbol=%s",a1);
for(j=0;j<=11;j++)
{
if(a1[j]!=s1)
{
a1[m]=a1[j];
m=m+1;
}}
printf("n string after removing start symbol=%s",a1);
}
if(x==0)
{
printf("nstring found");
break;
}}
if(x!=0)
{
printf("n string not found ");
}
getch();
}
Mukesh Kumar
1110751908
CSE 7th
Sem
OUTPUT
Mukesh Kumar
1110751908
CSE 7th
Sem
Program-04
Write a program to find the number of whitespaces & newline characters.
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main ()
{
char str[200],ch;
int a=0, space=0,newline=0;
clrscr();
printf("enter a string ( press escape to quit entering)");
ch=getche();
while((ch!=27)&&(a<199))
{
str[a]=ch;
if (str[a] ==' ')
{
space++;
}
if(str[a]==13)
{
newline++;
printf("n");
}
a++;
ch=getche();
}
printf("n the no. of lines used =%d", newline);
printf("n the no. of spaces used =%d", space);
getch();
}
Mukesh Kumar
1110751908
CSE 7th
Sem
OUTPUT
Mukesh Kumar
1110751908
CSE 7th
Sem
Program-05
Write a program to find the leading terminals.
#include<stdio.h>
#include<string.h>
#include<conio.h>
int nt,t,top=0;
char s[50],NT[10],T[10],st[50],l[10][10],tr[50][50];
int searchnt(char a)
{
int count=-1,i;
for(i=0;i<nt;i++)
{
if(NT[i]==a)
return i;
}
return count;
}
int searchter(char a)
{
int count=-1,i;
for(i=0;i<t;i++)
{
if(T[i]==a)
return i;
}
return count;
}
void push(char a)
{
s[top]=a;
top++;
}
char pop()
{
top--;
return s[top];
}
void installl(int a,int b)
Mukesh Kumar
1110751908
CSE 7th
Sem
{
if(l[a][b]=='f')
{
l[a][b]='t';
push(T[b]);
push(NT[a]);
}}
void main()
{
int i,s,k,j,n;
char pr[30][30],b,c;
clrscr();
printf("Enter the no of production :");
scanf("%d",&n);
printf("Enter the productions one by onen");
for(i=0;i<n;i++)
scanf("%s", &pr[i]);
nt=0;
t=0;
for(i=0;i<n;i++)
{
if((searchnt(pr[i][0]))==-1)
NT[nt++]=pr[i][0];
}
for(i=0;i<n;i++){
for(j=3;j<strlen(pr[i]);j++){
if(searchnt(pr[i][j])==-1)
{
if(searchter(pr[i][j])==-1)
T[t++]=pr[i][j];
}}}
for(i=0;i<nt;i++){
for(j=0;j<t;j++)
l[i][j]='f';
}
for(i=0;i<nt;i++){
for(j=0;j<t;j++)
tr[i][j]='f';
}
Mukesh Kumar
1110751908
CSE 7th
Sem
for(i=0;i<nt;i++)
{
for(j=0;j<n;j++)
{
if(NT[(searchnt(pr[j][0]))]==NT[i])
{
if(searchter(pr[j][3])!=-1)
installl(searchnt(pr[j][0]),searchter(pr[j][3]));
else
{
for(k=3;k<strlen(pr[j]);k++){
if(searchnt(pr[j][k])==-1)
{
installl(searchnt(pr[j][0]),searchter(pr[j][k]));
break;
}}}}}}
while(top!=0)
{
b=pop();
c=pop();
for(s=0;s<n;s++){
if(pr[s][3]==b)
installl(searchnt(pr[s][0]),searchter(c));
}}
for(i=0;i<nt;i++)
{
printf("Leading %c:t{", NT[i] );
for(j=0;j<t;j++){
if(l[i][j]=='t')
printf("%c , ", T[j]);
}
printf("}n");
}
getch();
}
Mukesh Kumar
1110751908
CSE 7th
Sem
OUTPUT
Mukesh Kumar
1110751908
CSE 7th
Sem
Program-06
Write a program to find the trailing terminals.
#include<stdio.h>
#include<string.h>
#include<conio.h>
int nt,t,top=0;
char s[50],NT[10],T[10],st[50],l[10][10],tr[50][50];
int searchnt(char a)
{
int count=-1,i;
for(i=0;i<nt;i++)
{
if(NT[i]==a)
return i;
}
return count;
}
int searchter(char a)
{
int count=-1,i;
for(i=0;i<t;i++)
{
if(T[i]==a)
return i;
}
return count;
}
void push(char a)
{
s[top]=a;
top++;
}
char pop()
{
top--;
return s[top];
}
void installt(int a,int b){
Mukesh Kumar
1110751908
CSE 7th
Sem
if(tr[a][b]=='f'){
tr[a][b]='t';
push(T[b]);
push(NT[a]);
}}
void main()
{
int i,s,k,j,n;
char pr[30][30],b,c;
clrscr();
printf("Enter the no of productions:");
scanf("%d",&n);
printf("Enter the productions one by onen");
for(i=0;i<n;i++)
scanf("%s",&pr[i]);
nt=0;
t=0;
for(i=0;i<n;i++){
if((searchnt(pr[i][0]))==-1)
NT[nt++]=pr[i][0];
}
for(i=0;i<n;i++)
{
for(j=3;j<strlen(pr[i]);j++)
{
if(searchnt(pr[i][j])==-1)
{
if(searchter(pr[i][j])==-1)
T[t++]=pr[i][j];
}}}
for(i=0;i<nt;i++){
for(j=0;j<t;j++)
l[i][j]='f';
}
for(i=0;i<nt;i++){
for(j=0;j<t;j++)
tr[i][j]='f';
}
for(i=0;i<nt;i++){
Mukesh Kumar
1110751908
CSE 7th
Sem
for(j=0;j<n;j++){
if(NT[(searchnt(pr[j][0]))]==NT[i])
{
if(searchter(pr[j][3])!=-1)
top=0;
for(i=0;i<nt;i++)
{
for(j=0;j<n;j++){
if(NT[searchnt(pr[j][0])]==NT[i])
{
if(searchter(pr[j][strlen(pr[j])-1])!=-1)
installt(searchnt(pr[j][0]),searchter(pr[j][strlen(pr[j])-1]));
else
{
for(k=(strlen(pr[j])-1);k>=3;k--)
{
if(searchnt(pr[j][k])==-1)
{
installt(searchnt(pr[j][0]),searchter(pr[j][k]));
break;
}}}}}}
while(top!=0)
{
b=pop();
c=pop();
for(s=0;s<n;s++){
if(pr[s][3]==b)
installt(searchnt(pr[s][0]),searchter(c));
}}
for(i=0;i<nt;i++){
printf("Trailing %ct{", NT[i]);
for(j=0;j<t;j++){
if(tr[i][j]=='t')
printf("%c ,", T[j]);
}
printf("}n");
}
getch();
}}}}
Mukesh Kumar
1110751908
CSE 7th
Sem
OUTPUT
Mukesh Kumar
1110751908
CSE 7th
Sem
Program-07
Write a program for computation of first.
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char t[5],nt[10],p[5][5],first[5][5],temp;
int i,j,not,nont,k=0,f=0;
clrscr();
printf("Enter the no. of Non-terminals in the grammer:");
scanf("%d",&nont);
printf("nEnter the Non-terminals in the grammer:");
for(i=0;i<nont;i++)
{
scanf("n%c",&nt[i]);
}
printf("nEnter the no. of Terminals in the grammer: ( Enter e for absiline ) ");
scanf("%d",&not);
printf("Enter the Terminals in the grammer:");
for(i=0;i<not||t[i]=='$';i++)
{
scanf("n%c",&t[i]);
}
for(i=0;i<nont;i++)
{
p[i][0]=nt[i];
first[i][0]=nt[i];
}
printf("nEnter the productions :n");
for(i=0;i<nont;i++)
{
scanf("%c",&temp);
printf("nEnter the production for %c ( End the production with '$' sign ) :",p[i][0]);
for(j=0;p[i][j]!='$';)
{
Mukesh Kumar
1110751908
CSE 7th
Sem
j+=1;
scanf("%c",&p[i][j]);
}}
for(i=0;i<nont;i++)
{
printf("nThe production for %c -> ",p[i][0]);
for(j=1;p[i][j]!='$';j++)
{
printf("%c",p[i][j]);
}}
for(i=0;i<nont;i++)
{
f=0;
for(j=1;p[i][j]!='$';j++)
{
for(k=0;k<not;k++){
if(f==1)
break;
if(p[i][j]==t[k])
{
first[i][j]=t[k]; first[i][j+1]='$'; f=1;
break;
}
else if(p[i][j]==nt[k])
{
first[i][j]=first[k][j];
if(first[i][j]=='e')
continue; first[i][j+1]='$'; f=1;
break;
}}}}
for(i=0;i<nont;i++)
{
printf("nnThe first of %c -> ",first[i][0]);
for(j=1;first[i][j]!='$';j++)
{
printf("%ct",first[i][j]);
}}
getch();
}
Mukesh Kumar
1110751908
CSE 7th
Sem
OUTPUT
Mukesh Kumar
1110751908
CSE 7th
Sem
Program-08
Write a program to show the operations of stack.
#include<stdio.h>
#include<conio.h>
#define MAXSIZE 10
void push();
int pop();
void traverse();
int stack[MAXSIZE];
int Top=-1;
void main()
{
int choice;
char ch;
do
{
clrscr();
printf("nENTER 1 FOR PUSH: ");
printf("nENTER 2 TO POP THE ELEMENT: ");
printf("nENTER 3 TO TRAVERSE THE ELEMENTS: ");
printf("n ENTER YOUR CHOICE: ");
scanf("%d",&choice);
switch(choice)
{
case 1:push();
break;
case 2:printf("nTHE DELETED ELEMENT IS %d",pop());
break;
case 3: traverse();
break;
default:printf("n SORRY!!!!!YOU HAVE ENTERED A WRONG CHOICE");
}
printf("n DO YOU WISH TO CONTINUE???(Y/N): ");
fflush(stdin);
scanf("%c",&ch);
}
while(ch=='y'|| ch=='Y');
}
Mukesh Kumar
1110751908
CSE 7th
Sem
void push()
{
int item;
if(Top==MAXSIZE-1)
{
printf("n SORRY STACK IS FULL");
getch();
exit();
}
else
{
printf("ENTER THE ELEMENT TO BE INSERTED: ");
scanf("%d",&item);
Top=Top+1;
stack[Top]=item;
}
}
int pop()
{
int item;
if(Top==-1)
{
printf("SORRY!! STACK IS EMPTY");
getch();
exit();
}
else
{
item=stack[Top];
Top=Top-1;
}
return(item);
}
void traverse()
{
int i;
if(Top==-1)
{
printf("OHH!! STACK IS EMPTY");
Mukesh Kumar
1110751908
CSE 7th
Sem
getch();
exit();
}
else
{
for(i=Top;i>=0;i--)
{
printf("nTRAVERSED ELEMENT(S) IS/ARE:");
printf(" %d",stack[i]);
}
}
}
Mukesh Kumar
1110751908
CSE 7th
Sem
OUTPUT
Mukesh Kumar
1110751908
CSE 7th
Sem
Program-09
Write a program to perform the operations on stack by using linked list.
#include<stdio.h>
#include<conio.h>
struct stack
{
int no;
struct stack *next;
}
*start=NULL;
typedef struct stack st;
void push();
int pop();
void display();
void main()
{
int choice, item;
char ch;
do
{
clrscr();
printf("nENTER 1 FOR PUSH ITEM: ");
printf("nENTER 2 TO POP THE ITEM FROM STACK: ");
printf("nENTER 3 TO DISPLAY THE ITEMS OF STACK: ");
printf("n ENTER YOUR CHOICE: ");
scanf("%d",&choice);
switch(choice)
{
case 1:push();
break;
case 2: item=pop();
printf("THE DELETED ITEM IS -->%d", item);
break;
case 3: display();
break;
default:printf("n SORRY!!!!!YOU HAVE ENTERED A WRONG CHOICE");
}
printf("n DO YOU WISH TO CONTINUE???(Y/N): ");
Mukesh Kumar
1110751908
CSE 7th
Sem
fflush(stdin);
scanf("%c",&ch);
}
while(ch=='y'|| ch=='Y');
}
void push()
{
st *node ;
node=(st *)malloc(sizeof(st));
printf("n ENTER THE NUMBER TO BE INSERTED");
scanf("%d",&node->no);
node->next =start;
start=node;
}
int pop()
{
st *temp;
temp=start;
if(start==NULL){
printf("STACK IS ALREADY EMPTY: ");
getch();
exit();
}
else
{
start=start->next;
free(temp);
}
return(temp->no);
}
void display(){
st *temp;
temp=start;
while(temp->next!=NULL){
printf("n no=%d", temp->no);
temp=temp->next;
}
printf("n no=%d",temp->no);
}
Mukesh Kumar
1110751908
CSE 7th
Sem
OUTPUT
Mukesh Kumar
1110751908
CSE 7th
Sem
Program-10
Write a program to perform the operations on file.
#include<stdio.h>
#include<stdlib.h>
int main()
{
char ch,source_file[20],target_file[20];
FILE *source, *target;
printf("Enter the name of file to copyn ");
gets(source_file);
source=fopen(source_file,"r");
if(source==NULL)
{
printf("Press any key to exit..n ");
exit(EXIT_FAILURE);
}
printf("Enter the name of target filen");
gets(target_file);
target=fopen(target_file,"w");
if(target==NULL)
{
fclose(source);
printf("Press any key to exit..n");
exit(EXIT_FAILURE);
}
while((ch=fgetc(source))!=EOF)
fputc(ch,target);
printf("File copied successfullyn");
fclose(source);
fclose(target);
return 0;
}
Mukesh Kumar
1110751908
CSE 7th
Sem
OUTPUT

More Related Content

What's hot

Phases of compiler
Phases of compilerPhases of compiler
Phases of compiler
Karan Deopura
 
Time complexity
Time complexityTime complexity
Time complexity
Katang Isip
 
8 queens problem using back tracking
8 queens problem using back tracking8 queens problem using back tracking
8 queens problem using back trackingTech_MX
 
1.Role lexical Analyzer
1.Role lexical Analyzer1.Role lexical Analyzer
1.Role lexical Analyzer
Radhakrishnan Chinnusamy
 
Loops in Python
Loops in PythonLoops in Python
Loops in Python
Arockia Abins
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to Algorithms
Mohamed Loey
 
Python for loop
Python for loopPython for loop
Python for loop
Aishwarya Deshmukh
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
Rishabh Soni
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)
swapnac12
 
Lexical Analysis - Compiler design
Lexical Analysis - Compiler design Lexical Analysis - Compiler design
Lexical Analysis - Compiler design
Aman Sharma
 
how to calclute time complexity of algortihm
how to calclute time complexity of algortihmhow to calclute time complexity of algortihm
how to calclute time complexity of algortihmSajid Marwat
 
Mathematical Analysis of Non-Recursive Algorithm.
Mathematical Analysis of Non-Recursive Algorithm.Mathematical Analysis of Non-Recursive Algorithm.
Mathematical Analysis of Non-Recursive Algorithm.
mohanrathod18
 
Algorithmic problem solving
Algorithmic problem solvingAlgorithmic problem solving
Algorithmic problem solving
Prabhakaran V M
 
Code Optimization
Code OptimizationCode Optimization
Code Optimization
Akhil Kaushik
 
Traveling salesman problem
Traveling salesman problemTraveling salesman problem
Traveling salesman problem
Jayesh Chauhan
 
Token, Pattern and Lexeme
Token, Pattern and LexemeToken, Pattern and Lexeme
Token, Pattern and Lexeme
A. S. M. Shafi
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of Algorithms
Arvind Krishnaa
 
Lecture 01 introduction to compiler
Lecture 01 introduction to compilerLecture 01 introduction to compiler
Lecture 01 introduction to compiler
Iffat Anjum
 
RECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSINGRECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSING
Jothi Lakshmi
 

What's hot (20)

Phases of compiler
Phases of compilerPhases of compiler
Phases of compiler
 
Time complexity
Time complexityTime complexity
Time complexity
 
8 queens problem using back tracking
8 queens problem using back tracking8 queens problem using back tracking
8 queens problem using back tracking
 
1.Role lexical Analyzer
1.Role lexical Analyzer1.Role lexical Analyzer
1.Role lexical Analyzer
 
Loops in Python
Loops in PythonLoops in Python
Loops in Python
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to Algorithms
 
Python for loop
Python for loopPython for loop
Python for loop
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)
 
Lexical Analysis - Compiler design
Lexical Analysis - Compiler design Lexical Analysis - Compiler design
Lexical Analysis - Compiler design
 
how to calclute time complexity of algortihm
how to calclute time complexity of algortihmhow to calclute time complexity of algortihm
how to calclute time complexity of algortihm
 
Mathematical Analysis of Non-Recursive Algorithm.
Mathematical Analysis of Non-Recursive Algorithm.Mathematical Analysis of Non-Recursive Algorithm.
Mathematical Analysis of Non-Recursive Algorithm.
 
Algorithmic problem solving
Algorithmic problem solvingAlgorithmic problem solving
Algorithmic problem solving
 
Code Optimization
Code OptimizationCode Optimization
Code Optimization
 
Traveling salesman problem
Traveling salesman problemTraveling salesman problem
Traveling salesman problem
 
Token, Pattern and Lexeme
Token, Pattern and LexemeToken, Pattern and Lexeme
Token, Pattern and Lexeme
 
Topdown parsing
Topdown parsingTopdown parsing
Topdown parsing
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of Algorithms
 
Lecture 01 introduction to compiler
Lecture 01 introduction to compilerLecture 01 introduction to compiler
Lecture 01 introduction to compiler
 
RECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSINGRECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSING
 

Similar to Compiler design lab programs

Numerical analysis
Numerical analysisNumerical analysis
Numerical analysisVishal Singh
 
Shad_Cryptography_PracticalFile_IT_4th_Year (1).docx
Shad_Cryptography_PracticalFile_IT_4th_Year (1).docxShad_Cryptography_PracticalFile_IT_4th_Year (1).docx
Shad_Cryptography_PracticalFile_IT_4th_Year (1).docx
Sonu62614
 
Mech nacp lab
Mech nacp labMech nacp lab
Mech nacp lab
Vivek Kumar Sinha
 
C- Programming Assignment 3
C- Programming Assignment 3C- Programming Assignment 3
C- Programming Assignment 3
Animesh Chaturvedi
 
CBSE XII COMPUTER SCIENCE STUDY MATERIAL BY KVS
CBSE XII COMPUTER SCIENCE STUDY MATERIAL BY KVSCBSE XII COMPUTER SCIENCE STUDY MATERIAL BY KVS
CBSE XII COMPUTER SCIENCE STUDY MATERIAL BY KVS
Gautham Rajesh
 
Java final lab
Java final labJava final lab
Java final lab
Vivek Kumar Sinha
 
VTU PCD Model Question Paper - Programming in C
VTU PCD Model Question Paper - Programming in CVTU PCD Model Question Paper - Programming in C
VTU PCD Model Question Paper - Programming in C
Syed Mustafa
 
answer-model-qp-15-pcd13pcd
answer-model-qp-15-pcd13pcdanswer-model-qp-15-pcd13pcd
answer-model-qp-15-pcd13pcd
Syed Mustafa
 
Data structure new lab manual
Data structure  new lab manualData structure  new lab manual
Data structure new lab manualSANTOSH RATH
 
Assignment c programming
Assignment c programmingAssignment c programming
Assignment c programming
Icaii Infotech
 
Ankita sharma focp
Ankita sharma focpAnkita sharma focp
Ankita sharma focp
AnkitaSharma463389
 
ds-10.pdf
ds-10.pdfds-10.pdf
ds-10.pdf
VanshGarg64
 
Ocs752 unit 3
Ocs752   unit 3Ocs752   unit 3
Ocs752 unit 3
mgrameshmail
 
Quiz On Strings
Quiz On StringsQuiz On Strings
Quiz On Strings
Bhavya Singhal
 
C Programming: Control Structure
C Programming: Control StructureC Programming: Control Structure
C Programming: Control Structure
Sokngim Sa
 
Scala as a Declarative Language
Scala as a Declarative LanguageScala as a Declarative Language
Scala as a Declarative Language
vsssuresh
 
Ada lab manual
Ada lab manualAda lab manual
Ada lab manual
aman713418
 
data structure and algorithm.pdf
data structure and algorithm.pdfdata structure and algorithm.pdf
data structure and algorithm.pdf
Asrinath1
 
Javascript math boolean string date
Javascript math boolean string dateJavascript math boolean string date
Javascript math boolean string date
Frayosh Wadia
 
Data structures lab manual
Data structures lab manualData structures lab manual
Data structures lab manual
Syed Mustafa
 

Similar to Compiler design lab programs (20)

Numerical analysis
Numerical analysisNumerical analysis
Numerical analysis
 
Shad_Cryptography_PracticalFile_IT_4th_Year (1).docx
Shad_Cryptography_PracticalFile_IT_4th_Year (1).docxShad_Cryptography_PracticalFile_IT_4th_Year (1).docx
Shad_Cryptography_PracticalFile_IT_4th_Year (1).docx
 
Mech nacp lab
Mech nacp labMech nacp lab
Mech nacp lab
 
C- Programming Assignment 3
C- Programming Assignment 3C- Programming Assignment 3
C- Programming Assignment 3
 
CBSE XII COMPUTER SCIENCE STUDY MATERIAL BY KVS
CBSE XII COMPUTER SCIENCE STUDY MATERIAL BY KVSCBSE XII COMPUTER SCIENCE STUDY MATERIAL BY KVS
CBSE XII COMPUTER SCIENCE STUDY MATERIAL BY KVS
 
Java final lab
Java final labJava final lab
Java final lab
 
VTU PCD Model Question Paper - Programming in C
VTU PCD Model Question Paper - Programming in CVTU PCD Model Question Paper - Programming in C
VTU PCD Model Question Paper - Programming in C
 
answer-model-qp-15-pcd13pcd
answer-model-qp-15-pcd13pcdanswer-model-qp-15-pcd13pcd
answer-model-qp-15-pcd13pcd
 
Data structure new lab manual
Data structure  new lab manualData structure  new lab manual
Data structure new lab manual
 
Assignment c programming
Assignment c programmingAssignment c programming
Assignment c programming
 
Ankita sharma focp
Ankita sharma focpAnkita sharma focp
Ankita sharma focp
 
ds-10.pdf
ds-10.pdfds-10.pdf
ds-10.pdf
 
Ocs752 unit 3
Ocs752   unit 3Ocs752   unit 3
Ocs752 unit 3
 
Quiz On Strings
Quiz On StringsQuiz On Strings
Quiz On Strings
 
C Programming: Control Structure
C Programming: Control StructureC Programming: Control Structure
C Programming: Control Structure
 
Scala as a Declarative Language
Scala as a Declarative LanguageScala as a Declarative Language
Scala as a Declarative Language
 
Ada lab manual
Ada lab manualAda lab manual
Ada lab manual
 
data structure and algorithm.pdf
data structure and algorithm.pdfdata structure and algorithm.pdf
data structure and algorithm.pdf
 
Javascript math boolean string date
Javascript math boolean string dateJavascript math boolean string date
Javascript math boolean string date
 
Data structures lab manual
Data structures lab manualData structures lab manual
Data structures lab manual
 

Recently uploaded

Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 

Recently uploaded (20)

Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 

Compiler design lab programs