omy.Utils.Parser.Source 2.0.0-rc.1

This is a prerelease version of omy.Utils.Parser.Source.
dotnet add package omy.Utils.Parser.Source --version 2.0.0-rc.1
                    
NuGet\Install-Package omy.Utils.Parser.Source -Version 2.0.0-rc.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="omy.Utils.Parser.Source" Version="2.0.0-rc.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="omy.Utils.Parser.Source" Version="2.0.0-rc.1" />
                    
Directory.Packages.props
<PackageReference Include="omy.Utils.Parser.Source" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add omy.Utils.Parser.Source --version 2.0.0-rc.1
                    
#r "nuget: omy.Utils.Parser.Source, 2.0.0-rc.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package omy.Utils.Parser.Source@2.0.0-rc.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=omy.Utils.Parser.Source&version=2.0.0-rc.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=omy.Utils.Parser.Source&version=2.0.0-rc.1&prerelease
                    
Install as a Cake Tool

omy.Utils.Parser.Source

omy.Utils.Parser.Source contains shared source-location contracts for the Utils.Parser ecosystem.

The package is intentionally small. It does not contain runtime parsing logic, parser logic, diagnostic emission logic, generator logic, or tooling behavior. It only provides reusable source-coordinate contracts that parser runtime components, diagnostics, generators, and tooling can reference without introducing artificial package coupling.

Runtime source coordinates

Runtime source coordinates describe technical positions in the source text consumed by lexer, parser, and runtime components.

  • SourceLocation represents a point in source text.
  • SourceSpan represents a range in source text.

These contracts are intended for tokens, parse nodes, lexer/parser runtime observation, runtime analyses, and source-text slicing.

For runtime coordinates:

  • Position is a zero-based absolute offset in the source string.
  • Length is a length in characters/runtime text units according to the source representation used by the runtime.
  • Line and Column are 1-based display coordinates associated with the same point or span start.
  • FilePath is optional because source text can be anonymous, generated, or held only in memory.

Human-readable source coordinates

Human-readable source coordinates describe locations intended for diagnostics, display, import/export, and tooling surfaces.

  • SourceCodeLocation represents a required file path plus 1-based line and column.
  • SourceCodeRange extends SourceCodeLocation with a display/diagnostic length.

These contracts are useful when a readable source location is known but no canonical runtime absolute position is available.

For human-readable coordinates:

  • no absolute source offset is stored;
  • FilePath is required;
  • Line and Column are 1-based;
  • Length, when present, is intended for display or diagnostic ranges rather than runtime slicing authority.

Why both models exist

An absolute position in a source string and a file/line/column location are not interchangeable without the source text and the counting conventions used to interpret it.

Line endings, tab expansion, Unicode representation, and column-counting rules can all make conversion context-dependent. A runtime offset can be the correct contract for token and parse-node operations while still being insufficient to reconstruct a human-readable location without additional source context. Conversely, a human-readable file/line/column location can be enough for diagnostics or tooling while not identifying a canonical absolute offset in a particular runtime source buffer.

For that reason, SourceSpan does not replace SourceCodeRange, and SourceCodeLocation does not replace SourceLocation. They model different contracts and should only be converted by code that explicitly owns the relevant source text and counting conventions.

Intended consumers

This package is designed to be shared by diagnostics, parser runtime components, source generators, and future tooling surfaces that need source-location data without depending on omy.Utils.Parser.Diagnostics.

Versioned API documentation

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on omy.Utils.Parser.Source:

Package Downloads
omy.Utils.Parser.Diagnostics

Shared diagnostics model and descriptor catalog for Utils.Parser runtime and source generator.

omy.Utils.Parser

Universal Parser - A self-describing parser framework. Reads ANTLR4 grammar files and builds parse trees for any source file. The ANTLR4 grammar reader is itself built using the same metamodel objects.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0-rc.1 82 8/28/2026