Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
Move state machine stuff to an extensions project
Browse files Browse the repository at this point in the history
  • Loading branch information
GGG-KILLER committed Jan 26, 2020
1 parent 71b6ca8 commit 96228d5
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.0.0" />
<PackageReference Include="MSTest.TestFramework" Version="2.0.0" />
<PackageReference Include="coverlet.collector" Version="1.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\GParse.Extensions.StateMachines\GParse.Extensions.StateMachines.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using GUtils.StateMachines.Transducers;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace GParse.Tests.IO
namespace GParse.Extensions.StateMachines.Tests
{
[TestClass]
public class SourceCodeReaderTransducerExtensionsTest
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.1</TargetFrameworks>
<CodeAnalysisRuleSet>RuleSet1.ruleset</CodeAnalysisRuleSet>
<Authors>GGG KILLER</Authors>
<Description>Parsing and lexing utilities to create your own parser and lexer</Description>
<Copyright>GGG KILLER © 2020</Copyright>
<PackageLicenseUrl></PackageLicenseUrl>
<PackageProjectUrl>https://github.com/GGG-KILLER/GParse</PackageProjectUrl>
<RepositoryUrl>https://github.com/GGG-KILLER/GParse</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Version>4.0.0</Version>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\GParse.xml</DocumentationFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>

<!-- Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- Optional: Embed source files that are not tracked by the source control manager in the PDB -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<!-- Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="GUtils.StateMachines" Version="1.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\GParse\GParse.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
using GParse.IO;
using GUtils.Expressions;
using GUtils.StateMachines.Transducers;

namespace GParse.IO
namespace GParse.Extensions.StateMachines
{
/// <summary>
/// Represents a compiled <see cref="Transducer{InputT, OutputT}" /> that acts upon a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
using GParse.Lexing;
using GUtils.Expressions;
using GUtils.StateMachines.Transducers;

namespace GParse.Lexing
namespace GParse.Extensions.StateMachines
{
/// <summary>
/// Represents a compiled <see cref="Transducer{InputT, OutputT}" /> that accepts a
Expand All @@ -22,7 +23,7 @@ namespace GParse.Lexing
/// Extensions for a <see cref="Transducer{InputT, OutputT}" /> to work with a
/// <see cref="TokenReader{TokenTypeT}" />
/// </summary>
public static class TokenReaderTransducerExtensions
public static class ITokenReaderTransducerExtensions
{
/// <summary>
/// Attempts to execute the state machine against the <see cref="TokenReader{TokenTypeT}" />
Expand Down
23 changes: 23 additions & 0 deletions GParse.Extensions.StateMachines/RuleSet1.ruleset
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="New Rule Set" Description=" " ToolsVersion="15.0">
<Rules AnalyzerId="CodeCracker.CSharp" RuleNamespace="CodeCracker.CSharp">
<Rule Id="CC0001" Action="None" />
<Rule Id="CC0020" Action="Warning" />
<Rule Id="CC0061" Action="None" />
<Rule Id="CC0062" Action="None" />
<Rule Id="CC0084" Action="None" />
<Rule Id="CC0105" Action="None" />
</Rules>
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
<Rule Id="CA1001" Action="Warning" />
<Rule Id="CA1003" Action="Warning" />
<Rule Id="CA1011" Action="Warning" />
<Rule Id="CA1012" Action="Warning" />
<Rule Id="CA1013" Action="Warning" />
<Rule Id="CA1018" Action="Warning" />
<Rule Id="CA1019" Action="Warning" />
<Rule Id="CA1026" Action="Warning" />
<Rule Id="CA1027" Action="Warning" />
<Rule Id="CA1036" Action="Warning" />
</Rules>
</RuleSet>
13 changes: 13 additions & 0 deletions GParse.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GParse", "GParse\GParse.csp
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GParse.Tests", "GParse.Tests\GParse.Tests.csproj", "{A039DA83-6047-4393-8B5A-E17F951C1A34}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GParse.Extensions.StateMachines", "GParse.Extensions.StateMachines\GParse.Extensions.StateMachines.csproj", "{D084CA66-CAEC-4A00-9D32-2CFCE44BC52E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GParse.Extensions.StateMachines.Tests", "GParse.Extensions.StateMachines.Tests\GParse.Extensions.StateMachines.Tests.csproj", "{75DC45BE-CCB5-4360-B450-C80F341BE7C1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -33,12 +37,21 @@ Global
{A039DA83-6047-4393-8B5A-E17F951C1A34}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A039DA83-6047-4393-8B5A-E17F951C1A34}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A039DA83-6047-4393-8B5A-E17F951C1A34}.Release|Any CPU.Build.0 = Release|Any CPU
{D084CA66-CAEC-4A00-9D32-2CFCE44BC52E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D084CA66-CAEC-4A00-9D32-2CFCE44BC52E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D084CA66-CAEC-4A00-9D32-2CFCE44BC52E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D084CA66-CAEC-4A00-9D32-2CFCE44BC52E}.Release|Any CPU.Build.0 = Release|Any CPU
{75DC45BE-CCB5-4360-B450-C80F341BE7C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{75DC45BE-CCB5-4360-B450-C80F341BE7C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75DC45BE-CCB5-4360-B450-C80F341BE7C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75DC45BE-CCB5-4360-B450-C80F341BE7C1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{A039DA83-6047-4393-8B5A-E17F951C1A34} = {6E9DF038-0FDC-406E-9754-0D09C728DC2A}
{75DC45BE-CCB5-4360-B450-C80F341BE7C1} = {6E9DF038-0FDC-406E-9754-0D09C728DC2A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9367AB81-F9E2-4379-8FFF-A716EEB4F9F8}
Expand Down
3 changes: 1 addition & 2 deletions GParse/GParse.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<CodeAnalysisRuleSet>RuleSet1.ruleset</CodeAnalysisRuleSet>
<Authors>GGG KILLER</Authors>
<Description>Parsing and lexing utilities to create your own parser and lexer</Description>
<Copyright>GGG KILLER © 2018</Copyright>
<Copyright>GGG KILLER © 2020</Copyright>
<PackageLicenseUrl></PackageLicenseUrl>
<PackageProjectUrl>https://github.com/GGG-KILLER/GParse</PackageProjectUrl>
<RepositoryUrl>https://github.com/GGG-KILLER/GParse</RepositoryUrl>
Expand All @@ -27,7 +27,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="GUtils.StateMachines" Version="1.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down

0 comments on commit 96228d5

Please sign in to comment.