COMP XXXXXXXXXX/2) Introduction to Compilers Faculty Header ID: N/A Contribution: 100% of course Course Leader: Christine du Toit Logbook Deadline Date: Wednesday 06/04/2022 This coursework will be...

2 answer below »
Find and investigate an example of a practical problem solved using any of the theoretical concepts discussed in this course (such as state machines, formal grammars, syntax trees or compilers). Your investigation should highlight the nature of the problem and explain the solution. The discussion should be around 500 words.


COMP1820 (2021/2) Introduction to Compilers Faculty Header ID: N/A Contribution: 100% of course Course Leader: Christine du Toit Logbook Deadline Date: Wednesday 06/04/2022 This coursework will be marked anonymously YOU MUST NOT PUT ANY INDICATION OF YOUR IDENTITY IN YOUR SUBMISSION This coursework should take an average student who is up-to-date with tutorial work approximately 50 hours Feedback and grades are normally made available within 15 working days of the coursework deadline Learning Outcomes: 1. Understand concepts of formal grammars, state machines and language parsing. 2. Interpret computer language specifications to determine language constructs. 3. Use specified techniques and approaches in creating compiler components. 4. Understand concepts related to computer architecture and instruction sets. Plagiarism is presenting somebody else's work as your own. It includes copying information directly from the Web or books without referencing the material; submitting joint coursework as an individual effort; copying another student's coursework; stealing coursework from another student and submitting it as your own work. Suspected plagiarism will be investigated and if found to have occurred will be dealt with according to the procedures set down by the University. Please see your student handbook for further details of what is / isn't plagiarism. All material copied or amended from any source (e.g. internet, books) must be referenced correctly according to the reference style you are using. Your work will be submitted for plagiarism checking. Any attempt to bypass our plagiarism detection systems will be treated as a severe Assessment Offence. Coursework Submission Requirements • All parts of this coursework must be completed, and the relevant parts fully uploaded on the deadline date of Wednesday 06/04/2022 using the links on the coursework Moodle page for COMP1820. • For this coursework you must: o Submit a PDF document containing your investigative task. In general, any text in the document must not be an image (i.e. must not be scanned) and would normally be generated from other documents (e.g. MS Office using "Save As... PDF"). An exception to this is handwritten mathematical notation, but when scanning, please ensure the file size is not excessive. o Complete 4 Moodle quizzes. o Submit two code files containing your code exercise (these must be named and should compile as specified). • There are limits on the file size (see the relevant course Moodle page). • Make sure that any files you upload are virus-free and not protected by a password or corrupted otherwise they will be treated as null submissions. • Your work will not be printed in colour. Please ensure that any pages with colour are acceptable when printed in Black and White. • You must NOT submit a paper copy of this coursework. • All courseworks must be submitted as above. Under no circumstances can they be accepted by academic staff. The University website has details of the current Coursework Regulations, including details of penalties for late submission, procedures for Extenuating Circumstances, and penalties for Assessment Offences. See the student portal for more information. • Detailed Specification The logbook is an individual assessment which requires you to build a portfolio of evidence, demonstrating that you understood and successfully applied the theory, tools and techniques introduced during the contact sessions. The assessment consists of three sections for which the deliverables are highlighted below. • Deliverables All sections must be uploaded as specified. For this coursework you must: o Submit a PDF document containing your investigative task (Section A). o Complete 4 Moodle quizzes (Section B). o Submit two code files containing your code exercise (Section C). Section A: Investigation [20% of final grade] This code exercise should be submitted on Moodle by the logbook deadline. It is to be submitted under the “Research Exercise” link in the “Assessment” block. Find and investigate an example of a practical problem solved using any of the theoretical concepts discussed in this course (such as state machines, formal grammars, syntax trees or compilers). Your investigation should highlight the nature of the problem and explain the solution. The discussion should be around 500 words. You will be assessed on: 1.) Novelty [5%] You should aim to find an example that was not discussed in class, and that clearly demonstrates how the theory was applied. 2.) Academic presentation and referencing [5%] You should use academic language and properly reference your work. 3.) Content [10%] The discussion should be clear and concise. You need to provide a general discussion, but should also use figures and examples to explain concepts. Section B: Quizzes [50% of final grade] Complete 4 summative quizzes on Moodle, which will be available in the “Assessment” block. The first three will test your understanding of the work covered during the lectures and tutorials and will be available on the Moodle page in the following weeks: Quiz 1: Material covered in weeks 1 and 2 [15%] Available in Week 3 Quiz 2: Material covered in weeks 4 and 5 [15%] Available in Week 6 Quiz 3: Material covered in weeks 7 to 10 [15%] Available in Week 11 The last quiz is designed to test your understanding of the work you had done in producing the code for the code exercise in Section C of this coursework. Quiz 4: Material covered in weeks 3 and 6 [5%] Available in Week 7 When you finish each quiz, you will receive a result in percentage. All quizzes can be completed up to the logbook submission date shown at the top of this specification. Section C: Practical [30% of final grade] This code exercise should be submitted on Moodle by the logbook deadline. It is to be submitted under the “Code submission” link in the “Assessment” block. Note: It is important that your submission adheres to the specification, as it is automatically marked. Task: Create Flex and Bison files to generate a post-fix notation calculator for Boolean algebra. The calculator should be able to handle Boolean expressions with the input values TRUE and FALSE, together with the operators AND (&), OR (|), NOT (!) and XOR (XOR), where XOR is “exclusive OR”. The program should accept keyboard input and exit on the end-of-file character (CTRL+d). Technical Specification: • Calculations happen whenever a newline character is read (i.e. when enter is pressed) • The input accepted should: o cover both capital and lower-case letters for TRUE and FALSE, o accept only the symbols &, |, ! and XOR to denote AND, OR, NOT and XOR respectively. However, XOR could be written as any of the 8 combinations of lowercase and uppercase letters. The following are examples of valid input values: TrUe fALSE True false truE fAlSe TRUE FALSE true The following are all valid operators: & | ! xor xoR xOr xOR Xor XoR XOr XOR • The compiler should display a generic error message if it is unable to parse the input. • Output should simply be the answer to the expression: TRUE or FALSE (Note: The answers should only be one of these exact strings, in capital letters) Here are some examples: We wish to calculate TRUE AND FALSE INPUT: TRUE FALSE & OUTPUT: FALSE We wish to calculate TRUE OR FALSE INPUT: true false xor OUTPUT: TRUE We wish to calculate NOT TRUE INPUT: TRUE! OUTPUT: FALSE We wish to calculate NOT(TRUE AND FALSE) OR FALSE INPUT: tRuE FaLsE & ! fAlSe | OUTPUT: TRUE Upload Specification: • You need to upload two files with the following names: boolcalc.l boolcalc.y • Files should be uploaded as they are -- not zipped, tar-ed or placed in a directory. • Make sure the files you are uploading compile and run correctly and provide the correct output. Notes about C you might find useful: • There are no Boolean primitives in C, but you can use integers to represent these. • Expressions evaluating to 0 is FALSE and non-zero is TRUE. • The basic Boolean operators in C are denoted as: AND: && OR: || NOT: ! It is left as an exercise to find out how XOR can be achieved. An if-statement has the format if (test expression) { statements to be executed if expression is true } else { statements to be executed if expression is false } More information on C syntax at https://www.cprogramming.com/tutorial/c/lesson2.html _____________________________________________________________________________ • Assessment Criteria - Section A: Research Exercise (20%) - Section B: Moodle Quizzes (50%) - Quiz 1: Covers Week 1 and 2 (15%) - Quiz 2: Covers Week 4 and 5 (15%) - Quiz 3: Covers Week 7 to 10 (15%) - Quiz 4: Covers Week 3 and 6 (5%) - Section C: Practical Task (30%) - Code submission: Covers Week 3 and 6 https://www.cprogramming.com/tutorial/c/lesson2.html • Grading Criteria 80+ An exceptional piece of work must demonstrate a strong level of engagement with the topics and the ability to apply techniques/concepts studied in class to an exemplary standard. Overall, the logbook must demonstrate an outstanding level of knowledge of the underlying concepts and principles encountered during the term. You must complete all exercises. Thoroughly referenced material used to substantiate your arguments. 70-79 An excellent attempt demonstrating a clear understanding of the requirements of the assignments. You must complete all exercises to a very high standard. An impressive demonstration of knowledge of the underlying concepts and principles encountered during the term. Referenced material should be used to substantiate the arguments. 60-69 A very good attempt demonstrating a strong understanding of the requirements of the assignments. Each exercise must demonstrate good engagement with the topic and a good attempt at applying techniques/concepts studied in class to
Answered 10 days AfterMar 31, 2022

Answer To: COMP XXXXXXXXXX/2) Introduction to Compilers Faculty Header ID: N/A Contribution: 100% of course...

Ashish answered on Apr 11 2022
88 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here