These non-related classes is used in my programming project to implement a type of parsing technique called recursive descent parsing. To illustrate further on how to use a lexical analyser, I will provide with a very simple example. Let's suppose that the user typed in the code of the calculator language in a multi-line edit field, and that those code are stored in a CString object called inputStr. The first step is to define constants for your user defined token types. Suppose that lex is an object of type CLexicalAnalyser .
Lexical analysis is only a half the story.
I chose a RPN language as an example because parsing an RPN language is the easiest. Copyright 2001 INT Media Group, Incorporated. All Rights Reserved.