System.Classes.TParser

From RAD Studio API Documentation
Jump to: navigation, search

System.TObjectTParser

Delphi

TParser = class(TObject)

C++

class PASCALIMPLEMENTATION TParser : public System::TObject

Properties

Type Visibility Source Unit Parent
class public
System.Classes.pas
System.Classes.hpp
System.Classes System.Classes

Description

TParser allows DFM files to be parsed.

The TParser is principally used internally in RAD Studio to parse (tokenise) VCL Form files (which have a .dfm extension on Win32). However, it can potentially be used as a more general parser.

A VCL form file contains the description of the properties of the form and the components it owns. Each form file represents a single form, which usually corresponds to a window or dialog box in an application.

The parsing dissects the form text into a set of symbol strings, and value strings. Values may be string representations of strings, widestrings, integers, or floating point numbers.

Navigation is performed by repeatedly using the NextToken method to retrieve a sequence of tokens (symobols and values). The value of each retrieved token is obtained using the TParser methods :


Method Returns Token(s)

TokenFloat

Float

toFloat

TokenInt

Integer

toInteger

TokenString

String

toFloat, toInteger, toString, toSymbol

TokenWideString

WideString

toWString


toEOF is the token returned when the form navigation is complete.

See Also