Preprocessing
During preprocessing #include
-directives are replaced by the contents of the referenced files. Care has been taken to maintain information about the origin of source code properly. Therefore, an error that is caused by code in an included file will refer to that included file and not to the result of preprocessing, as a simple implementation would do.
Example:
In the following example the file aaa.nc
includes the file bbb.nc
. In the latter file the variables i
and j
are used in G
-Codes. Variable i
is declared at the beginning of aaa.nc
, but j
is not. Therefore, the error message below is issued. As you can see it references the use of variable j
in file bbb.nc
properly.
FILE aaa.nc:
{
VAR
i : INT;
END_VAR
}
G00 X0 Y0 Z0
#include "bbb.nc"
G00 X100
M02
FILE bbb.nc:
G01 X=i F6000
G01 Y=j
G01 Z100
Error message:
bbb.nc: 2.6-2.7: Undeclared variable or enumeration value
'j'