TParser class
Class to parse the contents of a stream containing text data.
Declaration
TParser = class(TObject)Inheritance
- TParser
- TObject
Description
This class breaks a stream of text data in tokens. Its primary use is to help reading the contents of a form file (usually a file with dfm, xfm or lfm extension), and for this reason it isn't suitable to be used as a general parser.
The parser is always positioned on a certain token, whose type is stored in the Token property. Various methods are provided to obtain the token value in the desired format.
To advance to the next token, invoke NextToken method.
See also
Properties
FloatType | public | The type of a float token. |
SourceLine | public | Current source line number. |
Token | public | The type of the current token. |
Methods
Create | public | Creates a new parser instance. |
Destroy | public | Destroys the parser instance. |
CheckToken | public | Checks whether the token if of the given type. |
CheckTokenSymbol | public | Checks whether the token equals the given symbol. |
Error | public | Raises an exception with the given message. |
ErrorFmt | public | Raises an exception and formats the message. |
ErrorStr | public | Raises an exception with the given message. |
HexToBinary | public | Writes hexadecimal data to a stream. |
NextToken | public | Reads the next token and returns its type. |
SourcePos | public | Returns the current position in the stream. |
TokenComponentIdent | public | Returns the path of a subcomponent starting from the current token. |
TokenFloat | public | Returns the current token as a float. |
TokenInt | public | Returns the current token as an integer. |
TokenString | public | Returns the current token as a string. |
TokenWideString | public | Returns the current token as a widestring. |
TokenSymbolIs | public | Returns True if the token equals the given symbol. |
Inherited
From TObject (40)
AfterConstruction BeforeDestruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName SafeCallException StringMessageTable SystemHasExtendedRTTI ToString UnitName
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
