Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

import java, util.List: public class PLO2_Lexer f If PL62_Token is an abstract class, it is the parent class of all tokens. II 11 There are

image text in transcribed
import java, util.List: public class PLO2_Lexer f If PL62_Token is an abstract class, it is the parent class of all tokens. II 11 There are three types of tokens, capturing three kinds of non-empty strings, devoid of spaces 11 - PLO2_TokenInt unsigned integer (no decimal point), eg: "4". " 502" 11 - PLe2_Token0p "+" or " " 11. PLO2_Tokenstr others, eg: "apple", "abcs+x", "+++", "-+" 11 1/ The method "tokenize" breaks an expression into chunks, and return a list of the tokens of II the corresponding chunks. 1/ Il Exasple: 11 exprn 15: " 234+679 ice6 ++7=8.9 " 11 chunks are: "234" "+" "67" "-" "9" "ice" "6" "++" " " " " " 8 " ", "9" 1/ token types: Int 0p Int 0p Int str Int str op op Int str Int If Chunks are delimited by spaces, and transition between digit-char and non-digit-char 1/ 11. The following features are NoT allowed in this program: II trim split indexof contains parseInt If parsedouble regex Pattern Matcher catch try II endswith startsWith StringBuffer StringBuflder II format Integer Double Long valueof I/ Float Byte Math substring concat replace /f replaceAtl matches isDigit If public static List (): ) // Hint: II hence the result of tokenize (exprn) can be coded as follows: II 11. System.out.println(exprn): /1 out = new Arraylist >()

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

Master The Art Of Data Storytelling With Visualizations

Authors: Alexander N Donovan

1st Edition

B0CNMD9QRD, 979-8867864248

More Books

Students also viewed these Databases questions

Question

Technology. Refer to Case

Answered: 1 week ago