Book Image

C++ Windows Programming

By : Stefan Björnander
Book Image

C++ Windows Programming

By: Stefan Björnander

Overview of this book

It is critical that modern developers have the right tools to build practical, user-friendly, and efficient applications in order to compete in today’s market. Through hands-on guidance, this book illustrates and demonstrates C++ best practices and the Small Windows object-oriented class library to ease your development of interactive Windows applications. Begin with a focus on high level application development using Small Windows. Learn how to build four real-world applications which focus on the general problems faced when developing graphical applications. Get essential troubleshooting guidance on drawing, spreadsheet, and word processing applications. Finally finish up with a deep dive into the workings of the Small Windows class library, which will give you all the insights you need to build your own object-oriented class library in C++.
Table of Contents (22 chapters)
C++ Windows Programming
Credits
About the Author
About the Reviewer
www.PacktPub.com
Dedication
Preface
Free Chapter
1
Introduction

Formula interpretation


The core of a spreadsheet program is its ability to interpret formulas. When the user inputs a formula in a cell, it is interpreted and its value is evaluated. The process of formula interpretation is divided into three separate steps. First, given the input string, the Scanner generates a Token List, then the Parser generates a Syntax Tree, and the Evaluator determines the value.

A token is the least significant part of the formula. For instance, a1 is interpreted as a reference and 1.2 is interpreted as a value. Assuming that the cells have values according to the following sheet, the formula interpretation process will be as follows. Remember that a formula is text beginning with an equal sign (=).

The tokens

The scanner takes a string as input and finds its least significant parts-its tokens. Spaces between the tokens are ignored, and the scanner makes out no difference between capital and small letters. The Value token needs an extra piece of information...