TR 2:00 - 3:15 pm (CAS) 144
Week 5 Class 10 Thu Feb 13 Posted: Feb 13
After Class
Due Dates Exercises due next week ordered by due date:
Each exercise is due by 4:30 pm on the day indicated.
Exercise 30: Utilities
For each @TODO
you are to declare a single function declaration, and only call it once in the example.
Do not solve any of the @TODO
s with two or more functions, or call the function more than once.
srcml on macOS
I have an experimental brew package for the srcml client on macOS. If you are on macOS, let me know if it does or does not work.
With brew
installed:
To verify if srcml
is installed:
You can run this, from the build directory, on a source-code file and then run with srcfacts:
Or, direct entry of text:
Announcements
I am introducing Project 2 because we do not have class on Tuesday, Feb 18.
Agenda
Exercise 30: Utilities Due: Wednesday, Feb 19
Provide a single function declaration in the file Utilities.hpp and a single function call
in UtilitiesExamples.cpp for each @TODO
in UtilitiesExamples.cpp. Once you
do, remove the @TODO
for that block. The function declarations in Utilities.hpp
must follow the order of the examples of the call in UtilitiesExamples.cpp.
Do not implement the function. Do not provide a function definition. Only provide the declaration and example single call using the variables given. The function declaration must be complete enough so that it would be possible to implement the function.
Make sure the program compiles. But, since you are not providing a function definition, the program will not link or run successfully.
To compile the program without linking:
For each function declaration, include a Doxygen comment that describes
the function and describes what data is IN, OUT, or IN/OUT. An example is already in the include file. Note that Doxygen comments start with /**
.
Finish the problem for each @TODO
, remove the @TODO
, and then commit.
Each commit should complete one @TODO
. The first one is completed
as an example.
If any of the following occur, then the entire exercise score is a 0:
@TODO
sExercise 32: Sequence Diagram Due: Tuesday, Feb 18
Create a sequence diagram at SequenceDiagram.org for the diagram on the right, which is for parsing a start tag with an attribute.
Start with the SVG file with the GitHub Classroom Repository link at Brightspace, and commit your changes to that repository.
Your final result should look exactly like the image shown here.
Make sure to save as a SVG Image File (vector image with embedded source text)
Each exercise is due by 4:30 pm on the day indicated.
Continue to improve the design of srcFacts using more language features. There are no changes to the functionality of this project, only to the design.
In addition to the following code changes, you will maintain two modeling diagrams. There will be a pull request to add the starting files to your repository.
The diagrams must be updated to reflect the code for each tag. So do not tag until the part below is done and any diagrams are updated.
Tag v2a Implement and close all issues I created as feedback from Project 1. When you finish fixing an issue, at least one commit must describe what you are changing. Add your calls' exact function names and (UML form of) parameters to the xml_parser for the sequence diagram. Due Feb 20
Tag v2b Create a namespace, xml_parser
, for the functions in xml_parser. This will involve making changes to the files srcfacts.cpp, xml_parser.hpp, and xml_parser.cpp. Due Feb 21
From now on, do not change the files xml_parser.hpp or xml_parser.cpp.
Tag v2c Create the class XMLParser
in the files XMLParser.hpp and XMLParser.cpp where the methods call the free functions from xml_parser.hpp. Do not use any fields/data members. The method parameters must be identical to the parameters of the free functions in xml_parser.hpp. Add the XMLParser as a participant for the sequence diagram and show how it is involved between srcFacts and xml_parser. Due TBD
Tag v2d Eliminate any parameters in the XMLParser methods that you can, replacing them with field/data members in the class. In other words, move as many XML parsing variables from srcfacts.cpp as possible. Do this one field/data member at a time. For the class diagram, show the added fields and the removal of parameters. For the sequence diagram, update the parameter lists of the calls to the XMLParser. Due TBD
Tag v2e Inline the calls to the xml_parser free functions into your XMLParser methods. Inlining the calls does not mean adding the inline
specifier, and it does not mean changing anything in XMLParser.hpp. Do this one free function call at a time. Ultimately, your XMLParser.cpp should have no calls to xml_parser functions and will not need to include xml_parser.hpp. Do not make any changes to the files xml_parser.{hpp,cpp}. For the sequence diagram, remove the xml_parser participant and any calls. Due TBD
Ensure the project compiles, builds, and produces the correct answer at every commit with GCC and Clang.
There is a zero-tolerance policy for the following. A zero-tolerance policy means that you will receive a zero for that part if any of the following are violated:
v2a
, v2b
, v2c
, v2d
, and v2e
, the program must compile and build in gcc and clang without errors or warnings.private
TA: Ms. Afia Asante aa998@uakron.edu
TA: Mr. Isaiah Ekundayo ioe2@uakron.edu