O'Reilly logo

Microsoft® Visual C#® 2008 Step by Step by John Sharp

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing an Extensible Framework

In the following exercise, you will familiarize yourself with a hierarchy of interfaces and classes that together implement a simple framework for reading a C# source file and classifying its contents into tokens (identifiers, keywords, operators, and so on). This framework performs some of the tasks that a typical compiler might perform. The framework provides a mechanism for "visiting" each token in turn, to perform specific tasks. For example, you could create:

  • A displaying visitor class that displays the source file in a rich text box.

  • A printing visitor class that converts tabs to spaces and aligns braces correctly.

  • A spelling visitor class that checks the spelling of each identifier.

  • A guideline visitor class ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required