SlideShare una empresa de Scribd logo
1 de 2
Descargar para leer sin conexión
Lexical Analysis
all done in c languge
part (A)
In this assignment you will improve the lexical analyser described in section 4.2 of the textbook
(Sebesta). The improved version of the lexical analyser should be able to (i) report errors in the
identifiers and integer literals, (ii) it should be able to recognize assignment operator and certain
keywords.
First get the code (in C language) for the lexical analyser described in the textbook working. Try
it out on simple examples, e.g. (sum + 47) / total. It is not be able to report errors in identifiers
and integer literals. (The rules for identifiers and literals are described in the book.) For example,
how does it handle an illegal identifier 2sum or an illegal integer literal 23b2? Make appropriate
changes to the state transition diagram and the code to enable the lexical analyser report the
above mentioned errors.
Second change is to enable the lexical analyser handle assignment operators and certain key
words. After this change it should be able to handle assignment statements and keywords: if,
then and else. Test your analyser on the following input file:
x = 5
sum = x * 3 / 5
if sum > 1 then sum = sum + 1 else sum = sum 1
Rubrics: Marks 10/10 if the lexical analyser recognizes all the tokens correctly and reports illegal
identifiers such as 2sum, or illegal operators
part (B)
In this assignment you will extend the work that you did in Assignment 1 on lexical analysis.
You will now add a syntax analyser (parser) to it. The syntax analyser will handle expressions
described by the EBNF given as an example in section 4.4.1 of the textbook. The parser will be
based on a recursive-descent parsing algorithm, and the outline C code for the parser is already
given in the textbook. You will improve it by adding error handling capability.
First get the code for the recursive-descent parser described in the textbook working. Try it out
on simple examples, e.g. (sum + 47) / total. This example should produce the trace given in
section 4.4.1 (page 184-185 of 10th edition). To handle the error-handling you will have to
implement the error() function. This function should report errors and also indicate what is
expected by the parser in case a wrong token is found at the input.
Rubrics: Marks 10/10 if missing operator error, missing right bracket, missing left bracket is
detected and reported.
if you need anything just text me thanks you a lot

Más contenido relacionado

Similar a Lexical Analysis all done in c languge part (A)In this assignm.pdf

Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programmingAMAN ANAND
 
Phases of the Compiler - Systems Programming
Phases of the Compiler - Systems ProgrammingPhases of the Compiler - Systems Programming
Phases of the Compiler - Systems ProgrammingMukesh Tekwani
 
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docxvenkatapranaykumarGa
 
match the following attributes to the parts of a compilerstrips ou.pdf
match the following attributes to the parts of a compilerstrips ou.pdfmatch the following attributes to the parts of a compilerstrips ou.pdf
match the following attributes to the parts of a compilerstrips ou.pdfarpitaeron555
 
Algorithm and c language
Algorithm and c languageAlgorithm and c language
Algorithm and c languagekamalbeydoun
 
It’s sometimes useful to make a little language for a simple problem.pdf
It’s sometimes useful to make a little language for a simple problem.pdfIt’s sometimes useful to make a little language for a simple problem.pdf
It’s sometimes useful to make a little language for a simple problem.pdfarri2009av
 
Dineshmaterial1 091225091539-phpapp02
Dineshmaterial1 091225091539-phpapp02Dineshmaterial1 091225091539-phpapp02
Dineshmaterial1 091225091539-phpapp02Tirumala Rao
 
This first assignment will focus on coding in Python, applying kno.docx
This first assignment will focus on coding in Python, applying kno.docxThis first assignment will focus on coding in Python, applying kno.docx
This first assignment will focus on coding in Python, applying kno.docxabhi353063
 
Compiler design important questions
Compiler design   important questionsCompiler design   important questions
Compiler design important questionsakila viji
 
Functions in C++
Functions in C++Functions in C++
Functions in C++home
 
ProjectCompilers.pdfPage 1 of 6 Project Con.docx
ProjectCompilers.pdfPage 1 of 6 Project Con.docxProjectCompilers.pdfPage 1 of 6 Project Con.docx
ProjectCompilers.pdfPage 1 of 6 Project Con.docxwkyra78
 

Similar a Lexical Analysis all done in c languge part (A)In this assignm.pdf (20)

LANGUAGE PROCESSOR
LANGUAGE PROCESSORLANGUAGE PROCESSOR
LANGUAGE PROCESSOR
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Phases of the Compiler - Systems Programming
Phases of the Compiler - Systems ProgrammingPhases of the Compiler - Systems Programming
Phases of the Compiler - Systems Programming
 
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
 
match the following attributes to the parts of a compilerstrips ou.pdf
match the following attributes to the parts of a compilerstrips ou.pdfmatch the following attributes to the parts of a compilerstrips ou.pdf
match the following attributes to the parts of a compilerstrips ou.pdf
 
Overview of C Language
Overview of C LanguageOverview of C Language
Overview of C Language
 
Algorithm and c language
Algorithm and c languageAlgorithm and c language
Algorithm and c language
 
chapter4 end.pptx
chapter4 end.pptxchapter4 end.pptx
chapter4 end.pptx
 
Mycasestudy
MycasestudyMycasestudy
Mycasestudy
 
It’s sometimes useful to make a little language for a simple problem.pdf
It’s sometimes useful to make a little language for a simple problem.pdfIt’s sometimes useful to make a little language for a simple problem.pdf
It’s sometimes useful to make a little language for a simple problem.pdf
 
Python Objects
Python ObjectsPython Objects
Python Objects
 
Dineshmaterial1 091225091539-phpapp02
Dineshmaterial1 091225091539-phpapp02Dineshmaterial1 091225091539-phpapp02
Dineshmaterial1 091225091539-phpapp02
 
Handout#02
Handout#02Handout#02
Handout#02
 
This first assignment will focus on coding in Python, applying kno.docx
This first assignment will focus on coding in Python, applying kno.docxThis first assignment will focus on coding in Python, applying kno.docx
This first assignment will focus on coding in Python, applying kno.docx
 
Compiler design important questions
Compiler design   important questionsCompiler design   important questions
Compiler design important questions
 
C compiler(final)
C compiler(final)C compiler(final)
C compiler(final)
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
Compiler Design Material
Compiler Design MaterialCompiler Design Material
Compiler Design Material
 
Introduction of C++ By Pawan Thakur
Introduction of C++ By Pawan ThakurIntroduction of C++ By Pawan Thakur
Introduction of C++ By Pawan Thakur
 
ProjectCompilers.pdfPage 1 of 6 Project Con.docx
ProjectCompilers.pdfPage 1 of 6 Project Con.docxProjectCompilers.pdfPage 1 of 6 Project Con.docx
ProjectCompilers.pdfPage 1 of 6 Project Con.docx
 

Más de balrajashok

Los procedimientos anal�ticos son procedimientos sustantivos que pue.pdf
Los procedimientos anal�ticos son procedimientos sustantivos que pue.pdfLos procedimientos anal�ticos son procedimientos sustantivos que pue.pdf
Los procedimientos anal�ticos son procedimientos sustantivos que pue.pdfbalrajashok
 
Los plurales de algunos t�rminos m�dicos pueden ser dif�ciles de con.pdf
Los plurales de algunos t�rminos m�dicos pueden ser dif�ciles de con.pdfLos plurales de algunos t�rminos m�dicos pueden ser dif�ciles de con.pdf
Los plurales de algunos t�rminos m�dicos pueden ser dif�ciles de con.pdfbalrajashok
 
Los miembros deben usar el marco conceptual AICPA para la independen.pdf
Los miembros deben usar el marco conceptual AICPA para la independen.pdfLos miembros deben usar el marco conceptual AICPA para la independen.pdf
Los miembros deben usar el marco conceptual AICPA para la independen.pdfbalrajashok
 
Los patrones caracter�sticos del ciclo econ�mico de valle, expansi�n.pdf
Los patrones caracter�sticos del ciclo econ�mico de valle, expansi�n.pdfLos patrones caracter�sticos del ciclo econ�mico de valle, expansi�n.pdf
Los patrones caracter�sticos del ciclo econ�mico de valle, expansi�n.pdfbalrajashok
 
Los pa�ses de bajos ingresos tienen un INB per c�pita de $1,005 o me.pdf
Los pa�ses de bajos ingresos tienen un INB per c�pita de $1,005 o me.pdfLos pa�ses de bajos ingresos tienen un INB per c�pita de $1,005 o me.pdf
Los pa�ses de bajos ingresos tienen un INB per c�pita de $1,005 o me.pdfbalrajashok
 
Los museos p�blicos a veces piden a los patrocinadores que donen una.pdf
Los museos p�blicos a veces piden a los patrocinadores que donen una.pdfLos museos p�blicos a veces piden a los patrocinadores que donen una.pdf
Los museos p�blicos a veces piden a los patrocinadores que donen una.pdfbalrajashok
 
Los loci A y B tienen una frecuencia de recombinaci�n del 5 por cien.pdf
Los loci A y B tienen una frecuencia de recombinaci�n del 5 por cien.pdfLos loci A y B tienen una frecuencia de recombinaci�n del 5 por cien.pdf
Los loci A y B tienen una frecuencia de recombinaci�n del 5 por cien.pdfbalrajashok
 
Los mercados sociales act�an como ______________ en l�nea aprovechan.pdf
Los mercados sociales act�an como ______________ en l�nea aprovechan.pdfLos mercados sociales act�an como ______________ en l�nea aprovechan.pdf
Los mercados sociales act�an como ______________ en l�nea aprovechan.pdfbalrajashok
 
Los ingresos de una entidad normalmente se miden por los valores de .pdf
Los ingresos de una entidad normalmente se miden por los valores de .pdfLos ingresos de una entidad normalmente se miden por los valores de .pdf
Los ingresos de una entidad normalmente se miden por los valores de .pdfbalrajashok
 
Los impuestos a la propiedad sobre las instalaciones de fabricaci�n .pdf
Los impuestos a la propiedad sobre las instalaciones de fabricaci�n .pdfLos impuestos a la propiedad sobre las instalaciones de fabricaci�n .pdf
Los impuestos a la propiedad sobre las instalaciones de fabricaci�n .pdfbalrajashok
 
Los hombres tienen m�s probabilidades de sufrir una enfermedad o tra.pdf
Los hombres tienen m�s probabilidades de sufrir una enfermedad o tra.pdfLos hombres tienen m�s probabilidades de sufrir una enfermedad o tra.pdf
Los hombres tienen m�s probabilidades de sufrir una enfermedad o tra.pdfbalrajashok
 
Los helechos, un tipo de planta, pasan por una alternancia de genera.pdf
Los helechos, un tipo de planta, pasan por una alternancia de genera.pdfLos helechos, un tipo de planta, pasan por una alternancia de genera.pdf
Los helechos, un tipo de planta, pasan por una alternancia de genera.pdfbalrajashok
 
Los ganglios linf�ticos funcionan como puntos de encuentro entre las.pdf
Los ganglios linf�ticos funcionan como puntos de encuentro entre las.pdfLos ganglios linf�ticos funcionan como puntos de encuentro entre las.pdf
Los ganglios linf�ticos funcionan como puntos de encuentro entre las.pdfbalrajashok
 
Los estudios de casos de gesti�n de proyectos se basan en el PMI 201.pdf
Los estudios de casos de gesti�n de proyectos se basan en el PMI 201.pdfLos estudios de casos de gesti�n de proyectos se basan en el PMI 201.pdf
Los estudios de casos de gesti�n de proyectos se basan en el PMI 201.pdfbalrajashok
 
Los estados financieros de todo el gobierno benefician a los usuar.pdf
Los estados financieros de todo el gobierno benefician a los usuar.pdfLos estados financieros de todo el gobierno benefician a los usuar.pdf
Los estados financieros de todo el gobierno benefician a los usuar.pdfbalrajashok
 
Los especialistas en marketing incorporan mensajes encubiertos en an.pdf
Los especialistas en marketing incorporan mensajes encubiertos en an.pdfLos especialistas en marketing incorporan mensajes encubiertos en an.pdf
Los especialistas en marketing incorporan mensajes encubiertos en an.pdfbalrajashok
 
Los estados financieros de Rukavina Corporation son los siguientes .pdf
Los estados financieros de Rukavina Corporation son los siguientes .pdfLos estados financieros de Rukavina Corporation son los siguientes .pdf
Los estados financieros de Rukavina Corporation son los siguientes .pdfbalrajashok
 
Los elementos de la agencia aparente son A confianza en la repre.pdf
Los elementos de la agencia aparente son A confianza en la repre.pdfLos elementos de la agencia aparente son A confianza en la repre.pdf
Los elementos de la agencia aparente son A confianza en la repre.pdfbalrajashok
 
Los empleados primero�. Ese es el valor cultural m�s importante y cr.pdf
Los empleados primero�. Ese es el valor cultural m�s importante y cr.pdfLos empleados primero�. Ese es el valor cultural m�s importante y cr.pdf
Los empleados primero�. Ese es el valor cultural m�s importante y cr.pdfbalrajashok
 
Los enfoques de Teaming que se usan en los grupos de LinkedIn normal.pdf
Los enfoques de Teaming que se usan en los grupos de LinkedIn normal.pdfLos enfoques de Teaming que se usan en los grupos de LinkedIn normal.pdf
Los enfoques de Teaming que se usan en los grupos de LinkedIn normal.pdfbalrajashok
 

Más de balrajashok (20)

Los procedimientos anal�ticos son procedimientos sustantivos que pue.pdf
Los procedimientos anal�ticos son procedimientos sustantivos que pue.pdfLos procedimientos anal�ticos son procedimientos sustantivos que pue.pdf
Los procedimientos anal�ticos son procedimientos sustantivos que pue.pdf
 
Los plurales de algunos t�rminos m�dicos pueden ser dif�ciles de con.pdf
Los plurales de algunos t�rminos m�dicos pueden ser dif�ciles de con.pdfLos plurales de algunos t�rminos m�dicos pueden ser dif�ciles de con.pdf
Los plurales de algunos t�rminos m�dicos pueden ser dif�ciles de con.pdf
 
Los miembros deben usar el marco conceptual AICPA para la independen.pdf
Los miembros deben usar el marco conceptual AICPA para la independen.pdfLos miembros deben usar el marco conceptual AICPA para la independen.pdf
Los miembros deben usar el marco conceptual AICPA para la independen.pdf
 
Los patrones caracter�sticos del ciclo econ�mico de valle, expansi�n.pdf
Los patrones caracter�sticos del ciclo econ�mico de valle, expansi�n.pdfLos patrones caracter�sticos del ciclo econ�mico de valle, expansi�n.pdf
Los patrones caracter�sticos del ciclo econ�mico de valle, expansi�n.pdf
 
Los pa�ses de bajos ingresos tienen un INB per c�pita de $1,005 o me.pdf
Los pa�ses de bajos ingresos tienen un INB per c�pita de $1,005 o me.pdfLos pa�ses de bajos ingresos tienen un INB per c�pita de $1,005 o me.pdf
Los pa�ses de bajos ingresos tienen un INB per c�pita de $1,005 o me.pdf
 
Los museos p�blicos a veces piden a los patrocinadores que donen una.pdf
Los museos p�blicos a veces piden a los patrocinadores que donen una.pdfLos museos p�blicos a veces piden a los patrocinadores que donen una.pdf
Los museos p�blicos a veces piden a los patrocinadores que donen una.pdf
 
Los loci A y B tienen una frecuencia de recombinaci�n del 5 por cien.pdf
Los loci A y B tienen una frecuencia de recombinaci�n del 5 por cien.pdfLos loci A y B tienen una frecuencia de recombinaci�n del 5 por cien.pdf
Los loci A y B tienen una frecuencia de recombinaci�n del 5 por cien.pdf
 
Los mercados sociales act�an como ______________ en l�nea aprovechan.pdf
Los mercados sociales act�an como ______________ en l�nea aprovechan.pdfLos mercados sociales act�an como ______________ en l�nea aprovechan.pdf
Los mercados sociales act�an como ______________ en l�nea aprovechan.pdf
 
Los ingresos de una entidad normalmente se miden por los valores de .pdf
Los ingresos de una entidad normalmente se miden por los valores de .pdfLos ingresos de una entidad normalmente se miden por los valores de .pdf
Los ingresos de una entidad normalmente se miden por los valores de .pdf
 
Los impuestos a la propiedad sobre las instalaciones de fabricaci�n .pdf
Los impuestos a la propiedad sobre las instalaciones de fabricaci�n .pdfLos impuestos a la propiedad sobre las instalaciones de fabricaci�n .pdf
Los impuestos a la propiedad sobre las instalaciones de fabricaci�n .pdf
 
Los hombres tienen m�s probabilidades de sufrir una enfermedad o tra.pdf
Los hombres tienen m�s probabilidades de sufrir una enfermedad o tra.pdfLos hombres tienen m�s probabilidades de sufrir una enfermedad o tra.pdf
Los hombres tienen m�s probabilidades de sufrir una enfermedad o tra.pdf
 
Los helechos, un tipo de planta, pasan por una alternancia de genera.pdf
Los helechos, un tipo de planta, pasan por una alternancia de genera.pdfLos helechos, un tipo de planta, pasan por una alternancia de genera.pdf
Los helechos, un tipo de planta, pasan por una alternancia de genera.pdf
 
Los ganglios linf�ticos funcionan como puntos de encuentro entre las.pdf
Los ganglios linf�ticos funcionan como puntos de encuentro entre las.pdfLos ganglios linf�ticos funcionan como puntos de encuentro entre las.pdf
Los ganglios linf�ticos funcionan como puntos de encuentro entre las.pdf
 
Los estudios de casos de gesti�n de proyectos se basan en el PMI 201.pdf
Los estudios de casos de gesti�n de proyectos se basan en el PMI 201.pdfLos estudios de casos de gesti�n de proyectos se basan en el PMI 201.pdf
Los estudios de casos de gesti�n de proyectos se basan en el PMI 201.pdf
 
Los estados financieros de todo el gobierno benefician a los usuar.pdf
Los estados financieros de todo el gobierno benefician a los usuar.pdfLos estados financieros de todo el gobierno benefician a los usuar.pdf
Los estados financieros de todo el gobierno benefician a los usuar.pdf
 
Los especialistas en marketing incorporan mensajes encubiertos en an.pdf
Los especialistas en marketing incorporan mensajes encubiertos en an.pdfLos especialistas en marketing incorporan mensajes encubiertos en an.pdf
Los especialistas en marketing incorporan mensajes encubiertos en an.pdf
 
Los estados financieros de Rukavina Corporation son los siguientes .pdf
Los estados financieros de Rukavina Corporation son los siguientes .pdfLos estados financieros de Rukavina Corporation son los siguientes .pdf
Los estados financieros de Rukavina Corporation son los siguientes .pdf
 
Los elementos de la agencia aparente son A confianza en la repre.pdf
Los elementos de la agencia aparente son A confianza en la repre.pdfLos elementos de la agencia aparente son A confianza en la repre.pdf
Los elementos de la agencia aparente son A confianza en la repre.pdf
 
Los empleados primero�. Ese es el valor cultural m�s importante y cr.pdf
Los empleados primero�. Ese es el valor cultural m�s importante y cr.pdfLos empleados primero�. Ese es el valor cultural m�s importante y cr.pdf
Los empleados primero�. Ese es el valor cultural m�s importante y cr.pdf
 
Los enfoques de Teaming que se usan en los grupos de LinkedIn normal.pdf
Los enfoques de Teaming que se usan en los grupos de LinkedIn normal.pdfLos enfoques de Teaming que se usan en los grupos de LinkedIn normal.pdf
Los enfoques de Teaming que se usan en los grupos de LinkedIn normal.pdf
 

Último

What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 

Último (20)

What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 

Lexical Analysis all done in c languge part (A)In this assignm.pdf

  • 1. Lexical Analysis all done in c languge part (A) In this assignment you will improve the lexical analyser described in section 4.2 of the textbook (Sebesta). The improved version of the lexical analyser should be able to (i) report errors in the identifiers and integer literals, (ii) it should be able to recognize assignment operator and certain keywords. First get the code (in C language) for the lexical analyser described in the textbook working. Try it out on simple examples, e.g. (sum + 47) / total. It is not be able to report errors in identifiers and integer literals. (The rules for identifiers and literals are described in the book.) For example, how does it handle an illegal identifier 2sum or an illegal integer literal 23b2? Make appropriate changes to the state transition diagram and the code to enable the lexical analyser report the above mentioned errors. Second change is to enable the lexical analyser handle assignment operators and certain key words. After this change it should be able to handle assignment statements and keywords: if, then and else. Test your analyser on the following input file: x = 5 sum = x * 3 / 5 if sum > 1 then sum = sum + 1 else sum = sum 1 Rubrics: Marks 10/10 if the lexical analyser recognizes all the tokens correctly and reports illegal identifiers such as 2sum, or illegal operators part (B) In this assignment you will extend the work that you did in Assignment 1 on lexical analysis. You will now add a syntax analyser (parser) to it. The syntax analyser will handle expressions described by the EBNF given as an example in section 4.4.1 of the textbook. The parser will be based on a recursive-descent parsing algorithm, and the outline C code for the parser is already given in the textbook. You will improve it by adding error handling capability. First get the code for the recursive-descent parser described in the textbook working. Try it out on simple examples, e.g. (sum + 47) / total. This example should produce the trace given in section 4.4.1 (page 184-185 of 10th edition). To handle the error-handling you will have to
  • 2. implement the error() function. This function should report errors and also indicate what is expected by the parser in case a wrong token is found at the input. Rubrics: Marks 10/10 if missing operator error, missing right bracket, missing left bracket is detected and reported. if you need anything just text me thanks you a lot