Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Project 2

A. Overview

In this project, you will work with one or two other people to design a language of your own, describe its grammar, implement a translator for it, and provide some sample programs. You will also look at another group’s language and write a couple programs in that language.

B. General Guidelines

You may not work individually on this project. You must work in groups of 2 or 3 people.

●   The language you develop must be different from any other existing languages, but you can borrow ideas from languages you have seen.

●    It is up to you which language you translate to, but make sure that your language differs significantly from the translation language. That is, if you translate to Java, your language should differ significantly from Java.

●    If you have done a similar project in another class (such as CSc 453), make sure that you do not reuse that project. I am sufficiently familiar with that project that it will definitely raise some red flags. This project is much simpler.

C. Specific Expectations

I. The Grammar

Design a language and describe its syntax as a grammar (like what we did in the first few weeks of class.) Your grammar must be unambiguous.

II. The Translator

Using your grammar, you must implement a translator that parses your language and produces a runnable program in an existing language. You may choose that language, but I recommend  using something you are very familiar with and something that has good regular expressions and pattern matching. It is difficult to design a simple language that is substantially different from all other existing languages. The rule of thumb here will be that your language should be substantially different from your translation language. For example, if you use Java as the translation language, your language should not look much like Java. If you use Python as the translation language, your language should not look much like Python.

III. The Programs

You are required to submit programs written in your language that show that your grammar is  complete and that your translator works. Some of these programs should have errors to show that your translator can detect errors.

IV. The Presentation

In this part, you will make an uploadable presentation that includes the following:

●    Explain your design choices and development process.

●    Describe some of the challenges you faced and how you solved them.

●   Give a tutorial for your language. This should be enough that someone else could write a basic program in your language. This part is key because another group will have to write a couple programs in your language.

●    Describe language design choices you would make if you were going to expand your language even further. (I recommend referencing other languages you have experienced here.)

●    Provide clear evidence that your programs work. I recommend including a video in which you run through the code and show that all the tests work. But at the very least you need to explain all your sample programs (including the ones with errors) and what they show  from your language.

V. Summary of Work Distribution

In a PDF, provide a summary of how you distributed the work among all members of the group.

Please note that everyone should be involved in all the major aspects of the project (presentation & coding).

VI. More Programs

In this portion, each group will be assigned to another group’s language. You will go through the presentation and write two small programs in that language. These will be simple programs that  only require the use of language features that are required. Note that this part of the assignment will affect the grade of both groups involved. Also, although it is ideal that your presentation be thorough enough that the other group can write the programs, you can always communicate with each other if there’s anything that needs to be clarified.

D. Submission & Deadlines.

Instead of having you submit different parts of the project at different times, you will submit everything at the final deadline. However, you are expected to provide updates on your progress as detailed below. Note that you will only get credit if you actually indicate that you have made progress. These updates are also a chance for you to get feedback on different aspects of the project. You are only required to submit the update, but if you want feedback on specific pieces,  you can upload those as well. Just make sure you indicate in the PDF what you want feedback   on.

●    October 30, 2023 by 11:59 PM: Part 1 (5 points)

For this part, all you need to do is email me at [email protected] with your group members.

●    November 6, 2023 by 11:59 PM: Part 2 (5 points)

Upload a PDF (no more than 1 page) with an update on your progress and with  any questions or concerns you have. Please note that this is just a check-in, but you must have made some progress to get credit.

●    November 13, 2023 by 11:59 PM: Part 3 (5 points)

Upload a PDF (no more than 1 page) with an update on your progress and with  any questions or concerns you have. Please note that this is just a check-in, but you must have made some progress to get credit.

●    November 20, 2023 by 11:59 PM: Part 4 (5 points)

Upload a PDF (no more than 1 page) with an update on your progress and with  any questions or concerns you have. Please note that this is just a check-in, but you must have made some progress to get credit.

●    November 27, 2023 by 11:59 PM: Final Submission (100 points)

○    Put all your files from Parts I through V in a zip folder and upload them to D2L.

Also, submit everything except the final work distribution to Piazza. You can submit it anonymously if you prefer, but put your group number in the title of the post.

●    December 4, 2023 by 11:59 PM: Programs for other group (30 points)

Submit the programs for the other group as a followup to their Piazza post.

○    Note that 15 points will be for the programs you write and 15 points will be for the programs written for you.

Late Submissions.

Please note that this policy is different from what is indicated in the syllabus. This is because the project is laid out differently than expected. For Parts 1-4, if you do not submit it on time you forfeit the points. For Part 5, you can submit it up to three days late, but each late day will result  in a 5-point deduction. But if you turned in Project 1 early, you can use your banked days. Also, you can turn in this project early to make up for late deductions on Project 1. For the programs you write for the other group, you need to turn it in on time. However, it is sometimes difficult to ascertain the exact submission time on Piazza, so if you turn it in late, it may still be accepted (it just depends on whether we’ve graded that submission already or not).

E. More Specifics

To design a full language is a lot of work. Your language is going to be very simple and cover only a small subset of a typical language. However, you will have the option to go above the  basic requirements for a higher score if you want.

Parts I - III. In this section, I describe the specific requirements for Parts I through III of the project.

I.      The Bare Minimum. This section describes the simplest acceptable version of this project. If you implement this version well, you can earn a C on the project.

In this version, you create a grammar for your language and implement a compiler-like translator that takes in a program from a file, parses it, and produces a new file in the target language that can be compiled and run. For example, if the translation language is Java, you would implement a translator called Translator.java and provide sample files to show case that your language has all the required components and works correctly, parsing valid programs, catching syntax errors, and creating translations that can be compiled and run. The process for testing would be:

javac Translator.java //This compiles the Translator code.

java Translator.java program1.txt >> Program1.java //This runs the

Translator on the input program and pipes the resulting java program into the file called Program1.java.

javac Program1.java //This compiles the Program1 code.

java Program1.java //This runs the program code.

The minimum requirements for the features included in the language are:

●    integers, Strings, and booleans

variables that can be integers, Strings, or booleans

variable assignment

●    basic integer expressions with basic operators: addition, subtraction, multiplication, division, modulus

●    boolean expressions with basic operators: and, not, or

comparison operators: greater than, less than, equal to

conditionals: should allow for nesting

●    loops: at least one kind of loop; should allow for nesting; should allow for blocks

●    printing to output

command line arguments

The minimum requirements for programs that you provide are:

●    Must provide at least three valid programs.

●    Each of the required components in the grammar must be shown in at least one of the programs.

●    Must provide at least three syntactically invalid programs to show that the translator catches the syntax errors through the parsing process. Please note that these must be syntax errors caught by your translator.

II.     Variations and Additions. In this part, I will describe variations and additions you can include to earn more points.

●    Implement an interactive system that allows the user to type in commands in your language and see the results. Please note that this would not replace the requirement that the translator can translate a full program from a file.

●    Implement the translator as an interpreter-like translator instead of a compiler-like translator. This is likely to be more difficult due to blocks being allowed inside loops. This would vary from the basic requirements in that instead of creating a translation file, the translator would translate and run the code line by line.

Add additional features to the grammar.

Add a typing system.

●   Add additional or more explicit error handling– i.e. more informative error messages, additional types of errors, etc.

●    Implement the parser without using regular expressions. (Instead, you would likely need to implement your own pattern matching.)

●   Add an optional feature that explicitly shows the parsing process.

Add a scoping system.

●    If you have ideas for other additions or variations, you may discuss them with me.

●    NOTE: Anything you add to the language must be illustrated with program example(s).

Part IV. Regardless of your choices for Parts I-III, Part IV is required.

Part V. Regardless of your choices for Parts I-III, Part V is required.

Part VI. Regardless of your choices for Parts I-III, Part VI is required. The specific details of these programs will be provided after the deadline for Parts I-IV, but rest assured that the programs should be possible with only the “bare minimum” required features.

F. Grading

Please note that the actual awarded points here will depend on the quality and complexity of your work. This is to give you an idea of how the points will be broken down and what the maximum number of points is in each category.

Item

Points

General Criteria

Part 1

5

Did you do this on time?

Part 2

5

Did you submit this on time?

Did you make progress?

Part 3

5

Did you submit this on time?

Did you make progress?

Part 4

5

Did you submit this on time?

Did you make progress?

Final Part I:

Grammar

15

Complete, Correct, Unambiguous, Clear, Correct Form

Final Parts II & III:

Translator &

Sample Programs

60

Complete, Correct, Compiles & Runs,

Well-documented, Evidence provided that it works,

Final grade depends on additional features included (if you do just the bare minimum, the max is 42 points).

Final Part IV:

Presentation

20

Complete, Correct, Clear, Good Quality

Final Part V:

Summary of Work

Distribution

5

Submitted, Evidence that everyone was involved in all major aspects

Final Part VI:

Additional Programs

30

Did you write correct programs for the other group? Did the programs they write for you work?

(Note that if the programs don’t work, we will try to    determine which group made the mistake, and if a group fails to submit programs, the TAs will write the programs so you won’t lose points due to another group not submitting.)

Points for Additional Items/Variations

Please note that these are just estimates. The actual points awarded will depend on your particular implementation.

Item

Point Estimate

Interactive System

5-15

Interpreter

5-25

Additional Grammar Features

1-20 (depends on the feature)

Typing System

5-25 (depends on the kind of typing system)

Additional Error Handling

1-20 (depends on the error handling)

Parsing without Regex

10-30

Explicit Parsing

5-20

Scoping

5-25