Question: CS 4110 Compiler Design - Project Phase 1. Lexical analysis Total Points: 15 In this project, you need to implement a compiler for a language

 CS 4110 Compiler Design - Project Phase 1. Lexical analysis Total
Points: 15 In this project, you need to implement a compiler for
a language defined here. The programming language you need to use is
C or C++ (and the language defined by the corresponding tools). The

CS 4110 Compiler Design - Project Phase 1. Lexical analysis Total Points: 15 In this project, you need to implement a compiler for a language defined here. The programming language you need to use is C or C++ (and the language defined by the corresponding tools). The project includes two phases, lexical analysis, and syntax analysis. In the following, we first define the language syntax a nd tokens. The definitions are given in BNF form. 1 Language Definitions 1.1 Syntax Definitions program : . "?-program., program-name function-definitions statements } program-nameidentifier function-definitions ::= (function-definition)" function-definition (" Function function-name arguments statements "return.. retum-arg }" function-name identifier arguments-(argument)" argument :identifier return-arg ::-identifier | statements(statement)+ statement ::- assignment-stmt function-call if-stmt while-stmt assignment-stmt-:= (" 'identifier param eter "I' function-call ::-{"function-name parameters ..}"I {"predefined-function parameters ..!" predefined-function-+ I - I * 1, 1 .%", I "print'. parameters (parameter)* parameter function-call | identifier number character-string Boolearn number-integer l float if-stmt : := (" "if" expression"then" statements else" statements" while-stmt ::-{ ..while" expression do" statements";" expression ::- {"comparison-operator parameter parameter I'l {"Boolean-operator expression expression")" | Boolean comparison-operator ::-"m" 11 Boolean-operator "or"| , 1=.. I "G" I ""s" "and

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!