parsing grammer

epubj
timer Asked: Mar 20th, 2016

Question Description

Parsing grammer

Unformatted Attachment Preview

Take-Home Midterm Exam The grammar for is // START: parser line: open context end ; open: ''; // END: parser // START: lexer NAME : LETTER+ ; // name is sequence of >=1 letter NUMBER : DIGIT+; LETTER : 'a'..'z'|'A'..'Z'; // define what a letter is DIGIT : '0'..'9'; WS : (' '|'\t'|'\n'|'\r')+ {skip();} ; // throw out whitespace // END: lexer 1. Top rule for the following simple language is simple_language: line project_body Please write the complete grammar in a table. Line Rule name number 1 2 3 Definition //start for parser simple_language: line project_body ; line: open context end ; … … 2. Create a parser for your grammar designed in 1. Your parser needs to print error message if the input is not compliant to your grammar. 3. Write a report in Word file containing a. Table for the grammar you design in 1. b. USE YOUR OWN WORDS to describe how you design the code for parser. Take-Home Midterm Exam c. Screen shot of the compiling result and execution result. Submit your report to the “report submission” link in blackboard. 4. Compress the files for your parser in a zip file and submit to the “source code submission” link in blackboard. Grading rubric Item\ Accomplishment Grammar format (10 points) Correctness of grammar (30 points) Similarity score of Report (30 points) Coding for parser (30%) 0% 50% 100% No table Partial table With table No correct design Partial design is correct. Correct grammar Similarity Score > 80% 51% < Similarity Score < 79% Can’t be Can be compiled, compiled but can’t parse successfully input correctly Similarity Score < 50% Can be compiled and parse input correctly
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

This question has not been answered.

Create a free account to get help with this and any other question!

Related Tags

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors