The GSWBaseParser class provides fundamental parsing
capabilities for GSWeb template and declaration
processing. This abstract base class maintains
parsing state and provides utility methods for
position tracking, line/column calculation, and
common parsing operations.
Returns a formatted string describing the current
parsing position in terms of line and column
numbers. This method is useful for generating
human-readable error messages and debugging
output that shows exactly where in the source text
the parser is currently positioned.
Returns the line number (zero-based) corresponding
to the current parsing position. This provides just the
line information without column details, useful for
quick line-based position tracking.
Calculates and returns both line and column
indexes for the specified character position
through the provided pointer parameters. This
method provides the most efficient way to obtain
both coordinates simultaneously when both line and
column information are needed.
Returns a formatted string describing the line and
column position corresponding to the specified
character index within the source
text. This allows conversion from absolute character
positions to human-readable line and column
coordinates for any position in the parsed
content.
Returns the line number (zero-based) corresponding
to the specified character index within the
source text. This allows determination of line
position for any character index in the
parsed content.
Current parsing position index Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Total length of the source string Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
The source string being parsed Warning
the underscore at the start of the name of this
instance variable indicates that, even though it
is not technically private, it is intended for
internal use within the package, and you should
not use the variable in other code.
Unicode character buffer for efficient access
Warning the underscore at the start
of the name of this instance variable indicates that,
even though it is not technically private, it
is intended for internal use within the package, and you
should not use the variable in other code.
Convenience macro for logging parser buffer state
with automatic capture of function name, file, and line
information. This provides an easy way to add
debug logging throughout parser code.
Base parser class providing fundamental parsing
functionality for GSWeb template and
declaration parsers. This abstract class
encapsulates common parsing operations including
string buffer management, position tracking, and
line/column index calculation utilities.
GSWBaseParser serves as the foundation for more
specialized parsers in the GSWeb framework, such
as template parsers and declaration parsers. It maintains
an internal Unicode character buffer for efficient parsing
operations and provides methods to track parsing
position with accurate line and column reporting for
error messages and debugging. Key features: - Unicode
character buffer management for efficient parsing -
Line and column position tracking throughout parsing
operations - Utility methods for common parsing
tasks and position reporting - Foundation for
specialized GSWeb parsers
void _ParserDebugLogBuffer(char* fn, char* file, int line, unichar* uniBuf, int length, int index, int charsCount);
Availability: OpenStep
Debug logging function for parser buffer state. This
function logs detailed information about the
parser's current buffer state including position,
remaining characters, and context information. Used
internally for debugging parser operations and
troubleshooting parsing issues.
Inline utility function that tests whether a Unicode
character represents whitespace or blank
characters. This includes space, tab, form feed,
carriage return, newline, and vertical tab
characters. Essential for parsing operations that
need to skip or handle whitespace appropriately.
Inline utility function that tests whether a Unicode
character represents a decimal digit (0-9). This
provides efficient character classification for
numeric parsing operations commonly needed in
template and declaration parsing.
Inline utility function that tests whether a Unicode
character represents an end-of-line character
(carriage return or newline). This is specifically
focused on line termination detection, useful for
line-based parsing operations and accurate line
counting during template processing.
Inline utility function that tests whether a Unicode
character represents a hexadecimal digit (0-9, A-F,
a-f). This provides efficient character classification
for hexadecimal parsing operations, useful for color
values, escape sequences, and other hex-encoded
content in templates.