GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
algol68

Add `location_t` to `LINE_T` for Algol68.

Algol68 line information now uses `location_t` for better file and position tracking.

This change integrates location_t into the LINE_T structure within the Algol68 compiler, replacing separate fields for filename and line number. This allows for more robust tracking of source code positions, including the associated file name via the linemap. Various parts of the Algol68 compiler, particularly those dealing with low-level code generation and parsing, have been updated to use this new structure and associated macros for accessing line information.

In Details

The algol68 frontend's source line information has been modernized by replacing the LINE_T struct's filename and number fields with a location_t. This change, primarily affecting a68-types.h and numerous a68-low-*.cc and a68-parser-*.cc files, uses the linemap associated with location_t to determine the source file. New macros FILENAME and LINE_NO are introduced to abstract access to this information. This refactoring aims to consolidate location data and leverage GCC's standard location_t infrastructure.

For Context
location_t
A data structure in GCC that represents a precise source code location, typically including a file, line number, and column offset. It is fundamental for accurate error reporting.
LINE_T
A structure used in the Algol68 compiler to represent information about a source code line, previously including filename and line number.
linemap
A data structure used by GCC to manage source file information, mapping line numbers to specific files and providing other file-related context.
Algol68
A powerful, early high-level programming language known for its complex syntax and features.
Filed Under: algol68compilerdebugging