Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In java or c++ Project Introduction In this project, you will write a lexical analyzer to recognize a given set of tokens for a programming

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

In java or c++

Project Introduction In this project, you will write a lexical analyzer to recognize a given set of tokens for a programming language that we will introduce later. Due date The assignment is due 11:59 pm PST on Feb. 19th Token Definition Token specification in the below table (Table 1) defines the tokens that must be recognized by your lexical analyzer. The first 18 tokens in the table are multi-symbol tokens in that each of them consists multiple characters. For example, ID (token # 10 in the table) is a type of multi- symbol token that represents an identifier, which is a sequence of (upper or lower case) letters or digits, beginning with a letter. ID is case sensitive and thus upper and lower cases are not the same. Some other tokens represent one or more reserved keywords in the target programming language, and those include BASE_TYPE (represents int, float, or bool), BREAK (represents break), DO, ELSE, etc. All multi-symbol tokens are separated from other multi- or single-symbol tokens by delimiters such as spaces, tabs, and newlines. Tokens numbered 19 30 in the table are single-symbol tokens. We do not provide names for those tokens, and you may consider that they don't need to be named or they are named using their literal values. Token Name AND BASE_TYPE BREAK DO ELSE EQ FALSE FOR GE Symbolic Pattern && int float bool break do else false for >= [A-Za-z][A-Za-Z0-9_)* | 11 = [A-Za-z][A-Za-Z0-9_)* | 11

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions