” tokensier程序 辅导、 写作C++程序语言、 辅导C++课程Assignment 1 Description: Computer Systems (2000_7081 Combined)Weighting and Due DateMarks for this assignment contribute 5% of the overall course mark.Marks for functionality will be awarded automatically by the web submission system.Due dates: Milestone – 11:55pm Tuesday of week 7, Final – 11:55pm Friday of week 7.Late penalties: For each part, the maximum mark awarded will be reduced by 25% per day /part day late. If your mark is greater than the maximum, it will be reduced to the maximum.Core Body of Knowledge (CBOK) Areas: abstraction, design, hardware and software, dataand information, and programming.Project DescriptionIn this assignment you will implement a tokeniser that with minor changes could be used tocomplete variations of projects 6, 7, 8, 10 and 11 in the nand2tetris course. A detailed descriptionof the requirements are shown below. The exectuable programs, tokens and tokens-context willread text from standard input and produce a list of tokens in the text on standard output.Note: you should complete workshop 05 before attempting this assignment.SVN RepositoryNote: this assignment assumes that you have already created directories for every assignment,workshop, project and exam in your svn repository, as described on the Startup Files forWorkshops and Assignments ( httpss://myuni.adelaide.edu.au/courses/54311/pages/startup-filesfor-workshops-and-assignments)page.1. If required, checkout a working copy of the assignment1 directory from your svn repository.2. Change directory to the working copy of the assignment1 directory.3. Copy the newest zip file attached below into the updates sub-directory and add it to svn.4. Run the following command to place the assignments startup files in the correct locations:% make installComputer Systems作业 辅导、 写作C++程序语5. Add the tokensier.cpp file and an empty tests directory to your svn repository:% svn add tokeniser.cpp tokeniser-basics.cpp% svn add –depth=empty tests% svn commit -m Assignment 1 Startup FilesAssignment 1 Files and DirectoriesIn addition to the generic Makefile and updates sub-directory, the assignment1 directory shouldnow contain the following files and directories:2020/9/2 Assignment 1 Description: Computer Systems (2000_7081 Combined) httpss://myuni.adelaide.edu.au/courses/54311/pages/assignment-1-description 2/6tokens – executable script that will run your compiled tokens program.tokens.cpp C++ source file containing the main() function for tokens.tokens-context – executable script that will run your compiled tokens-context program.tokens-context.cpp C++ source file containing the main() function for tokens-context.tokeniser.cpp C++ source file containing the next_token() function.tokeniser-basics.cpp C++ source file containing input functions.bin – this directory contains precompiled programs and scripts.includes – this directory contains .h files for the library.lib – this directory contains precompiled library components.originals – this directory contains the original version of the tokeniser.cpp.tests – this directory contains test data, you can add your own tests here.Note: you need to edit the tokeniser.cpp and tokeniser-basics.cpp files to complete thisassignment. All the other files are automatically regenerated every time you run make, they mustnot be changed or added to svn. You can add extra test inputs to the tests directory but those arethe only additional files that you may add to svn.Note: if a newer version of the startup files is made available, it must be placed in the updatessub-directory and added to svn. The next time make is run, all of the files will be updated exceptfor tokeniser.cpp.Submission and Marking SchemeSubmissions for this assignment must be made to the web submission system( httpss://cs.adelaide.edu.au/services/websubmission) assignment named: Assignment 1 – SubmitHere. The assessment is based on Assessment of Programming Assignments( httpss://myuni.adelaide.edu.au/courses/54311/pages/assessment-of-programming-assignments) .Note: the Submit Here assignment will show a breakdown of your marks by category but it willalways show your total mark as capped at 0.Your tokeniser program must be written in C++. Your tokens and tokens-context programswill be compiled using the Makefile and the tokens.cpp or tokens-context.cpp files included inthe zip file attached below together with the tokeniser.cpp and tokeniser-basics.cpp files in yoursvn directory. Your programs will then be tested using the set of test files that are attached below.In addition a number of secret tests will also be run. Note: if your program fails any of thesesecret tests you will not receive any feedback about these secret tests, even if you ask!Assignment 1 – Milestone Submissions: due 11:55pm Tuesday ofweek 7The marks awarded by the web submission system( httpss://cs.adelaide.edu.au/services/websubmission) for the milestone submission contribute up to20% of your marks for assignment 1. The marks for the Milestone Tests are used as the marks forthe milestone submission. The Milestone Tests test the milestone token definitions shown below2020/9/2 Assignment 1 Description: Computer Systems (2000_7081 Combined) httpss://myuni.adelaide.edu.au/courses/54311/pages/assignment-1-description 3/6using your tokens program. Your milestone submission mark, after the application of latepenalties, will be posted to the myuni gradebook when the assignment marking is complete.You can view the Milestone Tests marks in the Milestone assignment but submissions must bemade using the Assignment 1 – Submit Here assignment.Assignment 1 – Final Submissions: due 11:55pm Friday of week 7The marks awarded for the final submission contribute up to 80% of your marks for assignment 1.Your final submission mark will be the geometric mean of three components, the marks for theFinal Tests, a mark for your logbook and a mark for your code. It will be limited to 20% more thanthe marks for the Final Tests. See Assessment – Mark Calculations( httpss://myuni.adelaide.edu.au/courses/54311/pages/assessment-mark-calculations) for examplesof how the marks are combined. The Final Tests are all tests run, including those used for theMilestone Tests. Your final submission mark, after the application of late penalties, will be postedto the myuni gradebook when the assignment marking is complete.NOTE – A logbook mark of 0 results in a Final Submission mark of 0.You can view the Final Tests marks in the Final assignment but submissions must be made usingthe Assignment 1 – Submit Here assignment.Logbook MarkingImportant: the logbook must have entries for all work in this assignment, including your milestonesubmissions. See Assessment – Logbook Review( httpss://myuni.adelaide.edu.au/courses/54311/pages/assessment-logbook-review) for details of howyour logbook will be assessed.Code Review MarkingFor each of your programming assignments you are expected to submit well written code. SeeAssessment – Code Review ( httpss://myuni.adelaide.edu.au/courses/54311/pages/assessmentcode-review) for details of how your code will be assessed.Assignment 1 – Participation MarksAny submissions to assignment 1 that are made before the due date for Milestone Submissionsmay be awarded up to 10 participation marks. The participation marks will be the marks awardedfor the Final Tests divided by 10. You can view the participation marks awarded in the PreMilestone assignment but submissions must be made using the Assignment 1 – Submit Hereassignment. The participation marks will be allocated to week 6.TokenisersBackground2020/9/2 Assignment 1 Description: Computer Systems (2000_7081 Combined) httpss://myuni.adelaide.edu.au/courses/54311/pages/assignment-1-description 4/6The primary task of any language translator is to work out how the structure and meaning of aninput in a given language so that an appropriate translation can be output in another language. Ifyou think of this in terms of a natural language such as English. When you attempt to read asentence you do not spend your time worrying about what characters there are, how much spaceis between the letters or where lines are broken. What you do is consider the words and attemptto derive structure and meaning from their order and arrangement into English languagesentences, paragraphs, sections, chapters etc. In the same way, when we attempt to writetranslators from assembly language, virtual machine language or a programming language intoanother form, we attempt to focus on things like keywords, identifiers, operators and logicalstructures rather than individual characters.The role of a tokeniser is to take the input text and break it up into tokens (words in naturallanguage) so that the assembler or compiler using it only needs to concern itself with higher levelstructure and meaning. This division of labor is reflected in most programming languagedefinitions in that they usually have a separate syntax definition for tokens and another forstructures formed from the tokens.The focus of this assignment is writing a tokeniser to recognise tokens that conform to a specificset of rules. The set of tokens may or may not correspond to a particular language because atokeniser is a fairly generic tool. After completing this assignment we will assume that you knowhow to write a tokeniser and we will provide you a working tokeniser to use in each of theremaining programming assignments. This will permit you to take the later assignments muchfurther than would be otherwise possible in the limited time available.Writing Your ProgramYou are required to complete the implementation of the C++ files tokeniser.cpp and tokeniserbasics.cppwhich are used to compile the programs tokens and tokens-context. You willcomplete the implementation of a function, next_token(), that will read text character by characterusing the function nextch(), and return the next recognised token in the input. The tokens thatmust be recognised in the milestone and final submissions are specified in thefile includes/tokeniser.h. Additional helper functions described in the EBNF, Languages andParsing ( httpss://myuni.adelaide.edu.au/courses/54311/pages/ebnf-languages-and-parsing) page arealso provided as part of the precompiled library, their interfaces are shown in theincludes/tokeniser-extras.h file.The tokeniser-basics.cpp file is where you will implement the nextch(), token_context(),new_token() and initialise_tokeniser() functions. These are separated out so that it is possibleto test your next_token() function without needing to complete all of the messy parts of theseother functions.Your tokens and tokens-context programs will be compiled using the Makefile in the zip fileattached below using the command:% make2020/9/2 Assignment 1 Description: Computer Systems (2000_7081 Combined) httpss://myuni.adelaide.edu.au/courses/54311/pages/assignment-1-description 5/6Note: The only files you are allowed to edit are tokeniser.cpp and tokeniser-basics.cpp. Allother files are automatically regenerated every time you run make and are not used by the websubmission system ( httpss://cs.adelaide.edu.au/services/websubmission) s test scripts.Testing Your ProgramFor each file in the tests directory, the output of the tokens and tokens-context programs mustmatch the corresponding .tokens and .context output files respectively. You must not produceany output of your own. You can both compile and test your programs against all of the suppliedtests using the command:% makeThe testing will not show you any program output, just whether or not a test was passed or failed.If you want to see the actual output, the commands used to run the tests are shown in stringquotes (). Simply copy the commands between the string quotes () and paste them into yourshell.The web submission system will test your program in exactly this way. The key difference betweenyour testing and the web submission testing is that the web submission system has some secrettests that it will use.If you want to try additional tests, just create some new files in the tests sub-directory andgenerate the correct outputs using the command:% make test-addThis will increase the number of tests that will be run in the future. You may add these new testinputs and outputs to svn.Milestone TokensYour milestone submission will only be awarded marks For tests that require the correct recognitionof the milestone tokens described in the includes/tokeniser.h file.Note: the includes/tokeniser.h file describesthe grammar rules for all tokens,the tokeniser interface functions that must be implemented,the rules for preprocessing special characters (not required for the milestone),the rules for differentiating identifiers and keywords (not required for the milestone),the rules for generating the context string for a token (not required for the milestone),the rules for modifying the spelling of a token (not required for the milestone) andthe rules governing error handling.Notes: all input must be read using the function next_ch() which must use the externalfunction read_char().2020/9/2 Assignment 1 Description: Computer Systems (2000_7081 Combined) httpss://myuni.adelaide.edu.au/Courses/54311/pages/assignment-1-description 6/6Final Submission TokensYour final submission will be awarded marks for tests that require the correct recognition of alltokens and the correct implementation of the tokeniser interface functions described inthe includes/tokeniser.h file.TestsIn addition to the test files in the zip file(s) attached below, we will use a number of secret teststhat may contain illegal Characters or character combinations that may defeat your tokenisers. Thesecret tests may also check whether or not you have followed the rules for keyword recognition.Note: these tests are secret, if your programs fail any of these secret tests you will not receiveany feedback about these secret tests, even if you ask!Startup FilesThe newest of the following zip file(s) must be placed in the updates sub-directory and added tosvn. When make is run, the newest zip file in the updates directory is used to update the startupfiles. Any files you are Required to edit will not be updated but, a copy of the latest version of thosefiles will be placed in the sub-directory originals.如有需要,请加QQ:99515681 或邮箱:99515681@qq.com
“
添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导。