![]() |
||||||||
![]() |
||||||||
Context/Fuzzy ParsingDelphiXPG utilises a Context/Fuzzy parsing technology for building a cross-reference of identifers within a project. A Context/Fuzzy parser is not like a lexical parser requiring strict adherance to a language grammar, it is fairly strict parsing object definitions, as these are used to identify objects, but is much more lax when parsing method blocks, looking at the larger structural elements of the language. This means a Context/Fuzzy parser may successfully parse source code which fails a compile. There may however be some obscure syntactical constructs the parser does not yet understand, in these cases on error is raised indicating the reason and source line causing the problem. When an error occurs parsing of the current unit is terminated. LimitationsThe Context/Fuzzy parser has the following limitations. Binary DFMsBinary DFMs are not currently processed by the parser, they cause an error to be gerneated, Line:- 1 (1) DFM in binary format. ÿ ^ Binary DFMs can be automatically converted to a text format within DelphiXPG but first it has to be configured to use the command-line convert.exe utility, see Binary DFMs. Assembler CodeThe parser will detect references to identifiers within assembler code, for example,
Here the parameter "P" has been identified within the assmebler code. However if identifiers are referenced via a CPU register then the parser cannot identify these items, for example,
Here the parameter TypeInfo is referenced through CPU register EAX and the parser cannot identify the TTypeInfo cast and references to Name. Overloaded MethodsOverloaded methods are not uniquely identified by their name, unlike non overloaded methods, and require the number and type of parameters to be considered. The parser will fail to identify an overloaded method if it is not uniquely identifiable though the number of parameters or by the data types of the aurguments being passed to the method. For example if the following two overlaoded methods are defined, procedure foo(AForm:TForm);overload; procedure foo(APicture:TPicture);overload; And one is called from the following code, var r : TForm1; begin foo(r); end; Then the following error is raised,
Line:- 62 (5) Failed checking for overloaded method 'FOO'.
foo(r);
____^
This is because data types TForm and TPicture are not known. If the source is reparsed with "Deep Parse" and "Include VCL Source" options switched on then this error does not occur. When the parser fails to uniquely identify an overloaded method it creates a warning message, parsing of the current unit is not terminated. Overloaded Method Error SolutionsPossible solutions to this problem are,
|