|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS ��NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |
class CParser { public: CParser(); ~CParser(); public: void SetErrorHandler(CErrorHandler *pErrorHandler); void SetProgramName(const CString &strProgramName); void SetLineNumber(int nLineNumber); void Parse(IStream *pStream, const XRepository &pRepository); bool HaveError(); };
The SOM IDL parser.
The parser performs parsing of the source IDL description, extracts definitions of modules, interfaces, constants, attributes, and operations, and adds these definitions to the specified SOM repository.
When the parser detects an error in the IDL source
(for example, invalid IDL syntax), it attempts to recover and
to continue parsing.
All errors are reported to the error handler
(see
CErrorHandler
) attached to this parser.
When the parsing is finished, the application can use
HaveError
function to check whether
any errors were detected.
CErrorHandler
Constructor/Destructor Summary | |
CParser
();
����������Constructs the IDL parser. |
|
~CParser
();
����������Destroys the IDL parser. |
Function Summary | |
void
|
SetErrorHandler
(CErrorHandler *pErrorHandler);
����������Specifies the error handler for reporting non-fatal parse errors. |
void
|
SetProgramName
(const CString &strProgramName);
����������Specifies the name of the IDL source. |
void
|
SetLineNumber
(int nLineNumber);
����������Specifies the starting line number of the IDL source. |
void
|
Parse
(IStream *pStream, const XRepository &pRepository);
����������Parses the IDL definition provided by the given stream; adds results to the specified repository. |
bool
|
HaveError
();
����������Tests whether a parse error was encountered. |
Constructor/Destructor Detail |
CParser();
Constructs the IDL parser.
~CParser();
Destroys the IDL parser.
Function Detail |
void SetErrorHandler(CErrorHandler *pErrorHandler);
Specifies the error handler for reporting non-fatal parse errors.
pErrorHandler
- the error handlervoid SetProgramName(const CString &strProgramName);
Specifies the name of the IDL source.
This name may be used in error messages.
strProgramName
- the source namevoid SetLineNumber(int nLineNumber);
Specifies the starting line number of the IDL source.
Usually this parameter is set to
1
; the different
value may be used if the IDL definition is embedded in
a bigger file.
Line numbers may be used in error messages.
nLineNumber
- the starting line numbervoid Parse(IStream *pStream, const XRepository &pRepository);
Parses the IDL definition provided by the given stream; adds results to the specified repository.
The repository needs not to be empty when the parsing is started. An application can perform multiple parser runs with different IDL sources and the same repository; as the result, the repository will contain definitions extracted from multiple IDL sources.
pStream
- the stream containing IDL sourcepRepository
- the repositorybool HaveError();
Tests whether a parse error was encountered.
true
if the parse error was
encountered;
false
otherwise
|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS ��NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |