Properties - Parser

Top  Previous  Next

 

The Parser tab page is not available for a multi-project.

 

 

Parser

 

Target version

 

Select the compiler version targeted for the current analysis. Note that, although PAL scans the source files in the same way as the compiler, it does not detect every syntax error. Make sure that the source code compiles correctly for the specified target, otherwise the results output by PAL may be incorrect.

 

PAL supports code written for these compilers/versions:

 

- Borland Pascal 7 (or earlier)

 

- Delphi 1

- Delphi 2

- Delphi 3

- Delphi 4

- Delphi 5

- Delphi 6

- Delphi 7

 

- Delphi 8 for .NET

- Delphi 2005 for Win32

- Delphi 2005 for .NET

- Delphi 2006 for Win32 (also Turbo Delphi for Win32)

- Delphi 2006 for .NET   (also Turbo Delphi for .NET)

- Delphi 2007 for Win32

- Delphi 2007 for .NET

- Delphi 2009 for Win32

- Delphi 2010 for Win32

 

- Delphi XE for Win32

 

- Delphi XE2 for Win32

- Delphi XE2 for Win64

- Delphi XE2 for OSX

 

- Delphi XE3 for Win32

- Delphi XE3 for Win64

- Delphi XE3 for OSX

 

- Delphi XE4 for Win32

- Delphi XE4 for Win64

- Delphi XE4 for OSX

- Delphi XE4 for iOS Device

- Delphi XE4 for iOS Simulator

 

- Delphi XE5 for Win32

- Delphi XE5 for Win64

- Delphi XE5 for OSX

- Delphi XE5 for iOS Device

- Delphi XE5 for iOS Simulator

- Delphi XE5 for Android

 

- Delphi XE6 for Win32

- Delphi XE6 for Win64

- Delphi XE6 for OSX

- Delphi XE6 for iOS Device

- Delphi XE6 for iOS Simulator

- Delphi XE6 for Android

 

- Delphi XE7 for Win32

- Delphi XE7 for Win64

- Delphi XE7 for OSX

- Delphi XE7 for iOS Device

- Delphi XE7 for iOS Simulator

- Delphi XE7 for Android

 

- Delphi XE8 for Win32

- Delphi XE8 for Win64

- Delphi XE8 for OSX

- Delphi XE8 for iOS Device 32-bits

- Delphi XE8 for iOS Device 64-bits

- Delphi XE8 for iOS Simulator

- Delphi XE8 for Android

 

- Delphi 10 for Win32

- Delphi 10 for Win64

- Delphi 10 for OSX

- Delphi 10 for iOS Device 32-bits

- Delphi 10 for iOS Device 64-bits

- Delphi 10 for iOS Simulator

- Delphi 10 for Android

 

- Delphi 10.1 for Win32

- Delphi 10.1 for Win64

- Delphi 10.1 for OSX

- Delphi 10.1 for iOS Device 32-bits

- Delphi 10.1 for iOS Device 64-bits

- Delphi 10.1 for iOS Simulator

- Delphi 10.1 for Android

 

- Delphi 10.2 for Win32

- Delphi 10.2 for Win64

- Delphi 10.2 for OSX

- Delphi 10.2 for iOS Device 32-bits

- Delphi 10.2 for iOS Device 64-bits

- Delphi 10.2 for iOS Simulator

- Delphi 10.2 for Android

- Delphi 10.2 for Linux 64-bits

 

- Delphi 10.3 for Win32

- Delphi 10.3 for Win64

- Delphi 10.3 for OSX 32-bits

- Delphi 10.3 for OSX 64-bits

- Delphi 10.3 for iOS Device 32-bits

- Delphi 10.3 for iOS Device 64-bits

- Delphi 10.3 for iOS Simulator

- Delphi 10.3 for Android 32-bits

- Delphi 10.3 for Android 64-bits

- Delphi 10.3 for Linux 64-bits

 

- Delphi 10.4 for Win32

- Delphi 10.4 for Win64

- Delphi 10.4 for OSX 32-bits

- Delphi 10.4 for OSX 64-bits

- Delphi 10.4 for iOS Device 32-bits

- Delphi 10.4 for iOS Device 64-bits

- Delphi 10.4 for iOS Simulator

- Delphi 10.4 for Android 32-bits

- Delphi 10.4 for Android 64-bits

- Delphi 10.4 for Linux 64-bits

 

- Delphi 11 for Win32

- Delphi 11 for Win64

- Delphi 11 for OSX 32-bits

- Delphi 11 for OSX 64-bits

- Delphi 11 for iOS Device 32-bits

- Delphi 11 for iOS Device 64-bits

- Delphi 11 for iOS Simulator

- Delphi 11 for Android 32-bits

- Delphi 11 for Android 64-bits

- Delphi 11 for Linux 64-bits

- Delphi 11 for OSX ARM 64-bits

 

- Delphi 12 for Win32

- Delphi 12 for Win64

- Delphi 12 for OSX 32-bits

- Delphi 12 for OSX 64-bits

- Delphi 12 for iOS Device 32-bits

- Delphi 12 for iOS Device 64-bits

- Delphi 12 for iOS Simulator

- Delphi 12 for Android 32-bits

- Delphi 12 for Android 64-bits

- Delphi 12 for Linux 64-bits

- Delphi 12 for OSX ARM 64-bits

 

 

Default = Delphi 12 for Win64

 

PAL may also work with earlier versions of Turbo Pascal for DOS and Windows (prior to Borland Pascal 7), but this has not been validated and consequently is not guaranteed. In this case, select Borland Pascal 7 for best results.

 

For targets Delphi 1 and upward, PAL is able to load identifiers from the System unit in Delphi's runtime library. This makes PAL aware of subprograms like Inc and FreeMem and the TObject root class, resulting in reports that are more accurate and complete.
 

 

Files parsed

Default = Both source and form files (DFM/NFM/XFM-files)

 

Select an option:

 

Both source and form files (DFM/FMX/NFM/XFM-files)

This is the default option. If PAL finds a form file, it will be examined together with the corresponding PAS-file.
 

Only source files

No form files will be examined.

 

It is recommended to let PAL also find and parse form files, so normally keep this option selected.

 

 

Include files must exist

Default = Yes

 

Mark this checkbox if a missing include file should trigger an error and stop the analysis. Keep this option selected if possible, since a vital missing include file could generate incorrect results.

 

 

Use Delphi project options if found

Default = Yes

 

When a Delphi compiler and a DPR file is selected, PAL tries to load the corresponding project options file. If successful, these options are used. For search paths, unit aliases and defines, the options are merged with the options you select. This makes it possible to instance, in PAL to provide the path to the VCL source files.

 

If a Delphi project file (DPR file) is parsed, search paths following the in keyword are automatically followed.

 

The Status Report shows which search paths that are used for the particular analysis.

 

 

Parse implementation for non-reported units

Default = No

 

It is not necessary to parse implementation parts of units that are not reported.

 

 

Search folders

 

Select the drives and folders where PAL will search for source files. The folder containing the primary source file is automatically searched, and there is no need to include this folder.

 

Unlike the compiler, PAL does not require that all source code is available. However, it is often best to make as much source code visible to PAL as possible.

 

Enter search folders, in priority order, separated with a semicolon e. g.:

 

c:\source\myunits;c:\source\generic;c:\source\proj1

 

Alternatively, press the ellipsis button to select the folders in a selection dialog.

 

You may also enter relative paths, like “..\..\generic”.

 

If a Delphi project or package file (DPR, or DPK file) is parsed, search paths following the in keyword are automatically followed.

 

Because the parser looks in the directories according to the order specified, it is wise to put more frequently used directories first in the list.

 

User-defined environmental variables, like “$(UTILS)”, set in the Delphi IDE or in the System settings in the Control Panel, may also be used.

 

You can also use a relative path. The path is then relative to the folder where the project file (PAP-file) is located.

 

 

Append Delphi Library Path

Default = Yes

 

Mark this checkbox if you want PAL to look for modules also in these folders. The Delphi Library Path is set in the Delphi IDE under Tools|Environment Options and the Library tab page.

 

 

Append Delphi browsing path

Default = Yes

 

Mark this checkbox if you want PAL to look for modules also in these folders. The Delphi browsing path is set in the Delphi IDE under Tools|Environment Options and the Library tab page.

 

 

Excluded search folders

Source code from these folders will NOT be parsed. Enter excluded folders separated with a semicolon e. g.:

C:\source\notused;c:\source\3rdparty

 

Alternatively, press the ellipsis button to select the folders in a dialog box.

 

It is possible to select that an exclude folder should also apply to its subfolders. In this way it is possible to exclude “C:\Program Files\Borland\Delphi7\Source” and all the subfolders. When subfolders are excluded, the folder name is suffixed with “<+>”.  

 

User-defined environmental variables, like “$(UTILS)”, set in the Delphi IDE or in the System settings in the Control Panel, may also be used.

 

You can also use a relative path. The path is then relative to the folder where the project file (PAP-file) is located.

 

 

Excluded files

Source code from these files will NOT be parsed. Enter excluded files separated with a semicolon, e. g.:

 

myfile.pas;obsolete.pas

 

Alternatively, press the ellipsis button to select the files in a dialog box.

 

 

Unit aliases

 

Default for Win32 versions:

WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE

 

Default for .NET versions:

WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE

 

See the Delphi documentation for an explanation of unit aliases.

 

 

Conditional defines

 

Specify conditional compilation directives that are valid for the current analysis. PAL parses source code just like the compiler, and must treat conditional directives, meaning that it will ignore sections of not activated code. You may also include defines within the source code. Defines set in the Delphi project file will also be used, if found.

 

Enter conditional defines, separated with a semicolon e. g.:

 

Final;Special

 

Alternatively, press the ellipsis button to enter the defines in a dialog box.

 

PAL even initializes predefined defines just as the compiler does (e g 'WIN32'). It also keeps track of the state of all compiler directives so that directives like {$IFOPT} will function correctly.

 

The conditional compilation directive _PEGANZA_ is always defined.

 

 

Exclude identifiers from these folders in reports (but always report main file):

In addition, it is possible to select folders that should be considered in the generated reports. Identifiers declared in source code from these folders will not appear in the reports. The Totals Report and Third-party dependencies Report will however include even these identifiers.

 

Enter excluded folders separated with a semicolon e. g.:

 

c:\source\myunits;c:\source\generic

 

Alternatively, press the ellipsis button to select the folders in a selection dialog.

 

It is possible to select that an exclude folder should also apply to its subfolders. In this way it is possible to exclude “C:\Program Files\Borland\Delphi7\Source” and all the subfolders. When subfolders are excluded, the folder name is suffixed with “<+>”.  

 

User-defined environmental variables set in the Delphi IDE, may also be used.

 

You can also use a relative path. The path is then relative to the folder where the project file (PAP-file) is located.

 

 

Expressions for $IF-directives, that evaluate to TRUE

In Delphi 6, the new $IF-directive was introduced. The $IF-directive is followed by an expression, that evaluates to TRUE or FALSE. If you use $IF-directives, you must supply all expressions that evaluate to TRUE, because PAL cannot always determine the value of an expression. Enter the expressions separated with semicolons, like:

 

RTLVersion > 14;Declared(Windows)

 

Please observe that you do not need to include Defined-directives like "Defined(MSWINDOWS)", because PAL manages to evaluate those directives.

 

When PAL’s parser finds a $IF-directive in code, it will try to evaluate it. If it is an expression that you have supplied, it will be evaluated to TRUE, otherwise it will be evaluated as FALSE. Directives that are evaluated as FALSE, imply that the corresponding code is not activated.

 

 

Unit scopes (namespaces)

This field is only enabled (and relevant) if the compiler is set to Delphi 8 or higher compilers. Press the ellipsis button to select the namespaces.

 

 

Default namespace

This field is only enabled (and relevant) if the compiler is set to Delphi 8 or higher compilers.

 

 

See also:

 

Options menu

Properties - General

Properties - Format

Properties - Reports

Properties - Source

Properties - Switches