Week 5 Class 10 Thu Feb 15 Posted: Feb 15
After Class
Project 2
git pull
git switch feedback
If you had a v1d tag, you should see the file concerns.html. Load that file up in your favorite browser. If you have never done that, try now. Do not try to look at concerns.html at GitHub, because it does not display as a web page. When you are done viewing it, make sure to return back to the main
branch:
git switch main
git branch
If you open this file in a browser, you will see the XML parsing low-level concerns in srcfacts.cpp marked in red. This is based on the functions declared in xml_parser.hpp at the tag v1d, so if you make any changes since then, they won't show up. Here is an example for the original srcfacts.cpp. Yours is based on your code at tag v1d.
It is a bit imprecise, and I may be able to generate better ones over time. It is possible that some of the code in red cannot easily be moved to functions in xml_parser. But it should give you a general idea.
The structure of the big while statement with the nested-if is not marked in red, as it is not possible to move that out of srcfacts.cpp quite yet. If you have, then you have srcML or srcFacts concerns in your xml_parser, which creates even more of a problem. A C++ class
would not help remove this structure. For that, we need mechanisms for event-driven programming.
Code assumes unique attribute and value Issue
I repeat the text of this v1e issue here for those who did not receive it:
The code that counts the number of line comments assumes that the comment element is the only element that has the form: <… type="line">
While not verified, it is also probably the case that the code for counting the number of literal strings has the same limitation.
These elements do have these forms. But assuming this is true for all other srcML elements, current or future, is an assumption that is never stated or described. The choice is to describe in excruciating detail why this is the case, how someone could detect it, and what to do with their data when this happens. This requires forms that have to go to legal and be filled out in triplicate.
Another choice is to fix the problem.
I am not taking any points off for this issue. However, I expect it to be fixed. A few points to make:
Announcements
Project 1
v1b
and v1c
in Brightspacev1c
v1b
were based on your code at label v1c
v1d
, some of the issues are generated, but not allv1d
as not all checks are donev1d
are srcFacts and srcML concerns in the xml_parser filesExercise 29: TRACE
Agenda
Exercise 32: Sequence Diagram
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)
Exercise 33: Utilities
Provide a function declaration in the file Utilities.hpp and a 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. Only provide the declaration and example 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:
g++ --std=c++17 -c UtilitiesExamples.cpp
For each function declaration, include a doxygen comment that describes the function and describes what data is IN, OUT, or IN/OUT.
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
sUnless otherwise noted, exercises are due by 4:30 pm on Monday, Feb 19