Need help with your Discussion

Get a timely done, PLAGIARISM-FREE paper
from our highly-qualified writers!

glass
pen
clip
papers
heaphones

Rutgers University Lexical and Syntax Project Java Coding Task

Rutgers University Lexical and Syntax Project Java Coding Task

Rutgers University Lexical and Syntax Project Java Coding Task

Description

 If you want the pdf to the textbook in case you want even more information here it is.https://drive.google.com/file/d/1fLM3TqCVzOEizgyPL… 

Post

Write an EBNF rule that describes the for statement of Java or C++. Write the recursive-descent subprogram in Java or C++ for this rule.

&

Write an EBNF rule that describes the while statement of Java or C++. Write the recursive-descent subprogram in Java or C++ for this rule. 

void ifstmt(void) {if (nextToken != IF_CODE) error();else { lex();if (nextToken != LEFT_PAREN) error();else { lex();boolexpr();if (nextToken != RIGHT_PAREN)error(); else {lex();statement();if (nextToken == ELSE_CODE) {lex(); statement();}} } } }this is what the if statment looks like, (for refernce). 

basic general idea of this question is.

I don’t need a very complicated or long answer, you know what i mean? It doesnt even have to be completely correct but a general ballpark. 

Unformatted Attachment Preview

Lexical and Syntax Project
Pascal Programming Language (subset)
Design and implement a Lexical Analyzer for a subset of the Pascal Programming Language.
Your program should be able to accept as input a file containing statements in Pascal and
correctly perform a lexical analysis of each statement.
Samples of the output and sample C code for a lexical analyzer for tokens and lexemes can be
found in the textbook Chapter 4.2. The chapter is also screenshotted below.
1. You will need to create a list (some structure to store) of the reserved words for Pascal.
(See the link to the Pascal site).
https://www.tutorialspoint.com/pascal/pascal_basic_syntax.htm
2. You will need to create a list of various operators used in Pascal by category, for example
token ASSIGN_OP
lexeme :=
3. You will need to create a list of acceptable characters for variables and constants.
4. You will need to write code to test the validity of identifiers, If a string does not match
any of the categories, you should indicate that as UNKNOWN.
I will post the ámple code&ile you can use to test your Lexical Analyzer.
Sample Code
PROGRAM ChangeMaker;
(* Make change for a dollar *)
VAR
Cost: INTEGER;
Remainder: INTEGER;
Quarters: INTEGER;
Nickels: INTEGER;
Pennies: INTEGER;
Dimes: INTEGER;
BEGIN
(* Input the Cost *)
Write(‘Enter the cost in cents: ‘);
Read(Cost);
(* Make the Change *)
Remainder := 100 – Cost;
Quarters := Remainder DIV 25;
Remainder := Remainder MOD 25;
Dimes := Remainder DIV 10;
Remainder := Remainder MOD 10;
Nickels := Remainder DIV 5;
Remainder := Remainder MOD 5;
Pennies := Remainder;
(* Output the coin count *)
Writeln(‘The change is ‘);
WriteLn(Quarters: 2, ‘ quarters’);
WriteLn(Dimes: 2, ‘ dimes’);
WriteLn(Nickels: 2, ‘ nickels’);
WriteLn(Pennies: 2, ‘ pennies’);
END. (* ChangeMaker *)
Chapter 4.2: Concepts of Programming Languages

Purchase answer to see full
attachment

User generated content is uploaded by users for the purposes of learning and should be used following our honor code & terms of service.

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Order Solution Now

Our Service Charter


1. Professional & Expert Writers: Eminence Papers only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Eminence Papers are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Eminence Papers are known for the timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Eminence Papers, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.

We Can Write It for You! Enjoy 20% OFF on This Order. Use Code SAVE20

Stuck with your Assignment?

Enjoy 20% OFF Today
Use code SAVE20