TAILIEUCHUNG - Lecture Visual programming: Chapter 21 - Muhammad Bilal Zafar

The following will be discussed in this chapter: Introduction to LR parsing, why LR parsers? items and the LR(0) automaton, the LR-parsing algorithm, constructing SLR-parsing tables, viable prefixes, powerful LR parsers, canonical LR(l) Items, constructing LR(l) sets of items, canonical LR(l) parsing tables, constructing LALR parsing tables, efficient construction of LALR parsing tables, compaction of LR parsing tables. | LESSON 21 Overview of Previous Lesson(s) Over View 3 Local tab The Locals tab shows the values of the variables local to the current function. Auto Tab Shows the automatic variables in use in the current statement and its immediate predecessor. Threads Tab Allows to inspect and control threads in advanced applications Over View 4 Modules Tab Lists details of the code modules currently executing. Watch1 Tab Variables can be added to the Watch1 tab that we want to watch. Over View Customized debugging code is aimed at highlighting bugs wherever possible and providing tracking output to helping the programmer to pin down the bugs. 5 Over View. This overhead is not needed in the final version. So this code only operates in the debug version of a program, not in the release version. The output produced by debug code provide clues as to what is causing a problem. 6 Over View Using preprocessor directives, a programmer can add any code to the program. Preprocessor symbol, DEBUG, is always defined automatically in Visual C++ in the debug version of a program, but is not defined in the release version. Debugging code is enclosed between a preprocessor #ifdef / #endif pair of directives. 7 Over View Program Name: cdebug Header Files Source Files 8 TODAY’S LESSON 9 Contents Customized Debugging Code Debugging a program Extending the Class Testing the extending Class Finding the next Bug 10 Extending Class Based on the output, everything is working last time. It’s time to add the definitions for the overloaded comparison operators to the Name class. We are now implementing the comparison operators for Name objects. 11 Extending Class // Less than operator bool Name::operator (const Name & name) const { return name > *this; } 13 Extending Class // Equal to operator bool Name::operator==(const Name & name) const { if(strcmp(pSurname, ) == 0 && strcmp(pFirstname, ) == 0) return true; else return false; } 14 Extending Class Now we can extend the test program by creating an array of Name objects. Initializing them in some arbitrary way. Comparing the elements of the array using comparison operators for a Name object. 15 Find the Next Bug The Build output includes the following message: warning C4717: 'Name::operator >' : recursive on all control paths, function will cause runtime stack overflow The message box indicates you have exceeded the capacity of the stack memory available. There are successive calls of the operator > () function so it must be calling itself, as the missed message said it would. 16 Thank You 17

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.