Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Due Date: February 2 5 Objective: Learn programming language implementation systems that includes lexical and syntax analysis. Practice conducting lexical and syntax analysis on given
Due Date: February
Objective: Learn programming language implementation systems that includes lexical and syntax
analysis. Practice conducting lexical and syntax analysis on given program components.
Assignment: Language implementation systems must input a file, identify substrings, and find
all syntax errors, regardless of the specific implementation approach. For an input program a
lexical analyzer will break a file into lexemes and tokens. A parser will find all syntax errors. For
each error the parser will produce an appropriate diagnostic message and recover quickly.
For the Simple Function defined as follows, choose a programming language or Java that
you are familiar with, to implement a lexical analyzer and a topdown parser. The lexical analyzer
will read the test program and generate lexemes with token types. The parser must use the
recursivedescent parsing to implement the syntax analysis. The project must implement the
following functions:
Input the test program.
Use the Lexical Analyzer to generate lexemes and corresponding tokens, then display them.
Use the recursivedescent parser to check the syntax of the test program.
If the test program is generated by the EBNF grammar for Simple Function, your program
should display "The test program is generated by the EBNF grammar for Simple Function".
otherwise identify the first syntax error and display "The test program cannot be generated
by the EBNF Grammar for Simple Function. The first syntax error is Give identified
error
Requirements:
This is a twoperson team project.
Your team must use department programming standards.
The program must be executed correctly.
Email your program to
zliu@aggies.ncat.edu.
EBNF grammar for Simple Function:
Test your program using the following test programs as input files.
while
Second test program
void test int
;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started