Syntax analyzer makes parsing of language constructions and also makes syntax-managed translation of program text into binary representation. For source code to compile you should attach text to analyzer using AttachFile or AttachString methods, then create assembly using CreateAssembly method and activate it using ActivateAssembly method. In case of successful parsing, after Parse method call, active assembly will contain compiled code. Using DropToDisk method compilation of intermediate code into final EXE or DLL file can be made. All encountered errors should be monitored using ErrorCount or Error methods. After error handling it should be reset using Reset or ResetErrors methods. When work with assembly is finished it should be deactivated using DeactivateAssembly method and then removed using RemoveAssembly method.
Syntax analyzer provide following COM interface:
interface IFParser : Idispatch
{
[id(1), helpstring("method Parse")]
HRESULT Parse();
[propget, id(2), helpstring("property ErrorCount")]
HRESULT ErrorCount([out, retval] ULONG *pVal);
[id(3), helpstring("method Error")]
HRESULT Error([in] ULONG index,
[out, string, size_is(255)] CHAR **szError);
[id(4), helpstring("method Reset")]
HRESULT Reset();
[id(5), helpstring("method ParseNextOperator")]
HRESULT ParseNextOperator([out, retval] ULONG *Result);
[id(6),helpstring("method DropToDisk")]
HRESULT DropToDisk([in, string] CHAR *szOutPutFileName,
[in] ULONG dwFlags, [in]ULONG *lpResult);
[propget, id(7),helpstring("property CreateAssembly")]
HRESULT CreateAssembly([out, retval] ULONG *pVal);
[propget, id(8), helpstring("property AssembliesCount")]
HRESULT AssembliesCount([out, retval] ULONG *pVal);
[id(9), helpstring("method RemoveAssembly")]
HRESULT RemoveAssembly([in]ULONG index);
[id(10), helpstring("method ActivateAssembly")]
HRESULT ActivateAssembly([in] ULONG index);
[id(11), helpstring("method DeactivateAssembly")]
HRESULT DeactivateAssembly([in] ULONG index);
[id(12), helpstring("method CombineAssemblies")]
HRESULT CombineAssemblies([in] ULONG DestAsm,
[in] ULONG SourceAsm,
[in] ULONG dwFlags);
[id(13), helpstring("method GetActiveAssembly")]
HRESULT GetActiveAssembly([out, retval] ULONG *Index);
[id(14), helpstring("method ValidateAssembly")]
HRESULT ValidateAssembly([in] ULONG index,
[out, retval] ULONG *Result);
[id(15), helpstring("method ResetErrors")]
HRESULT ResetErrors();
[id(16), helpstring("method AttachFile")]
HRESULT AttachFile([in, string] CHAR *szFileName,
[out, retval] ULONG *Result);
[id(17), helpstring("method GetAsmAddress")]
HRESULT GetAsmAddress([in] ULONG index,
[out, retval] ULONG *Address_of_ISTD);
[id(18), helpstring("method AttachFile")]
HRESULT AttachFile([string] char *FileName);
[id(19), helpstring("method AttachString")]
HRESULT AttachString([in, string] CHAR *szCode);
};