Change the recursive descent parser

Assignment Help Software Engineering
Reference no: EM132495882

Implementing parser

Requirements:
1) Pass all of the test cases (test cases file attached)
2) speed should be under 2 seconds.

This assignment is about implementing LL(1) parser using Java for TINY Programming Language (definition attached). I have already done a Recursive Descent parser for TINY, but it is very slow. In this assignment I am supposed to change the Recursive Descent parser to LL(1) parser. I have the TINY language specifications and all the java files related to the Recursive Descent parser for TINY, which I can share. I also have the slides explaining LL(1) parsing.

Instruction

This question is a continuation of Assignment 5. The requirement is the same except that your code should run faster.

You will use the same scanner and symbol file, i.e., A5Scanner.java and A5Sym.java. The parser will be called E2.java.
You need to refactor your A5.java into E2.java.
The main method is the same as in A5.java:
public static void main(String[) args) throws Exception {
BufferedWriter bw=new BufferedWriter(new FileWriter("a5.outputu));
A5Scanner scanner = new A5Scanner(new FileInputStream(new
File("A5.tiny")));
Symbol token;
while ((token=scanner.yylex()).sym!= ASSym.EOF) {
tokens.add(token);
}
tokens.add(token); // add EOF as the last token in the array
boolean legal= program() /a nextToken().sym==A5Sym.E0F;
bw.write((legal)?"legal":"illegal");
bw.close();
}
The commands to test your program are:
javac E2.java A5Scanner.java A5Sym.java Symbol.java
Java E2

Attachment:- Implementing parser.zip

Reference no: EM132495882

Questions Cloud

Explain about vargas family case study : Explain about vargas family case study,identified and develop scaffolding questions to ask the client in your next session, one in their landscape of action
Explaining key hr law considerations should take place : Summarize the situation, explaining key HR law considerations should take place and the impact on the organization by explaining objective details.
What are the benefits of diversity and diversity programs : In this Assignment, you will respond to a set of questions on the historical significance of antidiscrimination laws, HR's role in handling discrimination.
Prepare a experience essay : Prepare a experience essay. Interview a community member or family member who has first-hand experience or knowledge of the socio-cultural issue
Change the recursive descent parser : Change the Recursive Descent parser to LL(1) parser. I have the TINY language specifications and all the java files related to the Recursive Descent parser
Do ever close your eyes and reimagine television shows : What would happen if Harry Potter were a girl and also one of colour! Pick a show or film and consider changing the race, class, gender, age, or health
How does the discussion relate to hrm : How does this discussion relate to HRM? Do you agree or disagree with the views provided in this article? Identify your specific areas of agreement.
Describe any two of the cases of disease discussed in gpcc : In the above contexts, what is the argument for health care as a human right and public good, rather than a personal, commodified choice?
Discussion on social capital : How it is interpreted, how can we take the information we know and think critically about it in terms of organizations and then apply it.

Reviews

len2495882

4/19/2020 10:16:44 PM

I just want help with making my code ONLY E2.java shorter in length. It is 305 lines now. The shorter you can get it the better. The other files are only attached to help you compile and test the file. After you change E2 you just have to run by (javac *.java and then java E2) I do not have much time so please be very honest with me. I want this today before 11pm New York Time.

Write a Review

Software Engineering Questions & Answers

  Saving privacy on the web

Explain two tools that people can use to save their privacy on the web. Give one useful application of location tracking.

  Recognize at least two methods used to generate test cases

q1. identify at least two methods used to generate test cases in software development and explain how they are used to

  Analyze the need for waterfall and agile methodologies

Explain agile methodologies and identify their relationship to the PMBOK® process groups. Analyze the need for waterfall and agile methodologies.

  Create pdm-cpm diagram for play

Given following information about staging community play on Independence day. Create the PDM / CPM diagram. Find out earliest completion time for play and the critical path.

  Choose a phase in the systems development life cycle and

choose a phase in the systems development life cycle and describe the tasks that make up the phase. what are some

  Discuss waterfall model technique

discuss waterfall model technique of software design

  Describe and evaluate a companys pricing and retail

describe and evaluate a companys pricing and retail strategy. include analysis of the current market situation and the

  Why new software applications need to pass an ip audit

Discuss why new products and software applications need to pass an IP audit before they are launched.

  What is your opinion about software piracy

Why do many people feel that software piracy is not a serious crime? What is your opinion about software piracy? What can be done to stop this type of crime?

  Compare server availability monitoring tools

Discuss and evaluate in detail the server availability monitoring architecture - Propose a solution to avoid data vulnerability in server availability monitorin

  Building an assembly language interpreter

This project is about building an Assembly Language Interpreter - which stores program code and program data, an accumulator register, an additional register

  Show the representation for the smallest positive number

A 15-bit floating point number has 1 bit for the sign of the number, 5 bits for the exponent and 9 bits for the mantissa (which is normalized). Numbers in the exponent are in signed magnitude representation.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd