Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
ah-source.H File Reference

Source file and span management utilities for compiler-style tooling. More...

#include <cstddef>
#include <fstream>
#include <sstream>
#include <string>
#include <utility>
#include <ah-errors.H>
#include <tpl_dynArray.H>
Include dependency graph for ah-source.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Aleph::Source_Position
 Fully resolved source position. More...
 
struct  Aleph::Source_Span
 Half-open byte range inside a source file. More...
 
struct  Aleph::Source_File
 Registered source file with cached line starts. More...
 
struct  Aleph::Source_Snippet
 Render-ready excerpt for a single source line. More...
 
class  Aleph::Source_Manager
 Stores source files and resolves offsets into human-readable data. More...
 

Namespaces

namespace  Aleph
 Main namespace for Aleph-w library functions.
 

Typedefs

using Aleph::Source_File_Id = size_t
 
using Aleph::Source_Offset = size_t
 

Detailed Description

Source file and span management utilities for compiler-style tooling.

This header provides a lightweight source manager suitable for lexers, parsers, semantic analyzers, and diagnostic engines. Source files are stored as immutable texts indexed by stable file ids. Clients operate on byte offsets and half-open spans [begin, end).

The current implementation uses byte offsets over UTF-8 text. This keeps the data model simple and deterministic for lexer/parser pipelines while still supporting precise line/column reporting.

Definition in file ah-source.H.