3460:210 Computer Science II Spring 2015

Section 020 12138

Tuesday and Thursday 1:45 - 3 pm Leigh Hall (LH) 312

Lab Section 021 15141 Tuesday  3:15 - 4:05 pm Arts & Sciences (CAS) 241

Lab Section 022 15142 Thursday 3:15 - 4:05 pm Arts & Sciences (CAS) 241

Lab Instructor: Mr. Sukesh Reddy Gangumalla  sg121@zips.uakron.edu

Teaching Assistant: Mr. Deekshith Sandesari  ds168@zips.uakron.edu

Course Calendar & Schedule

Instructor

Dr. Michael L. Collard

Schedule (Office Hours, Class Times, and Meetings)

News Atom Feed link

Code Summary Examples # Posted: Wednesday, Mar 18

srcML and Code Summary examples

In the examples folder srcML, there is a bunch of original source files and the equivalent srcML files (.xml extension).

Some of these srcML files also have code summaries (more to come later, so checkback often). These will be the output of your Code Summary program. For example:

  • empty.cpp - Original source code file
  • empty.cpp.xml - Source code file in srcML format (the input to your program)
  • empty.cpp.md - Code summary in markdown format (the output of your program)

Hint: One way to start on your program is to get it to output a basic code summary in markdown (equivalent of empty.cpp.md). I would not get fancy on this part of your program, just use std::cout in your main() function.

Lab 8 # Posted: Tuesday, Mar 17

Regular Lab Schedule and Meetings

Lab 8 this week. Normal time and place.

Project 2 Description # Posted: Thursday, Mar 12

Overview of Project 2

Code Summary

The assignment is to take source code, such as an expression, one of your programs, or a major source code project (e.g., Linux kernel or Qt), and produce a code summary.

Your program will be able to take source code and produce a report that includes:

  • Number of statements: if, while, for, do while, expression statements, output statements
  • Number of declared types: class, struct
  • Number of declared functions, methods, constructors, destructors, virtual methods, non-virtual methods
  • Number of calls
  • etc.

The steps include:

  • Input The input to your program will be in the srcML format
  • Processing In order to process the XML you will be using a SAX-like interface to srcML using the UnoXML platform.
  • Output The output will be in the markdown format

Non-Functional Requirements:

  • time The overall speed of generating the report, even for a large project in the srcML format, must be fast, e.g., under a minute for the Linux Kernel (about 34,000 source code files)
  • space The amount of memory used must be reasonable, even for a large system. Note that the Linux Kernel in the srcML format is about 2 GB. Regular DOM approaches (that build a tree in memory) will not work.

Terminology

  • XML is a data exchange language. It consists of elements, marked by tags. The elements can contain text and/or subelements.
  • srcML is an XML format for source code. It wraps text parts of your code with XML elements, and makes it easy to identify parts of your program. It has its own C++ parser, and handles code fragments (partial code) and code that will not compile. It is used by many software engineering researchers, and by industry. The total grant funding for srcML is about $1 million.
  • SAX is the name for a set of very-efficient interface for extracting information from XML. Typically for C++, the developer inherits from a handler class, and implements virtual methods that are called when the SAX parser finds them in the XML.
  • UnoXML is a one-file (header file only) XML parser that is being custom written for this assignment. The primary reason for using UnoXML is that it can be easily included in your project just by including a single header file. Note: Another name considered for UnoXML was NWYOXMLP (Never Write Your Own XML Parser), as I always tell my research students this.
  • markdown is a simple, plain-text formatting language that is easily converted to HTML.

HexChar (Updated) # Posted: Thursday, Mar 12

Completed by class time on Tuesday, Mar 17 (Updated with hints)

The HexChar program is to be completed by class time on Tuesday, Mar 17.

The files for it are in your "Other" folder in your Subversion student folder.

As with all code written on the computer, commit in steps as you implement things. You can comment out what it not yet done in the test program.

Implementation Hint: Use a single character field/data member. That is what the sizeof(d) is checking. Note that sizeof() is not a free function or method that you write. It is built in, and actually an operator.

Implementation Hint: Even though you are using a char field (which takes 1 byte), you can treat it as a number type. Suggest storing the digit as a number, i.e., store a 1 as the number value 1, not as the digit '1'.

Information

Michael L. Collard / collard@uakron.edu