Base class for the GParser.TGParser class (The TGParser class exposes the properties of the TGCustomParser class).
The TGCustomParser class tokenizes a string, in other words it parses a string for a series of tokens separated by delimiters (such as spaces). The TGCustomParser class serves as a base class for tokenizing strings, other classes can descend from this class for their special parsing needs.
Namespace: GParser
Delphi
|
type
TGCustomParser = class(TObject)
end;
|
|
Name
|
Description
|
|
Create(String)
|
Creates and initializes the parser and sets the Text property to the AString parameter.
|
Top
|
|
Name
|
Description
|
|
|
Delimiters
|
Defines the characters that should be treated as "white space" by the parser, the characters to ignore and that separate tokens.
The GParser unit provides two constants of delimiters useful for defining delimiters:
|
|
ParserWHITESPACE
|
Whitespace characters
|
|
|
ParserPUNCTUATION
|
Punctuation characters
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Position
|
Defines the "cursor" position in the Text string. It is from this position that the next call to the Next or Previous methods will search for a Token.
|
|
RestOfText
|
Contains the rest of the Text string from the current Position to the end.
|
|
Text
|
Specifies the string to parse.
Setting this property resets the parser.
|
|
Token
|
Returns the last string token found in the Text string by a call to the First, Next, Previous, or Last methods.
A Token is defined by the text between the delimiter characters specified in the Delimiters
|
|
TokenCount
|
Returns the number of tokens in the Text string.
|
Top
|
Name
|
Description
|
|
First
|
Resets the parser to the beginning of the Text string. The method returns TRUE if a token was found at the beginning (ignoring delimiters, of course).
|
|
IsADelimiter(Char)
|
Returns true if character is a delimiter
|
|
IsAToken(Char)
|
Returns true if character is a token (i.e., is not a delimiter)
|
|
Last
|
Moves the parser to the end of the Text string. The method returns TRUE if a token was found at the end (ignoring delimiters, of course).
|
|
Next
|
Moves the parser to the next token in the Text string. The method returns TRUE if a token was found (ignoring delimiters, of course).
|
|
Previous
|
Moves the parser to the previous token in the Text string. The method returns TRUE if a token was found (ignoring delimiters, of course).
|
|
SetRestOfText(String)
|
Sets the RestOfText property.
|
|
SetToken(String)
|
Sets the Token property.
|
|
SkipCharacters(Integer)
|
Skips characters until the SkipTest character is found.
|
|
SkipDelimiters(Integer)
|
Skips the Delimiters in the Text string at the current Position until a token character is found.
The Step parameter specifies how many characters to skip.
|
|
SkipText(Integer)
|
Skips characters in the Text string at the current Position until a delimitere character is found.
The Step parameter specifies how many characters to skip.
|
Top
|
|
Name
|
Description
|
|
FChanged
|
Represents field FChanged.
|
|
SkipTest
|
Test to conduct when seeing if should skip a character
|
Top
|