Question: Pleas work with me step by step to cread code using java language-Drjava8. For this project I will continue to work with files.I want the

Pleas work with me step by step to cread code using java language-Drjava8.

For this project I will continue to work with files.I want the file format will be similar to a source code program.And I will tokenize the contents.Put tokenizing for recognizing the value of each component of a source program by classifying eachtoken.

I am required to Create methods to perform the identification of punctuation, integer constants, floating point constants, reserved words and identifiers. LikeisPunct,isIntegral,isDouble,isReserved,isIdentifier. In addition,from the five methods I noted above,I would create one more method calledclassifywhich is responsible for taking theStringtoken and printing its classification and value. Using a new standard class calledPattern, So I will be able to identify certain patterns in strings.

Thanks for help.

Punctuation "\\p{Punct}" Integral "\\d+" Floating "\\d+\\.\\d+" Identifier "[a-zA-Z]+[0-9a-z_]*" 

int double long if else void while for return 

I will be Using the following test file as my source:

int x ; int y = 35 ; for ( x = 0 ; x < 10 ; x ++ ) { y = y * 3.14 ; } 

As my instructor said, my program would have outcome as these below:

RESERVED int IDENT x PUNCT ; RESERVED int IDENT y PUNCT = INTCONST 35 PUNCT ; RESERVED for PUNCT ( IDENT x PUNCT = INTCONST 0 PUNCT ; IDENT x PUNCT < INTCONST 10 PUNCT ; IDENT x UNKNOWN ++ PUNCT ) PUNCT { IDENT x PUNCT = INTCONST 35 PUNCT * DBLCONST 3.14 PUNCT ; PUNCT } 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Lets work through the creation of this Java program stepbystep Well write methods to classify tokens as described utilizing Javas Pattern and Matcher for pattern recognition Heres how we can approach ... View full answer

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 Programming Questions!