Declaration of the State_Exercise() function as used in the State Pattern. More...
Go to the source code of this file.
Macros | |
#define | __STATE_EXERCISE_H__ |
Functions | |
void | State_Exercise (void) |
Example of using the State Pattern. | |
Declaration of the State_Exercise() function as used in the State Pattern.
Definition in file c/State_Exercise.h.
#define __STATE_EXERCISE_H__ |
Definition at line 9 of file c/State_Exercise.h.
void State_Exercise | ( | void | ) |
Example of using the State Pattern.
The State pattern alters the behavior of the class hierarchy based on some state. This is the basis of a Finite State Machine.
In this exercise, the State class is a filter that parses text to remove C++-style line and block comments. It needs to be smart enough to ignore comment characters inside quotes.
The filtering process starts with creating the context that drives the state machine. Internal classes are provided for each state.
Definition at line 83 of file State_Exercise.c.
References _State_DisplayText(), DynamicString_Clear(), State_RemoveComments(), DynamicString::string, and textToFilter.