tailieunhanh - Lecture Visual programming: Chapter 14 - Muhammad Bilal Zafar

The following will be discussed in this chapter: Optimization of DFA-based pattern matchers, important states of an NFA, functions computed from the syntax tree, computing nullable, firstpos, and lastpos, computing followups, converting a RE directly to DFA, minimizing the number of states of DFA, trading time for space in dfa simulation, two dimensional table, terminologies. | LESSON 14 Overview of Previous Lesson(s) Over View VP is the methodology in which development allows the user to grab and use the desired tools like menus, buttons, controls and other elements from a palette. 3 Over View Operator Overloading: Operator overloading is a very important capability, it enables to make standard C++ operators, such as + , - , * , and so on, work with objects of user defined data types. Following operators can’t be overloaded: 4 Over View Class Template A class template is not a class, but a sort of recipe for a class that will be used by the compiler to generate the code for a class. 5 Over View Problem Definition: The principal function of a box is to contain objects of one kind or another, so, in one word, the problem is packaging. Basic operations on CBox class include: Calculate the volume of a Cbox. Compare the volumes of two CBox objects. Compare the volume of a CBox object with a specified value, and vice versa. 6 Over View. Add two CBox objects | LESSON 14 Overview of Previous Lesson(s) Over View VP is the methodology in which development allows the user to grab and use the desired tools like menus, buttons, controls and other elements from a palette. 3 Over View Operator Overloading: Operator overloading is a very important capability, it enables to make standard C++ operators, such as + , - , * , and so on, work with objects of user defined data types. Following operators can’t be overloaded: 4 Over View Class Template A class template is not a class, but a sort of recipe for a class that will be used by the compiler to generate the code for a class. 5 Over View Problem Definition: The principal function of a box is to contain objects of one kind or another, so, in one word, the problem is packaging. Basic operations on CBox class include: Calculate the volume of a Cbox. Compare the volumes of two CBox objects. Compare the volume of a CBox object with a specified value, and vice versa. 6 Over View. Add two CBox objects to produce a new CBox object that will contain both the original objects. Multiply a CBox object by an integer (and vice versa). Determine how many CBox objects of a given size can be packed in another CBox object of a given size. Determine the volume of space remaining in a CBox object after packing it with the maximum number of CBox objects of a given size. 7 TODAY’S LESSON 8 Contents A Multi-file Project Organizing Program Code Naming Program Files CLR Programming Arrays Sorting Arrays 9 A Multi-file Project Before we actually start writing the code to use the CBox class and its overloaded operators, first we assemble the definition for the class into a coherent whole. We are going to take a rather different approach from what we have done previously. We are also going to start using the facilities that Visual C++ 2008 / 2010 provides for creating and maintaining code for our classes. This mean that practically we do rather less of the work, but it will also mean that the code will