Answered step by step
Verified Expert Solution
Link Copied!

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 25
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 C++ or Java that
you are familiar with, to implement a lexical analyzer and a top-down parser. The lexical analyzer
will read the test program and generate lexemes with token types. The parser must use the
recursive-descent 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 recursive-descent 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 two-person team project.
Your team must use department programming standards.
The program must be executed correctly.
Email your program to
zliu2@aggies.ncat.edu.
EBNF grammar for Simple Function:
Test your program using the following test programs as input files.
while )
n=n-10
}
Second test program
void test 2(int m){
m=m-1;
}
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions