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

  Research report on software design

Write a Research Report on software design and answer diffrent type of questions related to design. Report contain diffrent basic questions related to software design.

  A case study in c to java conversion and extensibility

A Case Study in C to Java Conversion and Extensibility

  Create a structural model

Structural modeling is a different view of the same system that you analyzed from a functional perspective. This model shows how data is organized within the system.

  Write an report on a significant software security

Write an report on a significant software security

  Development of a small software system

Analysis, design and development of a small software system.

  Systems analysis and design requirements

Systems Analysis and Design requirements

  Create a complete limited entry decision table

Create a complete limited entry decision table

  Explain flow boundaries map

Explain flow boundaries map the dfd into a software architecture using transform mapping.

  Frame diagrams

Prepare a frame diagram for the software systems.

  Identified systems and elements of the sap system

Identify computing devices, which could be used to support Your Improved Process

  Design a wireframe prototype

Design a wireframe prototype to meet the needs of the personas and requirements.

  Explain the characteristics of visual studio 2005

Explain the characteristics of Visual Studio 2005.

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