OSK.Parsing.FileTokens
0.1.0
dotnet add package OSK.Parsing.FileTokens --version 0.1.0
NuGet\Install-Package OSK.Parsing.FileTokens -Version 0.1.0
<PackageReference Include="OSK.Parsing.FileTokens" Version="0.1.0" />
paket add OSK.Parsing.FileTokens --version 0.1.0
#r "nuget: OSK.Parsing.FileTokens, 0.1.0"
// Install OSK.Parsing.FileTokens as a Cake Addin #addin nuget:?package=OSK.Parsing.FileTokens&version=0.1.0 // Install OSK.Parsing.FileTokens as a Cake Tool #tool nuget:?package=OSK.Parsing.FileTokens&version=0.1.0
OSK.Parsing.FileTokens
This project provides a file parsing utility that is capable of reading a file as a flow of language, or syntax, tokens rather than a generic stream of bytes and is helpful in situations where a consumer would like the ability to know what type of tokens are being read for a programming language for file or other project based analysis.
The primary path to the library is the FileTokenParser
which can be used to create an IFileTokenReader
that is capable of reading a file stream that is
then interpreted by an implementation of an ITokenStateHandler
. Essentially, the token state handler informs the file token reader the type of language token
is being read.
In terms of the internal logic, a SingleReadToken
is used when a token read by the token reader is a single read token, whereas a MultiReadToken
symbolizes a
token in a file that could cover multiple lines. For example, in C#, a closure token such as a (
or {
would be a single read token but a multi line comment would be
a multi token that has a starting token /*
and a closing token */
. A TokenState
is an object that provides necessary information for the file token reader to process
reading file tokens from a file. Token States will use one of the available values for TokenReadState
to indicate if a token has been fully parsed from the file or if further
processing is necessary.
Information provided from a FileToken
will describe if the token is a closure, delimeter, text,
The library provides:
GenericTokenStateHandler
- A base class that provides most implementation details for generic cases where only the syntax tokens being used need to be changed. Subclasses will only need to define the actual token strings that are available for the language.- A default implementation and example for a general C# token state handler can be seen in
DefaultTokenStateHandler
. Consumers wanting to use the library for a more specific syntax of C# or another language will need to create an implementation of anITokenStateHandler
and pass it into the corresponding overload in theFileTokenParser
.
Contributions and Issues
Any and all contributions are appreciated! Please be sure to follow the branch naming convention OSK-{issue number}-{deliminated}-{branch}-{name} as current workflows rely on it for automatic issue closure. Please submit issues for discussion and tracking using the github issue tracker.
Product | Versions 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. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- OSK.Hexagonal.MetaData (>= 0.0.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on OSK.Parsing.FileTokens:
Package | Downloads |
---|---|
OSK.UML.Framework
A .NET library that provides a foundational framework for parsing files or directories into UML diagrams. |
GitHub repositories
This package is not used by any popular GitHub repositories.