Code a Basic Recursive Decent Parser And Must Use Recursion - IT/Computer Science Assignment Help

Download Solution Order New Solution
Assignment Task:

Task:

  • This assignment is worth 30 Marks towards your final assessment.
  • DUE: Midnight 7th of May (Friday midnight last week of term) (please watch announcements for possible extensions)
  • This assignment is 6 different tasks which build on each other:
  • (6 marks) The first task is to use a map (we convert a vector of strings to a map).
  • (6 marks) The second task is a parsing problem, you need to write a method that evaluates strings (e.g. the string 5+7) should return 12
  • (4 marks) The 3rd task is to modify task 2 to use data from the map to evaluate strings with variables stored in the map (e.g. if the map for b contains 6.5, the string 5+b) should return 11.5.
  • (4 marks) The fourth task is to combine tasks 1,2 and 3 add an = operator and print statement (and make a simple statement executor that runs through a vector of statements and executes them one after another)
  • (5 marks) The 5th task is really optional for those wanting DI /HD grades. It is to add to the second task so it can deal with * and / (divide and multiply). This answer should be done recursively and adhere to the rules of maths that * and / (divide and multiply) are done before + and -.
  • (5 marks) All students should do a Reflection report.

NOTE1: (no longer relevant)
NOTE2: You cannot get more than 30 for the assignment.
NOTE3: All options must deal with lines starting with “/” as comments and ignore them (but counted in error line count, see note4)
NOTE4 Blank lines should be ignored (but they should be counted in line counters for error line information, this is so when you are investigating error lines using an editor, it should show line numbers that match error lines identified by your program)
NOTE5 Task3 will need task 1 run before it to load the variables.
NOTE6 Tasks 1,4 and 5 need to clear the map before running
NOTE7 In my testing I will always use lower case variables in the range a to z.
The extra menu options m1 to m5 are to be coded by the student using routines dop1, doP2 etc for mandatory testing.

// std::cout << "M1 - Run file A2Part1m.txt ";
// std::cout << "M2 - Run file A2Part2m.txt ";
// std::cout << "M3 - Run file A2Part3m.txt ";
// std::cout << "M4 - Run file A2Part4m.txt ";
// std::cout << "M5 - Run file A2Part5m.txt ";
Authors notes:
This is a step by step assignment designed to be done in order with each step building on the last.
To try to make your life easier I give you a lot of the code so you basically just have to code the functions: doP1, doP2, doP3, doP4, doP5 and the associated supporting functions of which there are a few.
They all have the same signature (empty or minimal versions are provided in the supplied code):
void doP1(vector<string>& inVec, map<string, float>& outMap)
Note that the basic p1, p1e , p2, p3, p4 is fairly straightforward to get a pass/low credit with a good report and having the report showing mandatory runs.
The marking scheme uses error handing as the way to separate cr/p level assignment from di/cr ones so if you are having difficulty focus on p1, p2, p3 and if possible p1e and p4.
The two menu options
T - Temporary for testing (not part of assessment)
D - set unset debug4 (not part of assessment)

  • Are menu options I added for testing you can do with them what you like they are not assessed and just debug code I left in to help students. T is really handy tracking down bugs create a small file with just the problem lines in it (A2test.txt).
  • About the reflection Report
  • The reflection report should be a few paragraphs on
  • What you learned
  • What you found difficult
  • What you would do different

Try to keep it to 1 page in length (+n pages of mandatory testing, see below)

Task 5
The purpose of this is to get students to code a ‘basic’ recursive decent parser. And you must use recursion.
If you are doing this part, you probably understand what is needed so just the following screen shots should be enough to get you there!
Importantly * and / (multiply and divide) should be done first then (+ and -), and if operators have equal precedence from left to right.




 

 

The above  IT Assignment has been solved by our  IT Assignment  Experts at onlineassignmentbank. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our experts are well trained to follow all marking rubrics & referencing style.

Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.