Next: , Previous: , Up: Tracking Locations   [Contents][Index]


3.5.3 Printing Locations

When using the default location type, the debug traces report the symbols’ location. The generated parser does so using the YYLOCATION_PRINT macro.

Macro: YYLOCATION_PRINT (file, loc);

When traces are enabled, print loc (of type ‘YYLTYPE const *’) on file (of type ‘FILE *’). Do nothing when traces are disabled, or if the location type is user defined.

To get locations in the debug traces with your user-defined location types, define the YYLOCATION_PRINT macro. For instance:

#define YYLOCATION_PRINT   location_print