Send
Close Add comments:
(status displays here)
Got it! This site uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.nbsp; Note: This appears on each machine/browser from which this site is accessed.
A4: Asmt#4: String rewriting systems
You are not logged in. Go to
Login page.
You need to login before you can view more content.(content omitted that requires login)
4. A4: String rewriting systems
175: Asmt#4: String rewriting systems , Name: ___________________________
CS 340, Fall 2019, York College of Pennsylvania
178, 40 points, 2019-10-25 (due by midnight)
5. Submission
The subject line should be the following.
182
Submit a valid zip file (not a tgz, not a xzip, not a tar, etc.) that contains the following.
The program file for this assignment with the proper file extension.
The Word document as a valid docx file.
Any additional files created such as png, svg, dot, etc.
Word documents need to look nice. In the Word document, use a fixed width font for program text and a serif font (e.g., Times) for document text and a sans-serif font (e.g., Helvetica or Arial) for headers. Headers should be in bold and bigger than the other text.
6. Program requirement
From your submission from the previous assignment, modify the program as follows.
Use a string literal (or list of literals converted to a string in the program) so that there is only one copy of the GraphViz output text in your program. The text should have embedded placeholders for strings to be substituted.
For each of the GraphViz program outputs, create a substitution dictionary.
Generate the desired output by calling a general routine that uses regular expressions to identify the placeholders and then substitutes the values for the placeholders (e.g., monikers) from the substitution dictionary.
Note: The output of your program should be the same (if your previous program was correct) but you are now using a different method (string rewriting) to get the output.
Once you have A3 complete, then A4 is to use the string rewriting method covered in class (using regular expressions) to output any of the four but with only one copy of the similar parts of the four programs and the different parts substituted using string rewriting.
7. Relevant content
8. Document requirement
File:
Word document: A Word document (extension
docx) that describes what you have done. The guiding principle when writing the document is the following. "
Would someone who is somewhat familiar with what you are doing and reading your document know what you are doing at each step of the process?"
Include a short descriptive title at the top of the document.
Include the following sections. Each section should be clearly and consistently marked. All program text should have explanatory text before and after the program text.
Introduction of what is in the document.
The logical expression being used in a fixed font such as "Courier New".
The program or programs that generate the GraphViz files.
The commands used to run the GraphViz files. A PNG and SVG file for each should be generated.
A directory listing of the program file, the GraphViz files, and output files.
The output of the GraphViz files.
PNG image as an image
SVG text as text
SVG as image
If you use a Bash script to automate any of the process, include the text of the Bash script used.
A summary at the end.
All program or command or command output text should be in a fixed font such as "
Courier New".
If you use LibraOffice or OpenOffice instead of Microsoft Office you need to export your document file to the type
docx and not the native format. Use the appropriate "
Save As" command.
9. Zip file submission
Zip the above files into a zip file. Attach the zip file (and only one zip file) to your email message.
Submit the following by sending an email to my email account at
robinsnyder@gmail.com from your YCP email address/account.
Attach the above zip file to your message.
The subject line should be the following (and only the following).
193
10. General comments
Here are some general comments.
The intended method was to use the general method of placeholders with regular expressions and dictionaries to substitute for the placeholders.
Interspersing variables in the text and replacing them is not general and requires custom manual programming. It is not easily automated as is the required method.
Note the following:
This assignment is a central part of programming language design and implementation.
A nontrivial extension of this principle is the principle upon which all server-side web page generation is based.
11. Scoring rubric
CS 340 - A4 : Asmt#4: String rewriting systems
Your grade: _ / 40
[LATE] Late or redo penalty: _ / -40
Programs and output: _ / 20
Document explanations as required: _ / 5
Document includes programs and output: _ / 10
Document style - sections, text, programs: _ / 5
[CREDIT] Extra credit: _ / +8
Comments:
12. End of page