1. Homepage
  2. Programming
  3. CSE 3341, Core Interpreter Project, Part 2 (Parser, Printer, Executor)

CSE 3341, Core Interpreter Project, Part 2 (Parser, Printer, Executor)

Engage in a Conversation
OSUCSE 3341Principles of Programming LanguagesCore InterpreterParserPrinterExecutorJavaPython

CSE 3341, Core Interpreter Project, Part 2 (Parser, Printer, Executor) Due: 11:59 pm, Friday, Nov. 10, ’23; 100 points CourseNana.COM

  1. This is the second part of the Core interpreter project. In this part, you have to implement the parser, printer, and executor. You should use the same language, Java or Python, that you used for writing your Tokenizer. CourseNana.COM

  2. If there are any special considerations for compiling and running your code, make sure you specify, in your README file, how your code is supposed to be compiled and run. CourseNana.COM

  3. Your interpreter should take two command-line arguments. The first will be the name of the file that contains the Core program to be interpreted. The second will be the name of the file that contains the data for the Core program. Note that this is a change from the Tokenizer project. In that project, your Tokenizer read the input Core program from the standard input stream. But now, since there are two input files, the names of these files will be given as command-line arguments. CourseNana.COM

  4. The Core program in the first file will not contain any illegal tokens but may contain other kinds of errors, i.e., not meeting the requirements of the BNF grammar of Core; undeclared variables; uninitialized variables; and another kind of error described in the next item. If the Core program violates the BNF grammar or if undeclared variables are used in the <stmt seq> portion of the Core program, your interpreter, before execution begins, should print an appropriate error message and stop. CourseNana.COM

  5. The data in the second file will consist of a sequence of integers (positive or negative), one per line. This data will be read when your interpreter executes the “read” statements in the Core program. If this file is empty when the interpreter tries to execute a “read” statement, your interpreter should terminate with a suitable error message. CourseNana.COM

  6. If during execution, the interpreter tries to access the current value of an identifier which has not yet been initialized, your interpreter should terminate with a suitable error message. CourseNana.COM

  7. The output from your interpreter should go to the standard output stream. CourseNana.COM

  8. If there are no errors related to the requirements of the BNF grammar and no undeclared variables appear in the <stmt seq>, the print-procedures of your interpreter should pretty-print the Core program and then execute the program. CourseNana.COM

  9. Pretty-printingrequirements:Therearenospecificrequirementsaboutwhatprecisely“pretty-printing” means. Follow your own instincts on what would make the structure of any given program easy to un- derstand and try to implement that. The goal is to make the structure of the code clear by just looking at the pretty-printed version. Python’s indenting style is a good model to follow. Our eyes/brain seem naturally wired to group together lines that are aligned (vertically) with each other. So, the Python model is a good one to follow; or come up with your own variation – as long as it makes the code clear by looking at it. (This site seems to do a reasonably good job of describing best pravctices in Python regarding formatting: Python best practices CourseNana.COM

    1 CourseNana.COM

CourseNana.COM

10. During execution, if your interpreter executes an <out> statement such as “write X, Y;”, and the values of X and Y at that point are 20 and 30, your interpreter should produce the following output: CourseNana.COM

X = 20 Y = 30 CourseNana.COM

11. Important: Your code must follow the principles of encapsulation (also known as “abstraction”) that we have talked about, rather than have the details of the representation of the abstract parse tree visible to all parts of your interpreter. In other words, do not use the PT[] explicitly in your parse, print and execute methods. Instead, use either the ParseTree class approach or the approach using a separate class corresponding to each non-terminal in the grammar. If you violate this guideline, your lab will be penalized heavily even if it is otherwise correct. CourseNana.COM

12. Zip all your files into one archive and submit to Carmen. (If Carmen doesn’t accept the Zip file, upload to your “My Files” site on Carmen and submit from there.) CourseNana.COM

What To Submit And When: On or before 11:59 pm on the due date, you should submit, on Carmen, the .zip file as specified above. DO NOT include object files in your .zip file. If the grader has problems with compiling or executing your program, he will e-mail you; you must respond within 48 hours to resolve the problem. If you do not, the grader will assume that your program does not, in fact, compile/execute properly. The project will be graded using the project rubric on Piazza. CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
OSU代写,CSE 3341代写,Principles of Programming Languages代写,Core Interpreter代写,Parser代写,Printer代写,Executor代写,Java代写,Python代写,OSU代编,CSE 3341代编,Principles of Programming Languages代编,Core Interpreter代编,Parser代编,Printer代编,Executor代编,Java代编,Python代编,OSU代考,CSE 3341代考,Principles of Programming Languages代考,Core Interpreter代考,Parser代考,Printer代考,Executor代考,Java代考,Python代考,OSUhelp,CSE 3341help,Principles of Programming Languageshelp,Core Interpreterhelp,Parserhelp,Printerhelp,Executorhelp,Javahelp,Pythonhelp,OSU作业代写,CSE 3341作业代写,Principles of Programming Languages作业代写,Core Interpreter作业代写,Parser作业代写,Printer作业代写,Executor作业代写,Java作业代写,Python作业代写,OSU编程代写,CSE 3341编程代写,Principles of Programming Languages编程代写,Core Interpreter编程代写,Parser编程代写,Printer编程代写,Executor编程代写,Java编程代写,Python编程代写,OSUprogramming help,CSE 3341programming help,Principles of Programming Languagesprogramming help,Core Interpreterprogramming help,Parserprogramming help,Printerprogramming help,Executorprogramming help,Javaprogramming help,Pythonprogramming help,OSUassignment help,CSE 3341assignment help,Principles of Programming Languagesassignment help,Core Interpreterassignment help,Parserassignment help,Printerassignment help,Executorassignment help,Javaassignment help,Pythonassignment help,OSUsolution,CSE 3341solution,Principles of Programming Languagessolution,Core Interpretersolution,Parsersolution,Printersolution,Executorsolution,Javasolution,Pythonsolution,