讲解:web、program、c/c++、c++R|Haskell

Assignment 1 DescriptionWeighting and Due Date• Marks for this assignment contribute 5% of the overall course mark.• Marks for functionality will be awarded automatically by the web submissionsystem.• Due dates: Milestone - 11:55pm Tuesday of week 7, Final - 11:55pm Friday ofweek 7.• Late penalties: For each part, the maximum mark awarded will be reduced by25% per day / part day late. If your mark is greater than the maximum, it will bereduced to the maximum.• Core Body of Knowledge (CBOK) Areas: abstraction, design, hardware andsoftware, data and information, and programming.Project DescriptionIn this assignment you will implement a tokeniser that with minor changes could beused to complete variations of projects 6, 7, 8, 10 and 11 in the nand2tetris course. Adetailed description of the requirements are shown below. The exectuableprograms, tokens and tokens-context will read text from standard input andproduce a list of tokens in the text on standard output.Note: you should complete workshop 05 before attempting this assignment.SVN RepositoryYou must create a directory in your svn repositorynamed: //cs/assignment1. This directory must only contain thefollowing files and directories - the web submission systemLinks to an externalsite. will check this:• Makefile - this file is used by make to compile your tokeniser program - do notmodify this file.• Makefile-extras - this file is used by make to compile your tokeniser program- do not modify this file.• tokens - executable script that will run your compiled tokens program - do notmodify this file.• tokens.cpp C++ source file containing the main() function for tokens - do notmodify this file.• tokens-context - executable script that will run your compiled tokenscontextprogram - do not modify this file.• tokens-context.cpp C++ source file containing the main() function for tokenscontext- do not modify this file.• tokeniser.cpp C++ source files containing the next_token() function.• bin - this directory contains precompiled programs and scripts - do not modifythis directory.• lib - this directory contains precompiled components - do not modify thisdirectory.• includes - this directory contains .h files for the library - do not modifythis directory.• tests - this directory contains sample test data, it can be used to store any extrafiles you need for testingNote: you must use the following command to add your startup files to your svnrepository:% svn add Makefile Makefile-extras bin includes lib tests tokens tokens.cpp tokens-context tokens-context.cpp tokeniser.cpp lib/*/lib.aSubmission and Marking SchemeSubmissions for this assignment must be made to the web submission systemLinksto an external site. assignment named: Assignment 1 - Submit Here. The assessmentis based on Assessment of Programming Assignments.Note: the Submit Here assignment will show a breakdown of your marks by categorybut it will always show your total mark as 0.Your tokeniser program must be written in C++. Your tokens and tokenscontextprograms will be compiled using the Makefile andthe tokens.cpp or tokens-context.cpp files included in the zip file attached belowtogether with the tokeniser.cpp file in your svn directory. Your programs will then betested using the set of test files that are attached below. In addition a numberof secret tests will also be run. Note: if your program fails any of these secret testsyou will not receive any feedback about these secret tests, even if you ask!Assignment 1 - Milestone Submissions: due 11:55pmTuesday of week 7The marks awarded by the web submission systemLinks to an external site. for themilestone submission contribute up to 20% of your marks for assignment 1. Themarks for the Milestone Tests are used as the marks for the milestone submission.The Milestone Tests test the milestone token definitions shown below using your tokens program. Your milestone submission mark, after the application of latepenalties, will be posted to the myuni gradebook when the assignment marking iscomplete.You can view the Milestone Tests marks in the Milestone assignment butsubmissions must be made using the Assignment 1 - Submit Here assignment.Assignment 1 - Final Submissions: due 11:55pm Friday ofweek 7The marks awarded for the final submission contribute up to 80% of your marks forassignment 1.Your final submission mark will be the geometric mean of three components, themarks for the Final Tests, a mark for your logbook and a mark for your code. It will belimited to 20% more than the marks for the Final Tests. See Assessment - MarkCalculations for examples of how the marks are combined. The Final Tests are alltests run, including those used for the Milestone Tests. Your final submission mark,after the application of late penalties, will be posted to the myuni gradebook whenthe assignment marking is complete.You can view the Final Tests marks in the Final assignment but submissions must bemade using the Assignment 1 - Submit Here assignment.Logbook MarkingImportant: the logbook must have entries for all work in this assignment, includingyour milestone submissions. See Assessment - Logbook Review for details of howyour logbook will be assessed.Code Review MarkingFor each of your programming assignments you are expected to submit wellwritten code. See Assessment - Code Review for details of how your code will beassessed.Assignment 1 - Participation MarksAny submissions to assignment 1 that are made more than one week before the duedate for Final Submissions may be awarded up to 10 participation mar代写web留学生作业、program课程作业代做、c/c++编程设计作业调试、代写c++作业 代写R语言编程|帮做Hasks. Theparticipation marks will be the marks awarded for the Final Tests divided by 10. Youcan view the participation marks awarded in the One Week Early assignment butsubmissions must be made using the Assignment 1 - Submit Here assignment. Theparticipation marks will be allocated to week 6.TokenisersBackgroundThe primary task of any language translator is to work out how the structure andmeaning of an input in a given language so that an appropriate translation can beoutput in another language. If you think of this in terms of a natural language such asEnglish. When you attempt to read a sentence you do not spend your time worryingabout what characters there are, how much space is between the letters or wherelines are broken. What you do is consider the words and attempt to derive structureand meaning from their order and arrangement into English language sentences,paragraphs, sections, chapters etc. In the same way, when we attempt to writetranslators from assembly language, virtual machine language or a programminglanguage into another form, we attempt to focus on things like keywords, identifiers,operators and logical structures rather than individual characters.The role of a tokeniser is to take the input text and break it up into tokens (words innatural language) so that the assembler or compiler using it only needs to concernitself with higher level structure and meaning. This division of labor is reflected inmost programming language definitions in that they usually have a separate syntaxdefinition for tokens and another for structures formed from the tokens.The focus of this assignment is writing a tokeniser to recognise tokens that conformto a specific set of rules. The set of tokens may or may not correspond to a particularlanguage because a tokeniser is a fairly generic tool. After completing thisassignment we will assume that you know how to write a tokeniser and we willprovide you a working tokeniser to use in each of the remaining programmingassignments. This will permit you to take the later assignments much further thanwould be otherwise possible in the limited time available.Writing Your ProgramYou are required to complete the implementation of the C++file tokeniser.cpp which is used to compile the programs tokens and tokens-context.You will complete the implementation of a function, next_token(), that will read textcharacter by character using the static function nextch(), and return the nextrecognised token in the input. The tokens that must be recognised in the milestoneand final submissions are specified below and in the file includes/tokeniser.h.Your tokens and tokens-context programs will be compiled using the Makefile in thezip file attached below using the command:% makeNote: Do not modify the Makefile, tokens.cpp, tokens-context.cpp or the subdirectoriesbin, includes and lib. They will be replaced during testing by the websubmission system.Testing Your ProgramFor each file in the tests directory, the output of the tokens and tokenscontextprograms must match the corresponding .tokens and .context output filesrespectively. You must not produce any output of your own. You can both compileand test your programs against all of the supplied tests using the command:% makeThe testing will not show you any program output, just whether or not a test waspassed or failed. If you want to see the actual output, the commands used to run thetests are shown in string quotes (). Simply copy the commands between the stringquotes () and paste them into your shell.The web submission system will test your program in exactly this way. The keydifference between your testing and the web submission testing is that the websubmission system has some secret tests that it will use.If you want to try additional tests, just create some new files in the tests subdirectoryand generate the correct outputs using the command:% make test-addThis will increase the number of tests that will be run in the future.Milestone TokensYour milestone submission will only be awarded marks for tests that require thecorrect recognition of the milestone tokens described inthe includes/tokeniser.h file.Note: the includes/tokeniser.h file describes• the 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 themilestone),• the rules governing the context of some token spellings (not required for themilestone) and• the rules governing error handling.Notes: all input must be read using the function next_ch() which must use the externalfunction read_char().Final Submission TokensYour final submission will be awarded marks for tests that require the correctrecognition of all tokens and tokeniser interface functions described inthe includes/tokeniser.h file.TestsIn addition to the test files in the zip file attached below, we will use a numberof secret tests that may contain illegal characters or character combinations thatmay defeat your tokenisers. The secret tests may also check whether or not youhave followed the rules for keyword recognition. Note: these tests are secret, if yourprograms fail any of these secret tests you will not receive any feedback aboutthese secret tests, even if you ask!Startup FilesThe startup files in the attached zip file should work on most 64-bit Linux systemsand on a Mac. Please see the Startup Files for Workshops and Assignments page formore information.• assignment-tokeniser.zip转自:http://www.6daixie.com/contents/13/5056.html

你可能感兴趣的:(讲解:web、program、c/c++、c++R|Haskell)