|
Descent XML
An XML Parser Helper Library
|
#include <stddef.h>

Go to the source code of this file.
Typedefs | |
| typedef void | descent_xml_classifier_void_fn(void) |
| typedef descent_xml_classifier_void_fn * | descent_xml_classifier_fn(wchar_t input) |
Functions | |
| descent_xml_classifier_void_fn * | descent_xml_classifier_start (wchar_t input) |
Variables | |
| descent_xml_classifier_fn *const | descent_xml_classifier_unexpected |
| descent_xml_classifier_fn *const | descent_xml_classifier_eof |
This file defines a finite state machine, where each state is a function. The state takes an input character and returns a pointer to the next function in the state machine.
If a state receives an input it's not expecting, the descent_xml_classifier_unexpected state is returned. Check for this as an error value. Calling it is an error and will call abort().
If a state correctly reaches the end-of-file state, the descent_xml_classifier_eof state is returned. This means the state machine ran to completion correctly. Check for this to terminate your loop. Calling it is an error and will call abort().
| typedef descent_xml_classifier_void_fn * descent_xml_classifier_fn(wchar_t input) |
Type definition for a classifier function.
A classifier function is a function receiving an input character and returning a pointer to the next classifier function.
| typedef void descent_xml_classifier_void_fn(void) |
Type definition for a "void function".
A pointer-to-void-function should be treated the same as a pointer-to-void: the only meaningful way to use it is to pass it as a parameter to something else, or to cast it to a more meaningful type.
| descent_xml_classifier_void_fn * descent_xml_classifier_start | ( | wchar_t | input | ) |
Entry point for a script.
Expected to be fed the beginning of the file. This state will stay in this state for all whitespace encountered, until an element beginning '<' is encountered. If any other character is encountered, it returns descent_xml_classifier_unexpected.
|
extern |
Return value indicating the classifier function received an end-of-file (legitimately).
|
extern |
Error value, indicating the classifier function encountered an unexpected input.