forked from jasder/antlr
Merge pull request #4 from antlr/visual-studio-support
visual studio support
This commit is contained in:
commit
eb0686ca8e
|
@ -1,6 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<configuration>
|
|
||||||
<solution>
|
|
||||||
<add key="disableSourceControlIntegration" value="true" />
|
|
||||||
</solution>
|
|
||||||
</configuration>
|
|
|
@ -1,101 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
|
|
||||||
|
|
||||||
<!-- Enable the restore command to run before builds -->
|
|
||||||
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>
|
|
||||||
|
|
||||||
<!-- Property that enables building a package from a project -->
|
|
||||||
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
|
|
||||||
|
|
||||||
<!-- Determines if package restore consent is required to restore packages -->
|
|
||||||
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup Condition=" '$(PackageSources)' == '' ">
|
|
||||||
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
|
|
||||||
<!-- The official NuGet package source (https://www.nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
|
|
||||||
<!--
|
|
||||||
<PackageSource Include="https://www.nuget.org/api/v2/" />
|
|
||||||
<PackageSource Include="https://my-nuget-source/nuget/" />
|
|
||||||
-->
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
|
|
||||||
<!-- Windows specific commands -->
|
|
||||||
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
|
|
||||||
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
|
|
||||||
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<PackagesProjectConfig>packages.$(MSBuildProjectName).config</PackagesProjectConfig>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<Choose>
|
|
||||||
<When Condition="Exists('$(PackagesProjectConfig)')">
|
|
||||||
<PropertyGroup>
|
|
||||||
<PackagesConfig>$(PackagesProjectConfig)</PackagesConfig>
|
|
||||||
</PropertyGroup>
|
|
||||||
</When>
|
|
||||||
<When Condition="Exists('packages.config')">
|
|
||||||
<PropertyGroup>
|
|
||||||
<PackagesConfig>packages.config</PackagesConfig>
|
|
||||||
</PropertyGroup>
|
|
||||||
</When>
|
|
||||||
</Choose>
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<!-- NuGet command -->
|
|
||||||
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
|
|
||||||
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
|
|
||||||
|
|
||||||
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
|
|
||||||
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>
|
|
||||||
|
|
||||||
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
|
|
||||||
|
|
||||||
<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
|
|
||||||
<NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>
|
|
||||||
|
|
||||||
<PaddedSolutionDir Condition=" '$(OS)' == 'Windows_NT'">"$(SolutionDir) "</PaddedSolutionDir>
|
|
||||||
<PaddedSolutionDir Condition=" '$(OS)' != 'Windows_NT' ">"$(SolutionDir)"</PaddedSolutionDir>
|
|
||||||
|
|
||||||
<!-- Commands -->
|
|
||||||
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)</RestoreCommand>
|
|
||||||
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
|
|
||||||
|
|
||||||
<!-- We need to ensure packages are restored prior to assembly resolve -->
|
|
||||||
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
|
|
||||||
RestorePackages;
|
|
||||||
$(BuildDependsOn);
|
|
||||||
</BuildDependsOn>
|
|
||||||
|
|
||||||
<!-- Make the build depend on restore packages -->
|
|
||||||
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
|
|
||||||
$(BuildDependsOn);
|
|
||||||
BuildPackage;
|
|
||||||
</BuildDependsOn>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<Target Name="RestorePackages">
|
|
||||||
<Message Text="$(PackagesProjectConfig)"/>
|
|
||||||
<Exec Command="$(RestoreCommand)"
|
|
||||||
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
|
|
||||||
|
|
||||||
<Exec Command="$(RestoreCommand)"
|
|
||||||
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<Target Name="BuildPackage">
|
|
||||||
<Exec Command="$(BuildCommand)"
|
|
||||||
Condition=" '$(OS)' != 'Windows_NT' " />
|
|
||||||
|
|
||||||
<Exec Command="$(BuildCommand)"
|
|
||||||
Condition=" '$(OS)' == 'Windows_NT' " />
|
|
||||||
</Target>
|
|
||||||
</Project>
|
|
Binary file not shown.
|
@ -1,151 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
|
|
||||||
|
|
||||||
<!-- Enable the restore command to run before builds -->
|
|
||||||
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>
|
|
||||||
|
|
||||||
<!-- Property that enables building a package from a project -->
|
|
||||||
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
|
|
||||||
|
|
||||||
<!-- Determines if package restore consent is required to restore packages -->
|
|
||||||
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>
|
|
||||||
|
|
||||||
<!-- Download NuGet.exe if it does not already exist -->
|
|
||||||
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup Condition=" '$(PackageSources)' == '' ">
|
|
||||||
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
|
|
||||||
<!-- The official NuGet package source (https://www.nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
|
|
||||||
<!--
|
|
||||||
<PackageSource Include="https://www.nuget.org/api/v2/" />
|
|
||||||
<PackageSource Include="https://my-nuget-source/nuget/" />
|
|
||||||
-->
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
|
|
||||||
<!-- Windows specific commands -->
|
|
||||||
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
|
|
||||||
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
|
|
||||||
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<PackagesProjectConfig>packages.$(MSBuildProjectName.Replace(' ', '_')).config</PackagesProjectConfig>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<Choose>
|
|
||||||
<When Condition="Exists('$(PackagesProjectConfig)')">
|
|
||||||
<PropertyGroup>
|
|
||||||
<PackagesConfig>$(PackagesProjectConfig)</PackagesConfig>
|
|
||||||
</PropertyGroup>
|
|
||||||
</When>
|
|
||||||
<When Condition="Exists('packages.config')">
|
|
||||||
<PropertyGroup>
|
|
||||||
<PackagesConfig>packages.config</PackagesConfig>
|
|
||||||
</PropertyGroup>
|
|
||||||
</When>
|
|
||||||
</Choose>
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<!-- NuGet command -->
|
|
||||||
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
|
|
||||||
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
|
|
||||||
|
|
||||||
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
|
|
||||||
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>
|
|
||||||
|
|
||||||
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
|
|
||||||
|
|
||||||
<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
|
|
||||||
<NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>
|
|
||||||
|
|
||||||
<PaddedSolutionDir Condition=" '$(OS)' == 'Windows_NT'">"$(SolutionDir) "</PaddedSolutionDir>
|
|
||||||
<PaddedSolutionDir Condition=" '$(OS)' != 'Windows_NT' ">"$(SolutionDir)"</PaddedSolutionDir>
|
|
||||||
|
|
||||||
<!-- Commands -->
|
|
||||||
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)</RestoreCommand>
|
|
||||||
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
|
|
||||||
|
|
||||||
<!-- We need to ensure packages are restored prior to assembly resolve -->
|
|
||||||
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
|
|
||||||
RestorePackages;
|
|
||||||
$(BuildDependsOn);
|
|
||||||
</BuildDependsOn>
|
|
||||||
|
|
||||||
<!-- Make the build depend on restore packages -->
|
|
||||||
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
|
|
||||||
$(BuildDependsOn);
|
|
||||||
BuildPackage;
|
|
||||||
</BuildDependsOn>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<Target Name="CheckPrerequisites">
|
|
||||||
<!-- Raise an error if we're unable to locate nuget.exe -->
|
|
||||||
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
|
|
||||||
<!--
|
|
||||||
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
|
|
||||||
This effectively acts as a lock that makes sure that the download operation will only happen once and all
|
|
||||||
parallel builds will have to wait for it to complete.
|
|
||||||
-->
|
|
||||||
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<Target Name="_DownloadNuGet">
|
|
||||||
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
|
|
||||||
<Exec Command="$(RestoreCommand)"
|
|
||||||
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
|
|
||||||
|
|
||||||
<Exec Command="$(RestoreCommand)"
|
|
||||||
LogStandardErrorAsError="true"
|
|
||||||
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
|
|
||||||
<Exec Command="$(BuildCommand)"
|
|
||||||
Condition=" '$(OS)' != 'Windows_NT' " />
|
|
||||||
|
|
||||||
<Exec Command="$(BuildCommand)"
|
|
||||||
LogStandardErrorAsError="true"
|
|
||||||
Condition=" '$(OS)' == 'Windows_NT' " />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
|
|
||||||
<ParameterGroup>
|
|
||||||
<OutputFilename ParameterType="System.String" Required="true" />
|
|
||||||
</ParameterGroup>
|
|
||||||
<Task>
|
|
||||||
<Reference Include="System.Core" />
|
|
||||||
<Using Namespace="System" />
|
|
||||||
<Using Namespace="System.IO" />
|
|
||||||
<Using Namespace="System.Net" />
|
|
||||||
<Using Namespace="Microsoft.Build.Framework" />
|
|
||||||
<Using Namespace="Microsoft.Build.Utilities" />
|
|
||||||
<Code Type="Fragment" Language="cs">
|
|
||||||
<![CDATA[
|
|
||||||
try {
|
|
||||||
OutputFilename = Path.GetFullPath(OutputFilename);
|
|
||||||
|
|
||||||
Log.LogMessage("Downloading latest version of NuGet.exe...");
|
|
||||||
WebClient webClient = new WebClient();
|
|
||||||
webClient.DownloadFile("https://www.nuget.org/nuget.exe", OutputFilename);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
catch (Exception ex) {
|
|
||||||
Log.LogErrorFromException(ex);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
]]>
|
|
||||||
</Code>
|
|
||||||
</Task>
|
|
||||||
</UsingTask>
|
|
||||||
</Project>
|
|
|
@ -1,127 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.props" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{0A4681C4-1248-4ACD-B59F-D6CC17CC2B4C}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>Antlr4.Runtime.Test</RootNamespace>
|
|
||||||
<AssemblyName>Antlr4.Runtime.Test.net20</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
|
||||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
|
||||||
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
|
|
||||||
<IsCodedUITest>False</IsCodedUITest>
|
|
||||||
<TestProjectType>UnitTest</TestProjectType>
|
|
||||||
<BaseIntermediateOutputPath>obj\net20\</BaseIntermediateOutputPath>
|
|
||||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
|
||||||
<RestorePackages>true</RestorePackages>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\net20\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE;NET20;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\net20\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE;NET20;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<SignAssembly>true</SignAssembly>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<AssemblyOriginatorKeyFile>TestingKey.snk</AssemblyOriginatorKeyFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="System" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Choose>
|
|
||||||
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
|
||||||
</ItemGroup>
|
|
||||||
</When>
|
|
||||||
<Otherwise>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Otherwise>
|
|
||||||
</Choose>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="BaseTest.cs" />
|
|
||||||
<Compile Include="JavaUnicodeInputStream.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
<Compile Include="Sharpen\Checksum.cs" />
|
|
||||||
<Compile Include="Sharpen\CRC32.cs" />
|
|
||||||
<Compile Include="TestBitSet.cs" />
|
|
||||||
<Compile Include="TestGraphNodes.cs" />
|
|
||||||
<Compile Include="TestIntervalSet.cs" />
|
|
||||||
<Compile Include="TestPerformance.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Antlr4.Runtime\Antlr4.Runtime.net20.csproj">
|
|
||||||
<Project>{e1a46d9d-66cb-46e8-93b0-7fc87299abef}</Project>
|
|
||||||
<Name>Antlr4.Runtime.net20</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="Java-LR.g4" />
|
|
||||||
<EmbeddedResource Include="Java.g4" />
|
|
||||||
<Antlr4 Include="Java.g4" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="packages.Antlr4.Runtime.Test.net20.config" />
|
|
||||||
<None Include="TestingKey.snk" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Choose>
|
|
||||||
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
|
||||||
</When>
|
|
||||||
</Choose>
|
|
||||||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.props'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.targets'))" />
|
|
||||||
</Target>
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.targets" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
|
@ -1,127 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.props" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{8A2F2331-A4A5-4C7F-8D5D-DEECEF54AEA7}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>Antlr4.Runtime.Test</RootNamespace>
|
|
||||||
<AssemblyName>Antlr4.Runtime.Test.net30</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
|
||||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
|
||||||
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
|
|
||||||
<IsCodedUITest>False</IsCodedUITest>
|
|
||||||
<TestProjectType>UnitTest</TestProjectType>
|
|
||||||
<BaseIntermediateOutputPath>obj\net30\</BaseIntermediateOutputPath>
|
|
||||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
|
||||||
<RestorePackages>true</RestorePackages>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\net30\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE;NET30;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\net30\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE;NET30;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<SignAssembly>true</SignAssembly>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<AssemblyOriginatorKeyFile>TestingKey.snk</AssemblyOriginatorKeyFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="System" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Choose>
|
|
||||||
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
|
||||||
</ItemGroup>
|
|
||||||
</When>
|
|
||||||
<Otherwise>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Otherwise>
|
|
||||||
</Choose>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="BaseTest.cs" />
|
|
||||||
<Compile Include="JavaUnicodeInputStream.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
<Compile Include="Sharpen\Checksum.cs" />
|
|
||||||
<Compile Include="Sharpen\CRC32.cs" />
|
|
||||||
<Compile Include="TestBitSet.cs" />
|
|
||||||
<Compile Include="TestGraphNodes.cs" />
|
|
||||||
<Compile Include="TestIntervalSet.cs" />
|
|
||||||
<Compile Include="TestPerformance.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Antlr4.Runtime\Antlr4.Runtime.net30.csproj">
|
|
||||||
<Project>{ebbdcc35-43cc-416c-860b-9fc115f1eb42}</Project>
|
|
||||||
<Name>Antlr4.Runtime.net30</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="Java-LR.g4" />
|
|
||||||
<EmbeddedResource Include="Java.g4" />
|
|
||||||
<Antlr4 Include="Java.g4" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="packages.Antlr4.Runtime.Test.net30.config" />
|
|
||||||
<None Include="TestingKey.snk" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Choose>
|
|
||||||
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
|
||||||
</When>
|
|
||||||
</Choose>
|
|
||||||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.props'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.targets'))" />
|
|
||||||
</Target>
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.targets" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
|
@ -1,127 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.props" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{C4A38390-8AA3-45AE-9A70-C392146B37D0}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>Antlr4.Runtime.Test</RootNamespace>
|
|
||||||
<AssemblyName>Antlr4.Runtime.Test.net35_client</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
|
||||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
|
||||||
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
|
|
||||||
<IsCodedUITest>False</IsCodedUITest>
|
|
||||||
<TestProjectType>UnitTest</TestProjectType>
|
|
||||||
<BaseIntermediateOutputPath>obj\net35\</BaseIntermediateOutputPath>
|
|
||||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
|
||||||
<RestorePackages>true</RestorePackages>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\net35\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE;NET35;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\net35\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE;NET35;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<SignAssembly>true</SignAssembly>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<AssemblyOriginatorKeyFile>TestingKey.snk</AssemblyOriginatorKeyFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="System" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Choose>
|
|
||||||
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
|
||||||
</ItemGroup>
|
|
||||||
</When>
|
|
||||||
<Otherwise>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Otherwise>
|
|
||||||
</Choose>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="BaseTest.cs" />
|
|
||||||
<Compile Include="JavaUnicodeInputStream.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
<Compile Include="Sharpen\Checksum.cs" />
|
|
||||||
<Compile Include="Sharpen\CRC32.cs" />
|
|
||||||
<Compile Include="TestBitSet.cs" />
|
|
||||||
<Compile Include="TestGraphNodes.cs" />
|
|
||||||
<Compile Include="TestIntervalSet.cs" />
|
|
||||||
<Compile Include="TestPerformance.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Antlr4.Runtime\Antlr4.Runtime.net35-client.csproj">
|
|
||||||
<Project>{e186fda3-1411-47ee-94c7-9f3745f0474b}</Project>
|
|
||||||
<Name>Antlr4.Runtime.net35-client</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="Java-LR.g4" />
|
|
||||||
<EmbeddedResource Include="Java.g4" />
|
|
||||||
<Antlr4 Include="Java.g4" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="packages.Antlr4.Runtime.Test.net35-client.config" />
|
|
||||||
<None Include="TestingKey.snk" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Choose>
|
|
||||||
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
|
||||||
</When>
|
|
||||||
</Choose>
|
|
||||||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.props'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.targets'))" />
|
|
||||||
</Target>
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.targets" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
|
@ -1,128 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.props" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{706D364A-CD4E-4720-B94C-0DB82AF7B433}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>Antlr4.Runtime.Test</RootNamespace>
|
|
||||||
<AssemblyName>Antlr4.Runtime.Test.net40_client</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
|
||||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
|
||||||
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
|
|
||||||
<IsCodedUITest>False</IsCodedUITest>
|
|
||||||
<TestProjectType>UnitTest</TestProjectType>
|
|
||||||
<BaseIntermediateOutputPath>obj\net40\</BaseIntermediateOutputPath>
|
|
||||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
|
||||||
<RestorePackages>true</RestorePackages>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\net40\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE;NET40;NET40PLUS;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\net40\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE;NET40;NET40PLUS;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<SignAssembly>true</SignAssembly>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<AssemblyOriginatorKeyFile>TestingKey.snk</AssemblyOriginatorKeyFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="System" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Choose>
|
|
||||||
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
|
||||||
</ItemGroup>
|
|
||||||
</When>
|
|
||||||
<Otherwise>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Otherwise>
|
|
||||||
</Choose>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="BaseTest.cs" />
|
|
||||||
<Compile Include="JavaUnicodeInputStream.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
<Compile Include="Sharpen\Checksum.cs" />
|
|
||||||
<Compile Include="Sharpen\CRC32.cs" />
|
|
||||||
<Compile Include="TaskSchedulers\QueuedTaskScheduler.cs" />
|
|
||||||
<Compile Include="TestBitSet.cs" />
|
|
||||||
<Compile Include="TestGraphNodes.cs" />
|
|
||||||
<Compile Include="TestIntervalSet.cs" />
|
|
||||||
<Compile Include="TestPerformance.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Antlr4.Runtime\Antlr4.Runtime.net40-client.csproj">
|
|
||||||
<Project>{423978df-85a4-409e-a16c-453683fe3969}</Project>
|
|
||||||
<Name>Antlr4.Runtime.net40-client</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="Java-LR.g4" />
|
|
||||||
<EmbeddedResource Include="Java.g4" />
|
|
||||||
<Antlr4 Include="Java.g4" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="packages.Antlr4.Runtime.Test.net40-client.config" />
|
|
||||||
<None Include="TestingKey.snk" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Choose>
|
|
||||||
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
|
||||||
</When>
|
|
||||||
</Choose>
|
|
||||||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.props'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.targets'))" />
|
|
||||||
</Target>
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.targets" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
|
@ -1,128 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.props" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{9D8C43DF-71F9-4CC9-83AD-A39FAEBCECA0}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>Antlr4.Runtime.Test</RootNamespace>
|
|
||||||
<AssemblyName>Antlr4.Runtime.Test.net45</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
|
||||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
|
||||||
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
|
|
||||||
<IsCodedUITest>False</IsCodedUITest>
|
|
||||||
<TestProjectType>UnitTest</TestProjectType>
|
|
||||||
<BaseIntermediateOutputPath>obj\net45\</BaseIntermediateOutputPath>
|
|
||||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
|
||||||
<RestorePackages>true</RestorePackages>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\net45\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE;NET45;NET45PLUS;NET40PLUS;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\net45\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE;NET45;NET45PLUS;NET40PLUS;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<SignAssembly>true</SignAssembly>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<AssemblyOriginatorKeyFile>TestingKey.snk</AssemblyOriginatorKeyFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="System" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Choose>
|
|
||||||
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
|
||||||
</ItemGroup>
|
|
||||||
</When>
|
|
||||||
<Otherwise>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Otherwise>
|
|
||||||
</Choose>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="BaseTest.cs" />
|
|
||||||
<Compile Include="JavaUnicodeInputStream.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
<Compile Include="Sharpen\Checksum.cs" />
|
|
||||||
<Compile Include="Sharpen\CRC32.cs" />
|
|
||||||
<Compile Include="TaskSchedulers\QueuedTaskScheduler.cs" />
|
|
||||||
<Compile Include="TestBitSet.cs" />
|
|
||||||
<Compile Include="TestGraphNodes.cs" />
|
|
||||||
<Compile Include="TestIntervalSet.cs" />
|
|
||||||
<Compile Include="TestPerformance.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Antlr4.Runtime\Antlr4.Runtime.net45.csproj">
|
|
||||||
<Project>{e1d192de-5347-48c4-a9f4-a8cba2af3869}</Project>
|
|
||||||
<Name>Antlr4.Runtime.net45</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="Java-LR.g4" />
|
|
||||||
<EmbeddedResource Include="Java.g4" />
|
|
||||||
<Antlr4 Include="Java.g4" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="packages.Antlr4.Runtime.Test.net45.config" />
|
|
||||||
<None Include="TestingKey.snk" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Choose>
|
|
||||||
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
|
||||||
</When>
|
|
||||||
</Choose>
|
|
||||||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.props'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.targets'))" />
|
|
||||||
</Target>
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.targets" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
|
@ -1,128 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.props" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{97C32E42-51B2-4A29-B005-769B63CFEFCA}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>Antlr4.Runtime.Test</RootNamespace>
|
|
||||||
<AssemblyName>Antlr4.Runtime.Test.portable_net40</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
|
||||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
|
||||||
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
|
|
||||||
<IsCodedUITest>False</IsCodedUITest>
|
|
||||||
<TestProjectType>UnitTest</TestProjectType>
|
|
||||||
<BaseIntermediateOutputPath>obj\portable-net40\</BaseIntermediateOutputPath>
|
|
||||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
|
||||||
<RestorePackages>true</RestorePackages>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\portable-net40\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE;PORTABLE;NET40;NET40PLUS;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\portable-net40\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE;PORTABLE;NET40;NET40PLUS;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<SignAssembly>true</SignAssembly>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<AssemblyOriginatorKeyFile>TestingKey.snk</AssemblyOriginatorKeyFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="System" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Choose>
|
|
||||||
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
|
||||||
</ItemGroup>
|
|
||||||
</When>
|
|
||||||
<Otherwise>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Otherwise>
|
|
||||||
</Choose>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="BaseTest.cs" />
|
|
||||||
<Compile Include="JavaUnicodeInputStream.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
<Compile Include="Sharpen\Checksum.cs" />
|
|
||||||
<Compile Include="Sharpen\CRC32.cs" />
|
|
||||||
<Compile Include="TaskSchedulers\QueuedTaskScheduler.cs" />
|
|
||||||
<Compile Include="TestBitSet.cs" />
|
|
||||||
<Compile Include="TestGraphNodes.cs" />
|
|
||||||
<Compile Include="TestIntervalSet.cs" />
|
|
||||||
<Compile Include="TestPerformance.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Antlr4.Runtime\Antlr4.Runtime.portable-net40.csproj">
|
|
||||||
<Project>{06c182c5-095c-4d43-9c33-c87e305c6bc2}</Project>
|
|
||||||
<Name>Antlr4.Runtime.portable-net40</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="Java-LR.g4" />
|
|
||||||
<EmbeddedResource Include="Java.g4" />
|
|
||||||
<Antlr4 Include="Java.g4" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="packages.Antlr4.Runtime.Test.portable-net40.config" />
|
|
||||||
<None Include="TestingKey.snk" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Choose>
|
|
||||||
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
|
||||||
</When>
|
|
||||||
</Choose>
|
|
||||||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.props'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.targets'))" />
|
|
||||||
</Target>
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.targets" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
|
@ -1,128 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.props" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{5844076E-3C92-4122-BB7A-0D745C3F5334}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>Antlr4.Runtime.Test</RootNamespace>
|
|
||||||
<AssemblyName>Antlr4.Runtime.Test.portable_net45</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
|
||||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
|
||||||
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
|
|
||||||
<IsCodedUITest>False</IsCodedUITest>
|
|
||||||
<TestProjectType>UnitTest</TestProjectType>
|
|
||||||
<BaseIntermediateOutputPath>obj\portable-net45\</BaseIntermediateOutputPath>
|
|
||||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
|
||||||
<RestorePackages>true</RestorePackages>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\portable-net45\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE;PORTABLE;NET45;NET45PLUS;NET40PLUS;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\portable-net45\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE;PORTABLE;NET45;NET45PLUS;NET40PLUS;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<SignAssembly>true</SignAssembly>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<AssemblyOriginatorKeyFile>TestingKey.snk</AssemblyOriginatorKeyFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="System" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Choose>
|
|
||||||
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
|
||||||
</ItemGroup>
|
|
||||||
</When>
|
|
||||||
<Otherwise>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Otherwise>
|
|
||||||
</Choose>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="BaseTest.cs" />
|
|
||||||
<Compile Include="JavaUnicodeInputStream.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
<Compile Include="Sharpen\Checksum.cs" />
|
|
||||||
<Compile Include="Sharpen\CRC32.cs" />
|
|
||||||
<Compile Include="TaskSchedulers\QueuedTaskScheduler.cs" />
|
|
||||||
<Compile Include="TestBitSet.cs" />
|
|
||||||
<Compile Include="TestGraphNodes.cs" />
|
|
||||||
<Compile Include="TestIntervalSet.cs" />
|
|
||||||
<Compile Include="TestPerformance.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Antlr4.Runtime\Antlr4.Runtime.portable-net45.csproj">
|
|
||||||
<Project>{12269283-ee92-4faa-b849-53cd24f341fa}</Project>
|
|
||||||
<Name>Antlr4.Runtime.portable-net45</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="Java-LR.g4" />
|
|
||||||
<EmbeddedResource Include="Java.g4" />
|
|
||||||
<Antlr4 Include="Java.g4" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="packages.Antlr4.Runtime.Test.portable-net45.config" />
|
|
||||||
<None Include="TestingKey.snk" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Choose>
|
|
||||||
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
|
||||||
</When>
|
|
||||||
</Choose>
|
|
||||||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.props'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.targets'))" />
|
|
||||||
</Target>
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.targets" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,272 +0,0 @@
|
||||||
namespace Antlr4.Runtime.Test
|
|
||||||
{
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using Antlr4.Runtime.Misc;
|
|
||||||
|
|
||||||
public class JavaUnicodeInputStream : ICharStream
|
|
||||||
{
|
|
||||||
[NotNull]
|
|
||||||
private readonly ICharStream _source;
|
|
||||||
private readonly List<int> _escapeIndexes = new List<int>();
|
|
||||||
private readonly List<int> _escapeCharacters = new List<int>();
|
|
||||||
private readonly List<int> _escapeIndirectionLevels = new List<int>();
|
|
||||||
|
|
||||||
private int _escapeListIndex;
|
|
||||||
private int _range;
|
|
||||||
private int _slashCount;
|
|
||||||
|
|
||||||
private int _la1;
|
|
||||||
|
|
||||||
public JavaUnicodeInputStream([NotNull] ICharStream source)
|
|
||||||
{
|
|
||||||
if (source == null)
|
|
||||||
throw new ArgumentNullException("source");
|
|
||||||
|
|
||||||
this._source = source;
|
|
||||||
this._la1 = source.La(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int Size
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _source.Size;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int Index
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _source.Index;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string SourceName
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _source.SourceName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String GetText(Interval interval)
|
|
||||||
{
|
|
||||||
return _source.GetText(interval);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Consume()
|
|
||||||
{
|
|
||||||
if (_la1 != '\\')
|
|
||||||
{
|
|
||||||
_source.Consume();
|
|
||||||
_la1 = _source.La(1);
|
|
||||||
_range = Math.Max(_range, _source.Index);
|
|
||||||
_slashCount = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// make sure the next character has been processed
|
|
||||||
this.La(1);
|
|
||||||
|
|
||||||
if (_escapeListIndex >= _escapeIndexes.Count || _escapeIndexes[_escapeListIndex] != Index)
|
|
||||||
{
|
|
||||||
_source.Consume();
|
|
||||||
_slashCount++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int indirectionLevel = _escapeIndirectionLevels[_escapeListIndex];
|
|
||||||
for (int i = 0; i < 6 + indirectionLevel; i++)
|
|
||||||
{
|
|
||||||
_source.Consume();
|
|
||||||
}
|
|
||||||
|
|
||||||
_escapeListIndex++;
|
|
||||||
_slashCount = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
_la1 = _source.La(1);
|
|
||||||
Debug.Assert(_range >= Index);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int La(int i)
|
|
||||||
{
|
|
||||||
if (i == 1 && _la1 != '\\')
|
|
||||||
{
|
|
||||||
return _la1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (i <= 0)
|
|
||||||
{
|
|
||||||
int desiredIndex = Index + i;
|
|
||||||
for (int j = _escapeListIndex - 1; j >= 0; j--)
|
|
||||||
{
|
|
||||||
if (_escapeIndexes[j] + 6 + _escapeIndirectionLevels[j] > desiredIndex)
|
|
||||||
{
|
|
||||||
desiredIndex -= 5 + _escapeIndirectionLevels[j];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_escapeIndexes[j] == desiredIndex)
|
|
||||||
{
|
|
||||||
return _escapeCharacters[j];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return _source.La(desiredIndex - Index);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int desiredIndex = Index + i - 1;
|
|
||||||
for (int j = _escapeListIndex; j < _escapeIndexes.Count; j++)
|
|
||||||
{
|
|
||||||
if (_escapeIndexes[j] == desiredIndex)
|
|
||||||
{
|
|
||||||
return _escapeCharacters[j];
|
|
||||||
}
|
|
||||||
else if (_escapeIndexes[j] < desiredIndex)
|
|
||||||
{
|
|
||||||
desiredIndex += 5 + _escapeIndirectionLevels[j];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return _source.La(desiredIndex - Index + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int currentIndex = Index;
|
|
||||||
int slashCount = _slashCount;
|
|
||||||
int indirectionLevel = 0;
|
|
||||||
for (int j = 0; j < i; j++)
|
|
||||||
{
|
|
||||||
int previousIndex = currentIndex;
|
|
||||||
int c = ReadCharAt(ref currentIndex, ref slashCount, ref indirectionLevel);
|
|
||||||
if (currentIndex > _range)
|
|
||||||
{
|
|
||||||
if (currentIndex - previousIndex > 1)
|
|
||||||
{
|
|
||||||
_escapeIndexes.Add(previousIndex);
|
|
||||||
_escapeCharacters.Add(c);
|
|
||||||
_escapeIndirectionLevels.Add(indirectionLevel);
|
|
||||||
}
|
|
||||||
|
|
||||||
_range = currentIndex;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (j == i - 1)
|
|
||||||
{
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new InvalidOperationException("shouldn't be reachable");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int Mark()
|
|
||||||
{
|
|
||||||
return _source.Mark();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Release(int marker)
|
|
||||||
{
|
|
||||||
_source.Release(marker);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Seek(int index)
|
|
||||||
{
|
|
||||||
if (index > _range)
|
|
||||||
{
|
|
||||||
throw new NotSupportedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
_source.Seek(index);
|
|
||||||
_la1 = _source.La(1);
|
|
||||||
|
|
||||||
_slashCount = 0;
|
|
||||||
while (_source.La(-_slashCount - 1) == '\\')
|
|
||||||
{
|
|
||||||
_slashCount++;
|
|
||||||
}
|
|
||||||
|
|
||||||
_escapeListIndex = _escapeIndexes.BinarySearch(_source.Index);
|
|
||||||
if (_escapeListIndex < 0)
|
|
||||||
{
|
|
||||||
_escapeListIndex = -_escapeListIndex - 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static bool IsHexDigit(int c)
|
|
||||||
{
|
|
||||||
return c >= '0' && c <= '9'
|
|
||||||
|| c >= 'a' && c <= 'f'
|
|
||||||
|| c >= 'A' && c <= 'F';
|
|
||||||
}
|
|
||||||
|
|
||||||
private static int HexValue(int c)
|
|
||||||
{
|
|
||||||
if (c >= '0' && c <= '9')
|
|
||||||
{
|
|
||||||
return c - '0';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (c >= 'a' && c <= 'f')
|
|
||||||
{
|
|
||||||
return c - 'a' + 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (c >= 'A' && c <= 'F')
|
|
||||||
{
|
|
||||||
return c - 'A' + 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new ArgumentException("c");
|
|
||||||
}
|
|
||||||
|
|
||||||
private int ReadCharAt(ref int nextIndex, ref int slashCount, ref int indirectionLevel)
|
|
||||||
{
|
|
||||||
bool blockUnicodeEscape = (slashCount % 2) != 0;
|
|
||||||
|
|
||||||
int c0 = _source.La(nextIndex - Index + 1);
|
|
||||||
if (c0 == '\\')
|
|
||||||
{
|
|
||||||
slashCount++;
|
|
||||||
|
|
||||||
if (!blockUnicodeEscape)
|
|
||||||
{
|
|
||||||
int c1 = _source.La(nextIndex - Index + 2);
|
|
||||||
if (c1 == 'u')
|
|
||||||
{
|
|
||||||
int c2 = _source.La(nextIndex - Index + 3);
|
|
||||||
indirectionLevel = 0;
|
|
||||||
while (c2 == 'u')
|
|
||||||
{
|
|
||||||
indirectionLevel++;
|
|
||||||
c2 = _source.La(nextIndex - Index + 3 + indirectionLevel);
|
|
||||||
}
|
|
||||||
|
|
||||||
int c3 = _source.La(nextIndex - Index + 4 + indirectionLevel);
|
|
||||||
int c4 = _source.La(nextIndex - Index + 5 + indirectionLevel);
|
|
||||||
int c5 = _source.La(nextIndex - Index + 6 + indirectionLevel);
|
|
||||||
if (IsHexDigit(c2) && IsHexDigit(c3) && IsHexDigit(c4) && IsHexDigit(c5))
|
|
||||||
{
|
|
||||||
int value = HexValue(c2);
|
|
||||||
value = (value << 4) + HexValue(c3);
|
|
||||||
value = (value << 4) + HexValue(c4);
|
|
||||||
value = (value << 4) + HexValue(c5);
|
|
||||||
|
|
||||||
nextIndex += 6 + indirectionLevel;
|
|
||||||
slashCount = 0;
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
nextIndex++;
|
|
||||||
return c0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,68 +0,0 @@
|
||||||
/*
|
|
||||||
* [The "BSD license"]
|
|
||||||
* Copyright (c) 2013 Terence Parr
|
|
||||||
* Copyright (c) 2013 Sam Harwell
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
||||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
||||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
|
||||||
// set of attributes. Change these attribute values to modify the information
|
|
||||||
// associated with an assembly.
|
|
||||||
[assembly: AssemblyTitle("Antlr4.Runtime.Test")]
|
|
||||||
[assembly: AssemblyDescription("")]
|
|
||||||
[assembly: AssemblyConfiguration("")]
|
|
||||||
[assembly: AssemblyCompany("Tunnel Vision Laboratories, LLC")]
|
|
||||||
[assembly: AssemblyProduct("Antlr4.Runtime.Test")]
|
|
||||||
[assembly: AssemblyCopyright("Copyright © Sam Harwell 2013")]
|
|
||||||
[assembly: AssemblyTrademark("")]
|
|
||||||
[assembly: AssemblyCulture("")]
|
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
|
||||||
// to COM components. If you need to access a type in this assembly from
|
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
|
||||||
[assembly: ComVisible(false)]
|
|
||||||
|
|
||||||
[assembly: CLSCompliant(false)]
|
|
||||||
|
|
||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|
||||||
[assembly: Guid("e88a6cd4-d62a-4a1b-a124-47f7fa10ad7e")]
|
|
||||||
|
|
||||||
// Version information for an assembly consists of the following four values:
|
|
||||||
//
|
|
||||||
// Major Version
|
|
||||||
// Minor Version
|
|
||||||
// Build Number
|
|
||||||
// Revision
|
|
||||||
//
|
|
||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
|
||||||
// by using the '*' as shown below:
|
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
|
@ -1,415 +0,0 @@
|
||||||
namespace Antlr4.Runtime.Sharpen
|
|
||||||
{
|
|
||||||
using System;
|
|
||||||
|
|
||||||
internal class CRC32 : Checksum
|
|
||||||
{
|
|
||||||
private uint _crc;
|
|
||||||
|
|
||||||
public long Value
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return (int)_crc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Reset()
|
|
||||||
{
|
|
||||||
_crc = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Update(byte[] buffer, int offset, int length)
|
|
||||||
{
|
|
||||||
if (buffer == null)
|
|
||||||
throw new ArgumentNullException("buffer");
|
|
||||||
if (offset < 0)
|
|
||||||
throw new ArgumentOutOfRangeException("offset");
|
|
||||||
if (length < 0)
|
|
||||||
throw new ArgumentOutOfRangeException("length");
|
|
||||||
if (offset > buffer.Length || length > buffer.Length || offset + length > buffer.Length)
|
|
||||||
throw new ArgumentException();
|
|
||||||
|
|
||||||
unsafe
|
|
||||||
{
|
|
||||||
fixed (byte* data = buffer)
|
|
||||||
{
|
|
||||||
_crc = crc32(_crc, data + offset, (uint)length);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Update(int byteValue)
|
|
||||||
{
|
|
||||||
byte value = (byte)byteValue;
|
|
||||||
unsafe
|
|
||||||
{
|
|
||||||
_crc = crc32(_crc, &value, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation. Oracle designates this
|
|
||||||
* particular file as subject to the "Classpath" exception as provided
|
|
||||||
* by Oracle in the LICENSE file that accompanied this code.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* crc32.c -- compute the CRC-32 of a data stream
|
|
||||||
* Copyright (C) 1995-2005 Mark Adler
|
|
||||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
|
||||||
*
|
|
||||||
* Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster
|
|
||||||
* CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing
|
|
||||||
* tables for updating the shift register in one step with three exclusive-ors
|
|
||||||
* instead of four steps with four exclusive-ors. This results in about a
|
|
||||||
* factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* @(#) $Id$ */
|
|
||||||
|
|
||||||
/*
|
|
||||||
Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore
|
|
||||||
protection on the static variables used to control the first-use generation
|
|
||||||
of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should
|
|
||||||
first call get_crc_table() to initialize the tables before allowing more than
|
|
||||||
one thread to use crc32().
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Definitions for doing the crc four data bytes at a time. */
|
|
||||||
|
|
||||||
private static uint REV(uint w)
|
|
||||||
{
|
|
||||||
return (w >> 24) + ((w >> 8) & 0xff00) + ((w & 0xff00) << 8) + ((w & 0xff) << 24);
|
|
||||||
}
|
|
||||||
|
|
||||||
private const uint TBLS = 8;
|
|
||||||
|
|
||||||
/* Local functions for crc concatenation */
|
|
||||||
|
|
||||||
private static readonly uint[][] crc_table;
|
|
||||||
|
|
||||||
static CRC32()
|
|
||||||
{
|
|
||||||
crc_table = new uint[TBLS][];
|
|
||||||
for (int i = 0; i < TBLS; i++)
|
|
||||||
crc_table[i] = new uint[256];
|
|
||||||
|
|
||||||
make_crc_table();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:
|
|
||||||
x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
|
|
||||||
|
|
||||||
Polynomials over GF(2) are represented in binary, one bit per coefficient,
|
|
||||||
with the lowest powers in the most significant bit. Then adding polynomials
|
|
||||||
is just exclusive-or, and multiplying a polynomial by x is a right shift by
|
|
||||||
one. If we call the above polynomial p, and represent a byte as the
|
|
||||||
polynomial q, also with the lowest power in the most significant bit (so the
|
|
||||||
byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
|
|
||||||
where a mod b means the remainder after dividing a by b.
|
|
||||||
|
|
||||||
This calculation is done using the shift-register method of multiplying and
|
|
||||||
taking the remainder. The register is initialized to zero, and for each
|
|
||||||
incoming bit, x^32 is added mod p to the register if the bit is a one (where
|
|
||||||
x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by
|
|
||||||
x (which is shifting right by one and adding x^32 mod p if the bit shifted
|
|
||||||
out is a one). We start with the highest power (least significant bit) of
|
|
||||||
q and repeat for all eight bits of q.
|
|
||||||
|
|
||||||
The first table is simply the CRC of all possible eight bit values. This is
|
|
||||||
all the information needed to generate CRCs on data a byte at a time for all
|
|
||||||
combinations of CRC register values and incoming bytes. The remaining tables
|
|
||||||
allow for word-at-a-time CRC calculation for both big-endian and little-
|
|
||||||
endian machines, where a word is four bytes.
|
|
||||||
*/
|
|
||||||
private static void make_crc_table()
|
|
||||||
{
|
|
||||||
/* terms of polynomial defining this crc (except x^32): */
|
|
||||||
byte[] p = { 0, 1, 2, 4, 5, 7, 8, 10, 11, 12, 16, 22, 23, 26 };
|
|
||||||
|
|
||||||
/* make exclusive-or pattern from polynomial (0xedb88320UL) */
|
|
||||||
uint poly = 0U;
|
|
||||||
for (int n = 0; n < p.Length; n++)
|
|
||||||
poly |= 1U << (31 - p[n]);
|
|
||||||
|
|
||||||
/* generate a crc for every 8-bit value */
|
|
||||||
for (int n = 0; n < 256; n++)
|
|
||||||
{
|
|
||||||
uint c = (uint)n;
|
|
||||||
for (int k = 0; k < 8; k++)
|
|
||||||
c = (c & 1) != 0 ? poly ^ (c >> 1) : c >> 1;
|
|
||||||
|
|
||||||
crc_table[0][n] = c;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* generate crc for each value followed by one, two, and three zeros,
|
|
||||||
and then the byte reversal of those as well as the first table */
|
|
||||||
for (int n = 0; n < 256; n++)
|
|
||||||
{
|
|
||||||
uint c = crc_table[0][n];
|
|
||||||
crc_table[4][n] = REV(c);
|
|
||||||
for (int k = 1; k < 4; k++)
|
|
||||||
{
|
|
||||||
c = crc_table[0][c & 0xff] ^ (c >> 8);
|
|
||||||
crc_table[k][n] = c;
|
|
||||||
crc_table[k + 4][n] = REV(c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* =========================================================================
|
|
||||||
* This function can be used by asm versions of crc32()
|
|
||||||
*/
|
|
||||||
private static uint[][] get_crc_table()
|
|
||||||
{
|
|
||||||
return crc_table;
|
|
||||||
}
|
|
||||||
|
|
||||||
///* ========================================================================= */
|
|
||||||
private static unsafe void DO1(ref uint crc, ref byte* buf)
|
|
||||||
{
|
|
||||||
crc = crc_table[0][(crc ^ (*buf++)) & 0xFF] ^ (crc >> 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static unsafe void DO8(ref uint crc, ref byte* buf)
|
|
||||||
{
|
|
||||||
DO1(ref crc, ref buf);
|
|
||||||
DO1(ref crc, ref buf);
|
|
||||||
DO1(ref crc, ref buf);
|
|
||||||
DO1(ref crc, ref buf);
|
|
||||||
DO1(ref crc, ref buf);
|
|
||||||
DO1(ref crc, ref buf);
|
|
||||||
DO1(ref crc, ref buf);
|
|
||||||
DO1(ref crc, ref buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========================================================================= */
|
|
||||||
private static unsafe uint crc32(uint crc, byte* buf, uint len)
|
|
||||||
{
|
|
||||||
if (buf == null)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (BitConverter.IsLittleEndian)
|
|
||||||
return (uint)crc32_little(crc, buf, len);
|
|
||||||
else
|
|
||||||
return (uint)crc32_big(crc, buf, len);
|
|
||||||
}
|
|
||||||
|
|
||||||
///* ========================================================================= */
|
|
||||||
private static unsafe void DOLIT4(ref uint c, ref uint* buf4)
|
|
||||||
{
|
|
||||||
c ^= *buf4++;
|
|
||||||
c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^
|
|
||||||
crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24];
|
|
||||||
}
|
|
||||||
|
|
||||||
private static unsafe void DOLIT32(ref uint c, ref uint* buf4)
|
|
||||||
{
|
|
||||||
DOLIT4(ref c, ref buf4);
|
|
||||||
DOLIT4(ref c, ref buf4);
|
|
||||||
DOLIT4(ref c, ref buf4);
|
|
||||||
DOLIT4(ref c, ref buf4);
|
|
||||||
DOLIT4(ref c, ref buf4);
|
|
||||||
DOLIT4(ref c, ref buf4);
|
|
||||||
DOLIT4(ref c, ref buf4);
|
|
||||||
DOLIT4(ref c, ref buf4);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========================================================================= */
|
|
||||||
private static unsafe uint crc32_little(uint crc, byte* buf, uint len)
|
|
||||||
{
|
|
||||||
uint c = (uint)crc;
|
|
||||||
c = ~c;
|
|
||||||
while (len != 0 && ((uint)buf & 3) != 0)
|
|
||||||
{
|
|
||||||
c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
|
|
||||||
len--;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint* buf4 = (uint*)buf;
|
|
||||||
while (len >= 32)
|
|
||||||
{
|
|
||||||
DOLIT32(ref c, ref buf4);
|
|
||||||
len -= 32;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (len >= 4)
|
|
||||||
{
|
|
||||||
DOLIT4(ref c, ref buf4);
|
|
||||||
len -= 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
buf = (byte*)buf4;
|
|
||||||
|
|
||||||
if (len != 0)
|
|
||||||
{
|
|
||||||
do
|
|
||||||
{
|
|
||||||
c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
|
|
||||||
} while (--len != 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
c = ~c;
|
|
||||||
return (uint)c;
|
|
||||||
}
|
|
||||||
|
|
||||||
///* ========================================================================= */
|
|
||||||
private static unsafe void DOBIG4(ref uint c, ref uint* buf4)
|
|
||||||
{
|
|
||||||
c ^= *++buf4;
|
|
||||||
c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^
|
|
||||||
crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24];
|
|
||||||
}
|
|
||||||
|
|
||||||
private static unsafe void DOBIG32(ref uint c, ref uint* buf4)
|
|
||||||
{
|
|
||||||
DOBIG4(ref c, ref buf4);
|
|
||||||
DOBIG4(ref c, ref buf4);
|
|
||||||
DOBIG4(ref c, ref buf4);
|
|
||||||
DOBIG4(ref c, ref buf4);
|
|
||||||
DOBIG4(ref c, ref buf4);
|
|
||||||
DOBIG4(ref c, ref buf4);
|
|
||||||
DOBIG4(ref c, ref buf4);
|
|
||||||
DOBIG4(ref c, ref buf4);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========================================================================= */
|
|
||||||
private static unsafe uint crc32_big(uint crc, byte* buf, uint len)
|
|
||||||
{
|
|
||||||
uint c;
|
|
||||||
uint* buf4;
|
|
||||||
|
|
||||||
c = REV((uint)crc);
|
|
||||||
c = ~c;
|
|
||||||
while (len != 0 && ((uint)buf & 3) != 0)
|
|
||||||
{
|
|
||||||
c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
|
|
||||||
len--;
|
|
||||||
}
|
|
||||||
|
|
||||||
buf4 = (uint*)buf;
|
|
||||||
buf4--;
|
|
||||||
while (len >= 32)
|
|
||||||
{
|
|
||||||
DOBIG32(ref c, ref buf4);
|
|
||||||
len -= 32;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (len >= 4)
|
|
||||||
{
|
|
||||||
DOBIG4(ref c, ref buf4);
|
|
||||||
len -= 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
buf4++;
|
|
||||||
buf = (byte*)buf4;
|
|
||||||
|
|
||||||
if (len != 0)
|
|
||||||
do
|
|
||||||
{
|
|
||||||
c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
|
|
||||||
} while (--len != 0);
|
|
||||||
c = ~c;
|
|
||||||
return (uint)(REV(c));
|
|
||||||
}
|
|
||||||
|
|
||||||
private const int GF2_DIM = 32; /* dimension of GF(2) vectors (length of CRC) */
|
|
||||||
|
|
||||||
/* ========================================================================= */
|
|
||||||
private static unsafe uint gf2_matrix_times(uint* mat, uint vec)
|
|
||||||
{
|
|
||||||
uint sum = 0;
|
|
||||||
while (vec != 0)
|
|
||||||
{
|
|
||||||
if ((vec & 1) != 0)
|
|
||||||
sum ^= *mat;
|
|
||||||
|
|
||||||
vec >>= 1;
|
|
||||||
mat++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return sum;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========================================================================= */
|
|
||||||
private static unsafe void gf2_matrix_square(uint* square, uint* mat)
|
|
||||||
{
|
|
||||||
for (int n = 0; n < GF2_DIM; n++)
|
|
||||||
square[n] = gf2_matrix_times(mat, mat[n]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========================================================================= */
|
|
||||||
private static unsafe uint crc32_combine(uint crc1, uint crc2, uint len2)
|
|
||||||
{
|
|
||||||
/* degenerate case */
|
|
||||||
if (len2 == 0)
|
|
||||||
return crc1;
|
|
||||||
|
|
||||||
uint* even = stackalloc uint[GF2_DIM]; /* even-power-of-two zeros operator */
|
|
||||||
uint* odd = stackalloc uint[GF2_DIM]; /* odd-power-of-two zeros operator */
|
|
||||||
|
|
||||||
/* put operator for one zero bit in odd */
|
|
||||||
odd[0] = 0xEDB88320U; /* CRC-32 polynomial */
|
|
||||||
uint row = 1;
|
|
||||||
for (int n = 1; n < GF2_DIM; n++)
|
|
||||||
{
|
|
||||||
odd[n] = row;
|
|
||||||
row <<= 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* put operator for two zero bits in even */
|
|
||||||
gf2_matrix_square(even, odd);
|
|
||||||
|
|
||||||
/* put operator for four zero bits in odd */
|
|
||||||
gf2_matrix_square(odd, even);
|
|
||||||
|
|
||||||
/* apply len2 zeros to crc1 (first square will put the operator for one
|
|
||||||
zero byte, eight zero bits, in even) */
|
|
||||||
do
|
|
||||||
{
|
|
||||||
/* apply zeros operator for this bit of len2 */
|
|
||||||
gf2_matrix_square(even, odd);
|
|
||||||
if ((len2 & 1) != 0)
|
|
||||||
crc1 = gf2_matrix_times(even, crc1);
|
|
||||||
|
|
||||||
len2 >>= 1;
|
|
||||||
|
|
||||||
/* if no more bits set, then done */
|
|
||||||
if (len2 == 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
/* another iteration of the loop with odd and even swapped */
|
|
||||||
gf2_matrix_square(odd, even);
|
|
||||||
if ((len2 & 1) != 0)
|
|
||||||
crc1 = gf2_matrix_times(odd, crc1);
|
|
||||||
|
|
||||||
len2 >>= 1;
|
|
||||||
|
|
||||||
/* if no more bits set, then done */
|
|
||||||
} while (len2 != 0);
|
|
||||||
|
|
||||||
/* return combined crc */
|
|
||||||
crc1 ^= crc2;
|
|
||||||
return crc1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
namespace Antlr4.Runtime.Sharpen
|
|
||||||
{
|
|
||||||
internal interface Checksum
|
|
||||||
{
|
|
||||||
long Value
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Reset();
|
|
||||||
|
|
||||||
void Update(byte[] buffer, int offset, int length);
|
|
||||||
|
|
||||||
void Update(int byteValue);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,612 +0,0 @@
|
||||||
//--------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
//
|
|
||||||
// File: QueuedTaskScheduler.cs
|
|
||||||
//
|
|
||||||
//--------------------------------------------------------------------------
|
|
||||||
|
|
||||||
using System.Collections.Concurrent;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace System.Threading.Tasks.Schedulers
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Provides a TaskScheduler that provides control over priorities, fairness, and the underlying threads utilized.
|
|
||||||
/// </summary>
|
|
||||||
[DebuggerTypeProxy(typeof(QueuedTaskSchedulerDebugView))]
|
|
||||||
[DebuggerDisplay("Id={Id}, Queues={DebugQueueCount}, ScheduledTasks = {DebugTaskCount}")]
|
|
||||||
public sealed class QueuedTaskScheduler : TaskScheduler, IDisposable
|
|
||||||
{
|
|
||||||
/// <summary>Debug view for the QueuedTaskScheduler.</summary>
|
|
||||||
private class QueuedTaskSchedulerDebugView
|
|
||||||
{
|
|
||||||
/// <summary>The scheduler.</summary>
|
|
||||||
private QueuedTaskScheduler _scheduler;
|
|
||||||
|
|
||||||
/// <summary>Initializes the debug view.</summary>
|
|
||||||
/// <param name="scheduler">The scheduler.</param>
|
|
||||||
public QueuedTaskSchedulerDebugView(QueuedTaskScheduler scheduler)
|
|
||||||
{
|
|
||||||
if (scheduler == null) throw new ArgumentNullException("scheduler");
|
|
||||||
_scheduler = scheduler;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Gets all of the Tasks queued to the scheduler directly.</summary>
|
|
||||||
public IEnumerable<Task> ScheduledTasks
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
var tasks = (_scheduler._targetScheduler != null) ?
|
|
||||||
(IEnumerable<Task>)_scheduler._nonthreadsafeTaskQueue :
|
|
||||||
(IEnumerable<Task>)_scheduler._blockingTaskQueue;
|
|
||||||
return tasks.Where(t => t != null).ToList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Gets the prioritized and fair queues.</summary>
|
|
||||||
public IEnumerable<TaskScheduler> Queues
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
List<TaskScheduler> queues = new List<TaskScheduler>();
|
|
||||||
foreach (var group in _scheduler._queueGroups) queues.AddRange(group.Value);
|
|
||||||
return queues;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// A sorted list of round-robin queue lists. Tasks with the smallest priority value
|
|
||||||
/// are preferred. Priority groups are round-robin'd through in order of priority.
|
|
||||||
/// </summary>
|
|
||||||
private readonly SortedList<int, QueueGroup> _queueGroups = new SortedList<int, QueueGroup>();
|
|
||||||
/// <summary>Cancellation token used for disposal.</summary>
|
|
||||||
private readonly CancellationTokenSource _disposeCancellation = new CancellationTokenSource();
|
|
||||||
/// <summary>
|
|
||||||
/// The maximum allowed concurrency level of this scheduler. If custom threads are
|
|
||||||
/// used, this represents the number of created threads.
|
|
||||||
/// </summary>
|
|
||||||
private readonly int _concurrencyLevel;
|
|
||||||
/// <summary>Whether we're processing tasks on the current thread.</summary>
|
|
||||||
private static ThreadLocal<bool> _taskProcessingThread = new ThreadLocal<bool>();
|
|
||||||
|
|
||||||
// ***
|
|
||||||
// *** For when using a target scheduler
|
|
||||||
// ***
|
|
||||||
|
|
||||||
/// <summary>The scheduler onto which actual work is scheduled.</summary>
|
|
||||||
private readonly TaskScheduler _targetScheduler;
|
|
||||||
/// <summary>The queue of tasks to process when using an underlying target scheduler.</summary>
|
|
||||||
private readonly Queue<Task> _nonthreadsafeTaskQueue;
|
|
||||||
/// <summary>The number of Tasks that have been queued or that are running whiel using an underlying scheduler.</summary>
|
|
||||||
private int _delegatesQueuedOrRunning = 0;
|
|
||||||
|
|
||||||
// ***
|
|
||||||
// *** For when using our own threads
|
|
||||||
// ***
|
|
||||||
|
|
||||||
/// <summary>The threads used by the scheduler to process work.</summary>
|
|
||||||
private readonly Thread[] _threads;
|
|
||||||
/// <summary>The collection of tasks to be executed on our custom threads.</summary>
|
|
||||||
private readonly BlockingCollection<Task> _blockingTaskQueue;
|
|
||||||
|
|
||||||
// ***
|
|
||||||
|
|
||||||
/// <summary>Initializes the scheduler.</summary>
|
|
||||||
public QueuedTaskScheduler() : this(TaskScheduler.Default, 0) { }
|
|
||||||
|
|
||||||
/// <summary>Initializes the scheduler.</summary>
|
|
||||||
/// <param name="targetScheduler">The target underlying scheduler onto which this sceduler's work is queued.</param>
|
|
||||||
public QueuedTaskScheduler(TaskScheduler targetScheduler) : this(targetScheduler, 0) { }
|
|
||||||
|
|
||||||
/// <summary>Initializes the scheduler.</summary>
|
|
||||||
/// <param name="targetScheduler">The target underlying scheduler onto which this sceduler's work is queued.</param>
|
|
||||||
/// <param name="maxConcurrencyLevel">The maximum degree of concurrency allowed for this scheduler's work.</param>
|
|
||||||
public QueuedTaskScheduler(
|
|
||||||
TaskScheduler targetScheduler,
|
|
||||||
int maxConcurrencyLevel)
|
|
||||||
{
|
|
||||||
// Validate arguments
|
|
||||||
if (targetScheduler == null) throw new ArgumentNullException("underlyingScheduler");
|
|
||||||
if (maxConcurrencyLevel < 0) throw new ArgumentOutOfRangeException("concurrencyLevel");
|
|
||||||
|
|
||||||
// Initialize only those fields relevant to use an underlying scheduler. We don't
|
|
||||||
// initialize the fields relevant to using our own custom threads.
|
|
||||||
_targetScheduler = targetScheduler;
|
|
||||||
_nonthreadsafeTaskQueue = new Queue<Task>();
|
|
||||||
|
|
||||||
// If 0, use the number of logical processors. But make sure whatever value we pick
|
|
||||||
// is not greater than the degree of parallelism allowed by the underlying scheduler.
|
|
||||||
_concurrencyLevel = maxConcurrencyLevel != 0 ? maxConcurrencyLevel : Environment.ProcessorCount;
|
|
||||||
if (targetScheduler.MaximumConcurrencyLevel > 0 &&
|
|
||||||
targetScheduler.MaximumConcurrencyLevel < _concurrencyLevel)
|
|
||||||
{
|
|
||||||
_concurrencyLevel = targetScheduler.MaximumConcurrencyLevel;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Initializes the scheduler.</summary>
|
|
||||||
/// <param name="threadCount">The number of threads to create and use for processing work items.</param>
|
|
||||||
public QueuedTaskScheduler(int threadCount) : this(threadCount, string.Empty, false, ThreadPriority.Normal, ApartmentState.MTA, 0, null, null) { }
|
|
||||||
|
|
||||||
/// <summary>Initializes the scheduler.</summary>
|
|
||||||
/// <param name="threadCount">The number of threads to create and use for processing work items.</param>
|
|
||||||
/// <param name="threadName">The name to use for each of the created threads.</param>
|
|
||||||
/// <param name="useForegroundThreads">A Boolean value that indicates whether to use foreground threads instead of background.</param>
|
|
||||||
/// <param name="threadPriority">The priority to assign to each thread.</param>
|
|
||||||
/// <param name="threadApartmentState">The apartment state to use for each thread.</param>
|
|
||||||
/// <param name="threadMaxStackSize">The stack size to use for each thread.</param>
|
|
||||||
/// <param name="threadInit">An initialization routine to run on each thread.</param>
|
|
||||||
/// <param name="threadFinally">A finalization routine to run on each thread.</param>
|
|
||||||
public QueuedTaskScheduler(
|
|
||||||
int threadCount,
|
|
||||||
string threadName = "",
|
|
||||||
bool useForegroundThreads = false,
|
|
||||||
ThreadPriority threadPriority = ThreadPriority.Normal,
|
|
||||||
ApartmentState threadApartmentState = ApartmentState.MTA,
|
|
||||||
int threadMaxStackSize = 0,
|
|
||||||
Action threadInit = null,
|
|
||||||
Action threadFinally = null)
|
|
||||||
{
|
|
||||||
// Validates arguments (some validation is left up to the Thread type itself).
|
|
||||||
// If the thread count is 0, default to the number of logical processors.
|
|
||||||
if (threadCount < 0) throw new ArgumentOutOfRangeException("concurrencyLevel");
|
|
||||||
else if (threadCount == 0) _concurrencyLevel = Environment.ProcessorCount;
|
|
||||||
else _concurrencyLevel = threadCount;
|
|
||||||
|
|
||||||
// Initialize the queue used for storing tasks
|
|
||||||
_blockingTaskQueue = new BlockingCollection<Task>();
|
|
||||||
|
|
||||||
// Create all of the threads
|
|
||||||
_threads = new Thread[threadCount];
|
|
||||||
for (int i = 0; i < threadCount; i++)
|
|
||||||
{
|
|
||||||
_threads[i] = new Thread(() => ThreadBasedDispatchLoop(threadInit, threadFinally), threadMaxStackSize)
|
|
||||||
{
|
|
||||||
Priority = threadPriority,
|
|
||||||
IsBackground = !useForegroundThreads,
|
|
||||||
};
|
|
||||||
if (threadName != null) _threads[i].Name = threadName + " (" + i + ")";
|
|
||||||
_threads[i].SetApartmentState(threadApartmentState);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Start all of the threads
|
|
||||||
foreach (var thread in _threads) thread.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>The dispatch loop run by all threads in this scheduler.</summary>
|
|
||||||
/// <param name="threadInit">An initialization routine to run when the thread begins.</param>
|
|
||||||
/// <param name="threadFinally">A finalization routine to run before the thread ends.</param>
|
|
||||||
private void ThreadBasedDispatchLoop(Action threadInit, Action threadFinally)
|
|
||||||
{
|
|
||||||
_taskProcessingThread.Value = true;
|
|
||||||
if (threadInit != null) threadInit();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// If the scheduler is disposed, the cancellation token will be set and
|
|
||||||
// we'll receive an OperationCanceledException. That OCE should not crash the process.
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// If a thread abort occurs, we'll try to reset it and continue running.
|
|
||||||
while (true)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// For each task queued to the scheduler, try to execute it.
|
|
||||||
foreach (var task in _blockingTaskQueue.GetConsumingEnumerable(_disposeCancellation.Token))
|
|
||||||
{
|
|
||||||
// If the task is not null, that means it was queued to this scheduler directly.
|
|
||||||
// Run it.
|
|
||||||
if (task != null)
|
|
||||||
{
|
|
||||||
TryExecuteTask(task);
|
|
||||||
}
|
|
||||||
// If the task is null, that means it's just a placeholder for a task
|
|
||||||
// queued to one of the subschedulers. Find the next task based on
|
|
||||||
// priority and fairness and run it.
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Find the next task based on our ordering rules...
|
|
||||||
Task targetTask;
|
|
||||||
QueuedTaskSchedulerQueue queueForTargetTask;
|
|
||||||
lock (_queueGroups) FindNextTask_NeedsLock(out targetTask, out queueForTargetTask);
|
|
||||||
|
|
||||||
// ... and if we found one, run it
|
|
||||||
if (targetTask != null) queueForTargetTask.ExecuteTask(targetTask);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (ThreadAbortException)
|
|
||||||
{
|
|
||||||
// If we received a thread abort, and that thread abort was due to shutting down
|
|
||||||
// or unloading, let it pass through. Otherwise, reset the abort so we can
|
|
||||||
// continue processing work items.
|
|
||||||
if (!Environment.HasShutdownStarted && !AppDomain.CurrentDomain.IsFinalizingForUnload())
|
|
||||||
{
|
|
||||||
Thread.ResetAbort();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (OperationCanceledException) { }
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
// Run a cleanup routine if there was one
|
|
||||||
if (threadFinally != null) threadFinally();
|
|
||||||
_taskProcessingThread.Value = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Gets the number of queues currently activated.</summary>
|
|
||||||
private int DebugQueueCount
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
int count = 0;
|
|
||||||
foreach (var group in _queueGroups) count += group.Value.Count;
|
|
||||||
return count;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Gets the number of tasks currently scheduled.</summary>
|
|
||||||
private int DebugTaskCount
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return (_targetScheduler != null ?
|
|
||||||
(IEnumerable<Task>)_nonthreadsafeTaskQueue : (IEnumerable<Task>)_blockingTaskQueue)
|
|
||||||
.Where(t => t != null).Count();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Find the next task that should be executed, based on priorities and fairness and the like.</summary>
|
|
||||||
/// <param name="targetTask">The found task, or null if none was found.</param>
|
|
||||||
/// <param name="queueForTargetTask">
|
|
||||||
/// The scheduler associated with the found task. Due to security checks inside of TPL,
|
|
||||||
/// this scheduler needs to be used to execute that task.
|
|
||||||
/// </param>
|
|
||||||
private void FindNextTask_NeedsLock(out Task targetTask, out QueuedTaskSchedulerQueue queueForTargetTask)
|
|
||||||
{
|
|
||||||
targetTask = null;
|
|
||||||
queueForTargetTask = null;
|
|
||||||
|
|
||||||
// Look through each of our queue groups in sorted order.
|
|
||||||
// This ordering is based on the priority of the queues.
|
|
||||||
foreach (var queueGroup in _queueGroups)
|
|
||||||
{
|
|
||||||
var queues = queueGroup.Value;
|
|
||||||
|
|
||||||
// Within each group, iterate through the queues in a round-robin
|
|
||||||
// fashion. Every time we iterate again and successfully find a task,
|
|
||||||
// we'll start in the next location in the group.
|
|
||||||
foreach (int i in queues.CreateSearchOrder())
|
|
||||||
{
|
|
||||||
queueForTargetTask = queues[i];
|
|
||||||
var items = queueForTargetTask._workItems;
|
|
||||||
if (items.Count > 0)
|
|
||||||
{
|
|
||||||
targetTask = items.Dequeue();
|
|
||||||
if (queueForTargetTask._disposed && items.Count == 0)
|
|
||||||
{
|
|
||||||
RemoveQueue_NeedsLock(queueForTargetTask);
|
|
||||||
}
|
|
||||||
queues.NextQueueIndex = (queues.NextQueueIndex + 1) % queueGroup.Value.Count;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Queues a task to the scheduler.</summary>
|
|
||||||
/// <param name="task">The task to be queued.</param>
|
|
||||||
protected override void QueueTask(Task task)
|
|
||||||
{
|
|
||||||
// If we've been disposed, no one should be queueing
|
|
||||||
if (_disposeCancellation.IsCancellationRequested) throw new ObjectDisposedException(GetType().Name);
|
|
||||||
|
|
||||||
// If the target scheduler is null (meaning we're using our own threads),
|
|
||||||
// add the task to the blocking queue
|
|
||||||
if (_targetScheduler == null)
|
|
||||||
{
|
|
||||||
_blockingTaskQueue.Add(task);
|
|
||||||
}
|
|
||||||
// Otherwise, add the task to the non-blocking queue,
|
|
||||||
// and if there isn't already an executing processing task,
|
|
||||||
// start one up
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Queue the task and check whether we should launch a processing
|
|
||||||
// task (noting it if we do, so that other threads don't result
|
|
||||||
// in queueing up too many).
|
|
||||||
bool launchTask = false;
|
|
||||||
lock (_nonthreadsafeTaskQueue)
|
|
||||||
{
|
|
||||||
_nonthreadsafeTaskQueue.Enqueue(task);
|
|
||||||
if (_delegatesQueuedOrRunning < _concurrencyLevel)
|
|
||||||
{
|
|
||||||
++_delegatesQueuedOrRunning;
|
|
||||||
launchTask = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If necessary, start processing asynchronously
|
|
||||||
if (launchTask)
|
|
||||||
{
|
|
||||||
Task.Factory.StartNew(ProcessPrioritizedAndBatchedTasks,
|
|
||||||
CancellationToken.None, TaskCreationOptions.None, _targetScheduler);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Process tasks one at a time in the best order.
|
|
||||||
/// This should be run in a Task generated by QueueTask.
|
|
||||||
/// It's been separated out into its own method to show up better in Parallel Tasks.
|
|
||||||
/// </summary>
|
|
||||||
private void ProcessPrioritizedAndBatchedTasks()
|
|
||||||
{
|
|
||||||
bool continueProcessing = true;
|
|
||||||
while (!_disposeCancellation.IsCancellationRequested && continueProcessing)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// Note that we're processing tasks on this thread
|
|
||||||
_taskProcessingThread.Value = true;
|
|
||||||
|
|
||||||
// Until there are no more tasks to process
|
|
||||||
while (!_disposeCancellation.IsCancellationRequested)
|
|
||||||
{
|
|
||||||
// Try to get the next task. If there aren't any more, we're done.
|
|
||||||
Task targetTask;
|
|
||||||
lock (_nonthreadsafeTaskQueue)
|
|
||||||
{
|
|
||||||
if (_nonthreadsafeTaskQueue.Count == 0) return;
|
|
||||||
targetTask = _nonthreadsafeTaskQueue.Dequeue();
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the task is null, it's a placeholder for a task in the round-robin queues.
|
|
||||||
// Find the next one that should be processed.
|
|
||||||
QueuedTaskSchedulerQueue queueForTargetTask = null;
|
|
||||||
if (targetTask == null)
|
|
||||||
{
|
|
||||||
lock (_queueGroups) FindNextTask_NeedsLock(out targetTask, out queueForTargetTask);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now if we finally have a task, run it. If the task
|
|
||||||
// was associated with one of the round-robin schedulers, we need to use it
|
|
||||||
// as a thunk to execute its task.
|
|
||||||
if (targetTask != null)
|
|
||||||
{
|
|
||||||
if (queueForTargetTask != null) queueForTargetTask.ExecuteTask(targetTask);
|
|
||||||
else TryExecuteTask(targetTask);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
// Now that we think we're done, verify that there really is
|
|
||||||
// no more work to do. If there's not, highlight
|
|
||||||
// that we're now less parallel than we were a moment ago.
|
|
||||||
lock (_nonthreadsafeTaskQueue)
|
|
||||||
{
|
|
||||||
if (_nonthreadsafeTaskQueue.Count == 0)
|
|
||||||
{
|
|
||||||
_delegatesQueuedOrRunning--;
|
|
||||||
continueProcessing = false;
|
|
||||||
_taskProcessingThread.Value = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Notifies the pool that there's a new item to be executed in one of the round-robin queues.</summary>
|
|
||||||
private void NotifyNewWorkItem() { QueueTask(null); }
|
|
||||||
|
|
||||||
/// <summary>Tries to execute a task synchronously on the current thread.</summary>
|
|
||||||
/// <param name="task">The task to execute.</param>
|
|
||||||
/// <param name="taskWasPreviouslyQueued">Whether the task was previously queued.</param>
|
|
||||||
/// <returns>true if the task was executed; otherwise, false.</returns>
|
|
||||||
protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued)
|
|
||||||
{
|
|
||||||
// If we're already running tasks on this threads, enable inlining
|
|
||||||
return _taskProcessingThread.Value && TryExecuteTask(task);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Gets the tasks scheduled to this scheduler.</summary>
|
|
||||||
/// <returns>An enumerable of all tasks queued to this scheduler.</returns>
|
|
||||||
/// <remarks>This does not include the tasks on sub-schedulers. Those will be retrieved by the debugger separately.</remarks>
|
|
||||||
protected override IEnumerable<Task> GetScheduledTasks()
|
|
||||||
{
|
|
||||||
// If we're running on our own threads, get the tasks from the blocking queue...
|
|
||||||
if (_targetScheduler == null)
|
|
||||||
{
|
|
||||||
// Get all of the tasks, filtering out nulls, which are just placeholders
|
|
||||||
// for tasks in other sub-schedulers
|
|
||||||
return _blockingTaskQueue.Where(t => t != null).ToList();
|
|
||||||
}
|
|
||||||
// otherwise get them from the non-blocking queue...
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return _nonthreadsafeTaskQueue.Where(t => t != null).ToList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Gets the maximum concurrency level to use when processing tasks.</summary>
|
|
||||||
public override int MaximumConcurrencyLevel { get { return _concurrencyLevel; } }
|
|
||||||
|
|
||||||
/// <summary>Initiates shutdown of the scheduler.</summary>
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
_disposeCancellation.Cancel();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Creates and activates a new scheduling queue for this scheduler.</summary>
|
|
||||||
/// <returns>The newly created and activated queue at priority 0.</returns>
|
|
||||||
public TaskScheduler ActivateNewQueue() { return ActivateNewQueue(0); }
|
|
||||||
|
|
||||||
/// <summary>Creates and activates a new scheduling queue for this scheduler.</summary>
|
|
||||||
/// <param name="priority">The priority level for the new queue.</param>
|
|
||||||
/// <returns>The newly created and activated queue at the specified priority.</returns>
|
|
||||||
public TaskScheduler ActivateNewQueue(int priority)
|
|
||||||
{
|
|
||||||
// Create the queue
|
|
||||||
var createdQueue = new QueuedTaskSchedulerQueue(priority, this);
|
|
||||||
|
|
||||||
// Add the queue to the appropriate queue group based on priority
|
|
||||||
lock (_queueGroups)
|
|
||||||
{
|
|
||||||
QueueGroup list;
|
|
||||||
if (!_queueGroups.TryGetValue(priority, out list))
|
|
||||||
{
|
|
||||||
list = new QueueGroup();
|
|
||||||
_queueGroups.Add(priority, list);
|
|
||||||
}
|
|
||||||
list.Add(createdQueue);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Hand the new queue back
|
|
||||||
return createdQueue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Removes a scheduler from the group.</summary>
|
|
||||||
/// <param name="queue">The scheduler to be removed.</param>
|
|
||||||
private void RemoveQueue_NeedsLock(QueuedTaskSchedulerQueue queue)
|
|
||||||
{
|
|
||||||
// Find the group that contains the queue and the queue's index within the group
|
|
||||||
var queueGroup = _queueGroups[queue._priority];
|
|
||||||
int index = queueGroup.IndexOf(queue);
|
|
||||||
|
|
||||||
// We're about to remove the queue, so adjust the index of the next
|
|
||||||
// round-robin starting location if it'll be affected by the removal
|
|
||||||
if (queueGroup.NextQueueIndex >= index) queueGroup.NextQueueIndex--;
|
|
||||||
|
|
||||||
// Remove it
|
|
||||||
queueGroup.RemoveAt(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>A group of queues a the same priority level.</summary>
|
|
||||||
private class QueueGroup : List<QueuedTaskSchedulerQueue>
|
|
||||||
{
|
|
||||||
/// <summary>The starting index for the next round-robin traversal.</summary>
|
|
||||||
public int NextQueueIndex = 0;
|
|
||||||
|
|
||||||
/// <summary>Creates a search order through this group.</summary>
|
|
||||||
/// <returns>An enumerable of indices for this group.</returns>
|
|
||||||
public IEnumerable<int> CreateSearchOrder()
|
|
||||||
{
|
|
||||||
for (int i = NextQueueIndex; i < Count; i++) yield return i;
|
|
||||||
for (int i = 0; i < NextQueueIndex; i++) yield return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Provides a scheduling queue associatd with a QueuedTaskScheduler.</summary>
|
|
||||||
[DebuggerDisplay("QueuePriority = {_priority}, WaitingTasks = {WaitingTasks}")]
|
|
||||||
[DebuggerTypeProxy(typeof(QueuedTaskSchedulerQueueDebugView))]
|
|
||||||
private sealed class QueuedTaskSchedulerQueue : TaskScheduler, IDisposable
|
|
||||||
{
|
|
||||||
/// <summary>A debug view for the queue.</summary>
|
|
||||||
private sealed class QueuedTaskSchedulerQueueDebugView
|
|
||||||
{
|
|
||||||
/// <summary>The queue.</summary>
|
|
||||||
private readonly QueuedTaskSchedulerQueue _queue;
|
|
||||||
|
|
||||||
/// <summary>Initializes the debug view.</summary>
|
|
||||||
/// <param name="queue">The queue to be debugged.</param>
|
|
||||||
public QueuedTaskSchedulerQueueDebugView(QueuedTaskSchedulerQueue queue)
|
|
||||||
{
|
|
||||||
if (queue == null) throw new ArgumentNullException("queue");
|
|
||||||
_queue = queue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Gets the priority of this queue in its associated scheduler.</summary>
|
|
||||||
public int Priority { get { return _queue._priority; } }
|
|
||||||
/// <summary>Gets the ID of this scheduler.</summary>
|
|
||||||
public int Id { get { return _queue.Id; } }
|
|
||||||
/// <summary>Gets all of the tasks scheduled to this queue.</summary>
|
|
||||||
public IEnumerable<Task> ScheduledTasks { get { return _queue.GetScheduledTasks(); } }
|
|
||||||
/// <summary>Gets the QueuedTaskScheduler with which this queue is associated.</summary>
|
|
||||||
public QueuedTaskScheduler AssociatedScheduler { get { return _queue._pool; } }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>The scheduler with which this pool is associated.</summary>
|
|
||||||
private readonly QueuedTaskScheduler _pool;
|
|
||||||
/// <summary>The work items stored in this queue.</summary>
|
|
||||||
internal readonly Queue<Task> _workItems;
|
|
||||||
/// <summary>Whether this queue has been disposed.</summary>
|
|
||||||
internal bool _disposed;
|
|
||||||
/// <summary>Gets the priority for this queue.</summary>
|
|
||||||
internal int _priority;
|
|
||||||
|
|
||||||
/// <summary>Initializes the queue.</summary>
|
|
||||||
/// <param name="priority">The priority associated with this queue.</param>
|
|
||||||
/// <param name="pool">The scheduler with which this queue is associated.</param>
|
|
||||||
internal QueuedTaskSchedulerQueue(int priority, QueuedTaskScheduler pool)
|
|
||||||
{
|
|
||||||
_priority = priority;
|
|
||||||
_pool = pool;
|
|
||||||
_workItems = new Queue<Task>();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Gets the number of tasks waiting in this scheduler.</summary>
|
|
||||||
internal int WaitingTasks { get { return _workItems.Count; } }
|
|
||||||
|
|
||||||
/// <summary>Gets the tasks scheduled to this scheduler.</summary>
|
|
||||||
/// <returns>An enumerable of all tasks queued to this scheduler.</returns>
|
|
||||||
protected override IEnumerable<Task> GetScheduledTasks() { return _workItems.ToList(); }
|
|
||||||
|
|
||||||
/// <summary>Queues a task to the scheduler.</summary>
|
|
||||||
/// <param name="task">The task to be queued.</param>
|
|
||||||
protected override void QueueTask(Task task)
|
|
||||||
{
|
|
||||||
if (_disposed) throw new ObjectDisposedException(GetType().Name);
|
|
||||||
|
|
||||||
// Queue up the task locally to this queue, and then notify
|
|
||||||
// the parent scheduler that there's work available
|
|
||||||
lock (_pool._queueGroups) _workItems.Enqueue(task);
|
|
||||||
_pool.NotifyNewWorkItem();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Tries to execute a task synchronously on the current thread.</summary>
|
|
||||||
/// <param name="task">The task to execute.</param>
|
|
||||||
/// <param name="taskWasPreviouslyQueued">Whether the task was previously queued.</param>
|
|
||||||
/// <returns>true if the task was executed; otherwise, false.</returns>
|
|
||||||
protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued)
|
|
||||||
{
|
|
||||||
// If we're using our own threads and if this is being called from one of them,
|
|
||||||
// or if we're currently processing another task on this thread, try running it inline.
|
|
||||||
return _taskProcessingThread.Value && TryExecuteTask(task);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Runs the specified ask.</summary>
|
|
||||||
/// <param name="task">The task to execute.</param>
|
|
||||||
internal void ExecuteTask(Task task) { TryExecuteTask(task); }
|
|
||||||
|
|
||||||
/// <summary>Gets the maximum concurrency level to use when processing tasks.</summary>
|
|
||||||
public override int MaximumConcurrencyLevel { get { return _pool.MaximumConcurrencyLevel; } }
|
|
||||||
|
|
||||||
/// <summary>Signals that the queue should be removed from the scheduler as soon as the queue is empty.</summary>
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
if (!_disposed)
|
|
||||||
{
|
|
||||||
lock (_pool._queueGroups)
|
|
||||||
{
|
|
||||||
// We only remove the queue if it's empty. If it's not empty,
|
|
||||||
// we still mark it as disposed, and the associated QueuedTaskScheduler
|
|
||||||
// will remove the queue when its count hits 0 and its _disposed is true.
|
|
||||||
if (_workItems.Count == 0)
|
|
||||||
{
|
|
||||||
_pool.RemoveQueue_NeedsLock(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_disposed = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,54 +0,0 @@
|
||||||
namespace Antlr4.Runtime.Test
|
|
||||||
{
|
|
||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
||||||
using Sharpen;
|
|
||||||
|
|
||||||
[TestClass]
|
|
||||||
public class TestBitSet
|
|
||||||
{
|
|
||||||
[TestMethod]
|
|
||||||
public void TestCardinality1()
|
|
||||||
{
|
|
||||||
BitSet set = new BitSet();
|
|
||||||
Assert.AreEqual(0, set.Cardinality());
|
|
||||||
for (int i = 0; i < 128; i++)
|
|
||||||
{
|
|
||||||
set.Set(i);
|
|
||||||
Assert.AreEqual(i + 1, set.Cardinality());
|
|
||||||
Assert.AreEqual(0, set.NextSetBit(0));
|
|
||||||
if (i > 0)
|
|
||||||
Assert.AreEqual(i * 1 - 1, set.NextSetBit(i * 1 - 1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestCardinality2()
|
|
||||||
{
|
|
||||||
BitSet set = new BitSet();
|
|
||||||
Assert.AreEqual(0, set.Cardinality());
|
|
||||||
for (int i = 0; i < 128; i++)
|
|
||||||
{
|
|
||||||
set.Set(i * 2);
|
|
||||||
Assert.AreEqual(i + 1, set.Cardinality());
|
|
||||||
Assert.AreEqual(0, set.NextSetBit(0));
|
|
||||||
if (i > 0)
|
|
||||||
Assert.AreEqual(i * 2, set.NextSetBit(i * 2 - 1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestCardinality7()
|
|
||||||
{
|
|
||||||
BitSet set = new BitSet();
|
|
||||||
Assert.AreEqual(0, set.Cardinality());
|
|
||||||
for (int i = 0; i < 128; i++)
|
|
||||||
{
|
|
||||||
set.Set(i * 7);
|
|
||||||
Assert.AreEqual(i + 1, set.Cardinality());
|
|
||||||
Assert.AreEqual(0, set.NextSetBit(0));
|
|
||||||
if (i > 0)
|
|
||||||
Assert.AreEqual(i * 7, set.NextSetBit(i * 7 - 1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,508 +0,0 @@
|
||||||
/*
|
|
||||||
* [The "BSD license"]
|
|
||||||
* Copyright (c) 2013 Terence Parr
|
|
||||||
* Copyright (c) 2013 Sam Harwell
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
||||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
||||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
namespace Antlr4.Runtime.Test
|
|
||||||
{
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using Antlr4.Runtime.Misc;
|
|
||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
||||||
|
|
||||||
[TestClass]
|
|
||||||
public class TestIntervalSet
|
|
||||||
{
|
|
||||||
[TestMethod]
|
|
||||||
public void TestSingleElement()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(99);
|
|
||||||
String expecting = "99";
|
|
||||||
Assert.AreEqual(s.ToString(), expecting);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestIsolatedElements()
|
|
||||||
{
|
|
||||||
IntervalSet s = new IntervalSet();
|
|
||||||
s.Add(1);
|
|
||||||
s.Add('z');
|
|
||||||
s.Add('\uFFF0');
|
|
||||||
String expecting = "{1, 122, 65520}";
|
|
||||||
Assert.AreEqual(s.ToString(), expecting);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestMixedRangesAndElements()
|
|
||||||
{
|
|
||||||
IntervalSet s = new IntervalSet();
|
|
||||||
s.Add(1);
|
|
||||||
s.Add('a', 'z');
|
|
||||||
s.Add('0', '9');
|
|
||||||
String expecting = "{1, 48..57, 97..122}";
|
|
||||||
Assert.AreEqual(s.ToString(), expecting);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestSimpleAnd()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(10, 20);
|
|
||||||
IntervalSet s2 = IntervalSet.Of(13, 15);
|
|
||||||
String expecting = "{13..15}";
|
|
||||||
String result = (s.And(s2)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestRangeAndIsolatedElement()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of('a', 'z');
|
|
||||||
IntervalSet s2 = IntervalSet.Of('d');
|
|
||||||
String expecting = "100";
|
|
||||||
String result = (s.And(s2)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestEmptyIntersection()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of('a', 'z');
|
|
||||||
IntervalSet s2 = IntervalSet.Of('0', '9');
|
|
||||||
String expecting = "{}";
|
|
||||||
String result = (s.And(s2)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestEmptyIntersectionSingleElements()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of('a');
|
|
||||||
IntervalSet s2 = IntervalSet.Of('d');
|
|
||||||
String expecting = "{}";
|
|
||||||
String result = (s.And(s2)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestNotSingleElement()
|
|
||||||
{
|
|
||||||
IntervalSet vocabulary = IntervalSet.Of(1, 1000);
|
|
||||||
vocabulary.Add(2000, 3000);
|
|
||||||
IntervalSet s = IntervalSet.Of(50, 50);
|
|
||||||
String expecting = "{1..49, 51..1000, 2000..3000}";
|
|
||||||
String result = (s.Complement(vocabulary)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestNotSet()
|
|
||||||
{
|
|
||||||
IntervalSet vocabulary = IntervalSet.Of(1, 1000);
|
|
||||||
IntervalSet s = IntervalSet.Of(50, 60);
|
|
||||||
s.Add(5);
|
|
||||||
s.Add(250, 300);
|
|
||||||
String expecting = "{1..4, 6..49, 61..249, 301..1000}";
|
|
||||||
String result = (s.Complement(vocabulary)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestNotEqualSet()
|
|
||||||
{
|
|
||||||
IntervalSet vocabulary = IntervalSet.Of(1, 1000);
|
|
||||||
IntervalSet s = IntervalSet.Of(1, 1000);
|
|
||||||
String expecting = "{}";
|
|
||||||
String result = (s.Complement(vocabulary)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestNotSetEdgeElement()
|
|
||||||
{
|
|
||||||
IntervalSet vocabulary = IntervalSet.Of(1, 2);
|
|
||||||
IntervalSet s = IntervalSet.Of(1);
|
|
||||||
String expecting = "2";
|
|
||||||
String result = (s.Complement(vocabulary)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestNotSetFragmentedVocabulary()
|
|
||||||
{
|
|
||||||
IntervalSet vocabulary = IntervalSet.Of(1, 255);
|
|
||||||
vocabulary.Add(1000, 2000);
|
|
||||||
vocabulary.Add(9999);
|
|
||||||
IntervalSet s = IntervalSet.Of(50, 60);
|
|
||||||
s.Add(3);
|
|
||||||
s.Add(250, 300);
|
|
||||||
s.Add(10000); // this is outside range of vocab and should be ignored
|
|
||||||
String expecting = "{1..2, 4..49, 61..249, 1000..2000, 9999}";
|
|
||||||
String result = (s.Complement(vocabulary)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestSubtractOfCompletelyContainedRange()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(10, 20);
|
|
||||||
IntervalSet s2 = IntervalSet.Of(12, 15);
|
|
||||||
String expecting = "{10..11, 16..20}";
|
|
||||||
String result = (s.Subtract(s2)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestSubtractOfOverlappingRangeFromLeft()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(10, 20);
|
|
||||||
IntervalSet s2 = IntervalSet.Of(5, 11);
|
|
||||||
String expecting = "{12..20}";
|
|
||||||
String result = (s.Subtract(s2)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
|
|
||||||
IntervalSet s3 = IntervalSet.Of(5, 10);
|
|
||||||
expecting = "{11..20}";
|
|
||||||
result = (s.Subtract(s3)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestSubtractOfOverlappingRangeFromRight()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(10, 20);
|
|
||||||
IntervalSet s2 = IntervalSet.Of(15, 25);
|
|
||||||
String expecting = "{10..14}";
|
|
||||||
String result = (s.Subtract(s2)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
|
|
||||||
IntervalSet s3 = IntervalSet.Of(20, 25);
|
|
||||||
expecting = "{10..19}";
|
|
||||||
result = (s.Subtract(s3)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestSubtractOfCompletelyCoveredRange()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(10, 20);
|
|
||||||
IntervalSet s2 = IntervalSet.Of(1, 25);
|
|
||||||
String expecting = "{}";
|
|
||||||
String result = (s.Subtract(s2)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestSubtractOfRangeSpanningMultipleRanges()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(10, 20);
|
|
||||||
s.Add(30, 40);
|
|
||||||
s.Add(50, 60); // s has 3 ranges now: 10..20, 30..40, 50..60
|
|
||||||
IntervalSet s2 = IntervalSet.Of(5, 55); // covers one and touches 2nd range
|
|
||||||
String expecting = "{56..60}";
|
|
||||||
String result = (s.Subtract(s2)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
|
|
||||||
IntervalSet s3 = IntervalSet.Of(15, 55); // touches both
|
|
||||||
expecting = "{10..14, 56..60}";
|
|
||||||
result = (s.Subtract(s3)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** The following was broken:
|
|
||||||
{0..113, 115..65534}-{0..115, 117..65534}=116..65534
|
|
||||||
*/
|
|
||||||
[TestMethod]
|
|
||||||
public void TestSubtractOfWackyRange()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(0, 113);
|
|
||||||
s.Add(115, 200);
|
|
||||||
IntervalSet s2 = IntervalSet.Of(0, 115);
|
|
||||||
s2.Add(117, 200);
|
|
||||||
String expecting = "116";
|
|
||||||
String result = (s.Subtract(s2)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestSimpleEquals()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(10, 20);
|
|
||||||
IntervalSet s2 = IntervalSet.Of(10, 20);
|
|
||||||
Assert.AreEqual(s, s2);
|
|
||||||
|
|
||||||
IntervalSet s3 = IntervalSet.Of(15, 55);
|
|
||||||
Assert.AreNotEqual(s, s3);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestEquals()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(10, 20);
|
|
||||||
s.Add(2);
|
|
||||||
s.Add(499, 501);
|
|
||||||
IntervalSet s2 = IntervalSet.Of(10, 20);
|
|
||||||
s2.Add(2);
|
|
||||||
s2.Add(499, 501);
|
|
||||||
Assert.AreEqual(s, s2);
|
|
||||||
|
|
||||||
IntervalSet s3 = IntervalSet.Of(10, 20);
|
|
||||||
s3.Add(2);
|
|
||||||
Assert.AreNotEqual(s, s3);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestSingleElementMinusDisjointSet()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(15, 15);
|
|
||||||
IntervalSet s2 = IntervalSet.Of(1, 5);
|
|
||||||
s2.Add(10, 20);
|
|
||||||
String expecting = "{}"; // 15 - {1..5, 10..20} = {}
|
|
||||||
String result = s.Subtract(s2).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestMembership()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(15, 15);
|
|
||||||
s.Add(50, 60);
|
|
||||||
Assert.IsFalse(s.Contains(0));
|
|
||||||
Assert.IsFalse(s.Contains(20));
|
|
||||||
Assert.IsFalse(s.Contains(100));
|
|
||||||
Assert.IsTrue(s.Contains(15));
|
|
||||||
Assert.IsTrue(s.Contains(55));
|
|
||||||
Assert.IsTrue(s.Contains(50));
|
|
||||||
Assert.IsTrue(s.Contains(60));
|
|
||||||
}
|
|
||||||
|
|
||||||
// {2,15,18} & 10..20
|
|
||||||
[TestMethod]
|
|
||||||
public void TestIntersectionWithTwoContainedElements()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(10, 20);
|
|
||||||
IntervalSet s2 = IntervalSet.Of(2, 2);
|
|
||||||
s2.Add(15);
|
|
||||||
s2.Add(18);
|
|
||||||
String expecting = "{15, 18}";
|
|
||||||
String result = (s.And(s2)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestIntersectionWithTwoContainedElementsReversed()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(10, 20);
|
|
||||||
IntervalSet s2 = IntervalSet.Of(2, 2);
|
|
||||||
s2.Add(15);
|
|
||||||
s2.Add(18);
|
|
||||||
String expecting = "{15, 18}";
|
|
||||||
String result = (s2.And(s)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestComplement()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(100, 100);
|
|
||||||
s.Add(101, 101);
|
|
||||||
IntervalSet s2 = IntervalSet.Of(100, 102);
|
|
||||||
String expecting = "102";
|
|
||||||
String result = (s.Complement(s2)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestComplement2()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(100, 101);
|
|
||||||
IntervalSet s2 = IntervalSet.Of(100, 102);
|
|
||||||
String expecting = "102";
|
|
||||||
String result = (s.Complement(s2)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestComplement3()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(1, 96);
|
|
||||||
s.Add(99, Lexer.MaxCharValue);
|
|
||||||
String expecting = "{97..98}";
|
|
||||||
String result = (s.Complement(1, Lexer.MaxCharValue)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestMergeOfRangesAndSingleValues()
|
|
||||||
{
|
|
||||||
// {0..41, 42, 43..65534}
|
|
||||||
IntervalSet s = IntervalSet.Of(0, 41);
|
|
||||||
s.Add(42);
|
|
||||||
s.Add(43, 65534);
|
|
||||||
String expecting = "{0..65534}";
|
|
||||||
String result = s.ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestMergeOfRangesAndSingleValuesReverse()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(43, 65534);
|
|
||||||
s.Add(42);
|
|
||||||
s.Add(0, 41);
|
|
||||||
String expecting = "{0..65534}";
|
|
||||||
String result = s.ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestMergeWhereAdditionMergesTwoExistingIntervals()
|
|
||||||
{
|
|
||||||
// 42, 10, {0..9, 11..41, 43..65534}
|
|
||||||
IntervalSet s = IntervalSet.Of(42);
|
|
||||||
s.Add(10);
|
|
||||||
s.Add(0, 9);
|
|
||||||
s.Add(43, 65534);
|
|
||||||
s.Add(11, 41);
|
|
||||||
String expecting = "{0..65534}";
|
|
||||||
String result = s.ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This case is responsible for antlr/antlr4#153.
|
|
||||||
* https://github.com/antlr/antlr4/issues/153
|
|
||||||
*/
|
|
||||||
[TestMethod]
|
|
||||||
public void TestMergeWhereAdditionMergesThreeExistingIntervals()
|
|
||||||
{
|
|
||||||
IntervalSet s = new IntervalSet();
|
|
||||||
s.Add(0);
|
|
||||||
s.Add(3);
|
|
||||||
s.Add(5);
|
|
||||||
s.Add(0, 7);
|
|
||||||
String expecting = "{0..7}";
|
|
||||||
String result = s.ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestMergeWithDoubleOverlap()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(1, 10);
|
|
||||||
s.Add(20, 30);
|
|
||||||
s.Add(5, 25); // overlaps two!
|
|
||||||
String expecting = "{1..30}";
|
|
||||||
String result = s.ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestSize()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(20, 30);
|
|
||||||
s.Add(50, 55);
|
|
||||||
s.Add(5, 19);
|
|
||||||
String expecting = "32";
|
|
||||||
String result = s.Count.ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestToList()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(20, 25);
|
|
||||||
s.Add(50, 55);
|
|
||||||
s.Add(5, 5);
|
|
||||||
int[] expecting = { 5, 20, 21, 22, 23, 24, 25, 50, 51, 52, 53, 54, 55 };
|
|
||||||
IList<int> result = s.ToList();
|
|
||||||
CollectionAssert.AreEquivalent(expecting, result.ToArray());
|
|
||||||
}
|
|
||||||
|
|
||||||
/** The following was broken:
|
|
||||||
* {'\u0000'..'s', 'u'..'\uFFFE'} & {'\u0000'..'q', 's'..'\uFFFE'}=
|
|
||||||
* {'\u0000'..'q', 's'}!!!! broken...
|
|
||||||
* 'q' is 113 ascii
|
|
||||||
* 'u' is 117
|
|
||||||
*/
|
|
||||||
[TestMethod]
|
|
||||||
public void TestNotRIntersectionNotT()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(0, 's');
|
|
||||||
s.Add('u', 200);
|
|
||||||
IntervalSet s2 = IntervalSet.Of(0, 'q');
|
|
||||||
s2.Add('s', 200);
|
|
||||||
String expecting = "{0..113, 115, 117..200}";
|
|
||||||
String result = (s.And(s2)).ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestRmSingleElement()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(1, 10);
|
|
||||||
s.Add(-3, -3);
|
|
||||||
s.Remove(-3);
|
|
||||||
String expecting = "{1..10}";
|
|
||||||
String result = s.ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestRmLeftSide()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(1, 10);
|
|
||||||
s.Add(-3, -3);
|
|
||||||
s.Remove(1);
|
|
||||||
String expecting = "{-3, 2..10}";
|
|
||||||
String result = s.ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestRmRightSide()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(1, 10);
|
|
||||||
s.Add(-3, -3);
|
|
||||||
s.Remove(10);
|
|
||||||
String expecting = "{-3, 1..9}";
|
|
||||||
String result = s.ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void TestRmMiddleRange()
|
|
||||||
{
|
|
||||||
IntervalSet s = IntervalSet.Of(1, 10);
|
|
||||||
s.Add(-3, -3);
|
|
||||||
s.Remove(5);
|
|
||||||
String expecting = "{-3, 1..4, 6..10}";
|
|
||||||
String result = s.ToString();
|
|
||||||
Assert.AreEqual(expecting, result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="Antlr4" version="4.3.0" targetFramework="net20" />
|
|
||||||
<package id="Antlr4.Runtime" version="4.3.0" targetFramework="net20" />
|
|
||||||
</packages>
|
|
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="Antlr4" version="4.3.0" targetFramework="net30" />
|
|
||||||
<package id="Antlr4.Runtime" version="4.3.0" targetFramework="net30" />
|
|
||||||
</packages>
|
|
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="Antlr4" version="4.3.0" targetFramework="net35-client" />
|
|
||||||
<package id="Antlr4.Runtime" version="4.3.0" targetFramework="net35-client" />
|
|
||||||
</packages>
|
|
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="Antlr4" version="4.3.0" targetFramework="net40-client" />
|
|
||||||
<package id="Antlr4.Runtime" version="4.3.0" targetFramework="net40-client" />
|
|
||||||
</packages>
|
|
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="Antlr4" version="4.3.0" targetFramework="net45" />
|
|
||||||
<package id="Antlr4.Runtime" version="4.3.0" targetFramework="net45" />
|
|
||||||
</packages>
|
|
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="Antlr4" version="4.3.0" targetFramework="portable-net40+sl50+wp80+win" />
|
|
||||||
<package id="Antlr4.Runtime" version="4.3.0" targetFramework="portable-net40+sl50+wp80+win" />
|
|
||||||
</packages>
|
|
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="Antlr4" version="4.3.0" targetFramework="portable-net45+wp80+win" />
|
|
||||||
<package id="Antlr4.Runtime" version="4.3.0" targetFramework="portable-net45+wp80+win" />
|
|
||||||
</packages>
|
|
|
@ -1,276 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.props" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" />
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{EBBDCC35-43CC-416C-860B-9FC115F1EB42}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>Antlr4.Runtime</RootNamespace>
|
|
||||||
<AssemblyName>Antlr4.Runtime</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v3.0</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<BaseIntermediateOutputPath>obj\net30\</BaseIntermediateOutputPath>
|
|
||||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
|
||||||
<RestorePackages>true</RestorePackages>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\net30\Debug\</OutputPath>
|
|
||||||
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
|
|
||||||
<DefineConstants>DEBUG;TRACE;NET30;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<NoWarn>1591</NoWarn>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\net30\Release\</OutputPath>
|
|
||||||
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
|
|
||||||
<DefineConstants>TRACE;NET30;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<NoWarn>1591</NoWarn>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<SignAssembly>true</SignAssembly>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<AssemblyOriginatorKeyFile>..\..\..\..\..\..\keys\antlr\antlr-net30.snk</AssemblyOriginatorKeyFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="AntlrFileStream.cs" />
|
|
||||||
<Compile Include="AntlrInputStream.cs" />
|
|
||||||
<Compile Include="Atn\AbstractPredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\ActionTransition.cs" />
|
|
||||||
<Compile Include="Atn\AmbiguityInfo.cs" />
|
|
||||||
<Compile Include="Atn\ArrayPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\ATN.cs" />
|
|
||||||
<Compile Include="Atn\ATNConfig.cs" />
|
|
||||||
<Compile Include="Atn\ATNConfigSet.cs" />
|
|
||||||
<Compile Include="Atn\ATNDeserializationOptions.cs" />
|
|
||||||
<Compile Include="Atn\ATNDeserializer.cs" />
|
|
||||||
<Compile Include="IVocabulary.cs" />
|
|
||||||
<Compile Include="Vocabulary.cs" />
|
|
||||||
<None Include="Atn\ATNSerializer.cs" />
|
|
||||||
<Compile Include="Atn\ATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\ATNState.cs" />
|
|
||||||
<Compile Include="Atn\ATNType.cs" />
|
|
||||||
<Compile Include="Atn\AtomTransition.cs" />
|
|
||||||
<Compile Include="Atn\BasicBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\BasicState.cs" />
|
|
||||||
<Compile Include="Atn\BlockEndState.cs" />
|
|
||||||
<Compile Include="Atn\BlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\ConflictInfo.cs" />
|
|
||||||
<Compile Include="Atn\ContextSensitivityInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionEventInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionState.cs" />
|
|
||||||
<Compile Include="Atn\EmptyPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\EpsilonTransition.cs" />
|
|
||||||
<Compile Include="Atn\ErrorInfo.cs" />
|
|
||||||
<Compile Include="Atn\ILexerAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerActionExecutor.cs" />
|
|
||||||
<Compile Include="Atn\LexerActionType.cs" />
|
|
||||||
<Compile Include="Atn\LexerATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\LexerChannelAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerCustomAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerIndexedCustomAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerMoreAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerPopModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerPushModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerSkipAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerTypeAction.cs" />
|
|
||||||
<Compile Include="Atn\LL1Analyzer.cs" />
|
|
||||||
<Compile Include="Atn\LookaheadEventInfo.cs" />
|
|
||||||
<Compile Include="Atn\LoopEndState.cs" />
|
|
||||||
<Compile Include="Atn\NotSetTransition.cs" />
|
|
||||||
<Compile Include="Atn\OrderedATNConfigSet.cs" />
|
|
||||||
<Compile Include="Atn\ParseInfo.cs" />
|
|
||||||
<Compile Include="Atn\ParserATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\PlusBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\PlusLoopbackState.cs" />
|
|
||||||
<Compile Include="Atn\PrecedencePredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\PredicateEvalInfo.cs" />
|
|
||||||
<Compile Include="Atn\PredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\PredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\PredictionContextCache.cs" />
|
|
||||||
<Compile Include="Atn\PredictionMode.cs" />
|
|
||||||
<Compile Include="Atn\ProfilingATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\RangeTransition.cs" />
|
|
||||||
<Compile Include="Atn\RuleStartState.cs" />
|
|
||||||
<Compile Include="Atn\RuleStopState.cs" />
|
|
||||||
<Compile Include="Atn\RuleTransition.cs" />
|
|
||||||
<Compile Include="Atn\SemanticContext.cs" />
|
|
||||||
<Compile Include="Atn\SetTransition.cs" />
|
|
||||||
<Compile Include="Atn\SimulatorState.cs" />
|
|
||||||
<Compile Include="Atn\SingletonPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\StarBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\StarLoopbackState.cs" />
|
|
||||||
<Compile Include="Atn\StarLoopEntryState.cs" />
|
|
||||||
<Compile Include="Atn\StateType.cs" />
|
|
||||||
<Compile Include="Atn\TokensStartState.cs" />
|
|
||||||
<Compile Include="Atn\Transition.cs" />
|
|
||||||
<Compile Include="Atn\TransitionType.cs" />
|
|
||||||
<Compile Include="Atn\WildcardTransition.cs" />
|
|
||||||
<Compile Include="BailErrorStrategy.cs" />
|
|
||||||
<Compile Include="BaseErrorListener.cs" />
|
|
||||||
<Compile Include="BufferedTokenStream.cs" />
|
|
||||||
<Compile Include="CommonToken.cs" />
|
|
||||||
<Compile Include="CommonTokenFactory.cs" />
|
|
||||||
<Compile Include="CommonTokenStream.cs" />
|
|
||||||
<Compile Include="ConsoleErrorListener.cs" />
|
|
||||||
<Compile Include="DefaultErrorStrategy.cs" />
|
|
||||||
<Compile Include="Dependents.cs" />
|
|
||||||
<Compile Include="Dfa\AbstractEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\AcceptStateInfo.cs" />
|
|
||||||
<Compile Include="Dfa\ArrayEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\DFA.cs" />
|
|
||||||
<Compile Include="Dfa\DFASerializer.cs" />
|
|
||||||
<Compile Include="Dfa\DFAState.cs" />
|
|
||||||
<Compile Include="Dfa\EmptyEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\IEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\LexerDFASerializer.cs" />
|
|
||||||
<Compile Include="Dfa\SingletonEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\SparseEdgeMap`1.cs" />
|
|
||||||
<Compile Include="DiagnosticErrorListener.cs" />
|
|
||||||
<Compile Include="FailedPredicateException.cs" />
|
|
||||||
<Compile Include="IAntlrErrorListener`1.cs" />
|
|
||||||
<Compile Include="IAntlrErrorStrategy.cs" />
|
|
||||||
<Compile Include="ICharStream.cs" />
|
|
||||||
<Compile Include="IIntStream.cs" />
|
|
||||||
<Compile Include="InputMismatchException.cs" />
|
|
||||||
<Compile Include="InterpreterRuleContext.cs" />
|
|
||||||
<Compile Include="IParserErrorListener.cs" />
|
|
||||||
<Compile Include="IRecognizer.cs" />
|
|
||||||
<Compile Include="IToken.cs" />
|
|
||||||
<Compile Include="ITokenFactory.cs" />
|
|
||||||
<Compile Include="ITokenSource.cs" />
|
|
||||||
<Compile Include="ITokenStream.cs" />
|
|
||||||
<Compile Include="IWritableToken.cs" />
|
|
||||||
<Compile Include="Lexer.cs" />
|
|
||||||
<Compile Include="LexerInterpreter.cs" />
|
|
||||||
<Compile Include="LexerNoViableAltException.cs" />
|
|
||||||
<Compile Include="ListTokenSource.cs" />
|
|
||||||
<Compile Include="Misc\Args.cs" />
|
|
||||||
<None Include="..\..\..\..\..\..\keys\antlr\antlr-net30.snk">
|
|
||||||
<Link>antlr-net30.snk</Link>
|
|
||||||
</None>
|
|
||||||
<None Include="Misc\Array2DHashSet`1.cs" />
|
|
||||||
<Compile Include="Misc\MurmurHash.cs" />
|
|
||||||
<Compile Include="Misc\NullableAttribute.cs" />
|
|
||||||
<None Include="Misc\DoubleKeyMap`3.cs" />
|
|
||||||
<Compile Include="Misc\IIntSet.cs" />
|
|
||||||
<Compile Include="Misc\Interval.cs" />
|
|
||||||
<Compile Include="Misc\IntervalSet.cs" />
|
|
||||||
<Compile Include="Misc\MultiMap`2.cs" />
|
|
||||||
<Compile Include="Misc\NotNullAttribute.cs" />
|
|
||||||
<None Include="Misc\OrderedHashSet`1.cs" />
|
|
||||||
<Compile Include="Misc\ParseCanceledException.cs" />
|
|
||||||
<Compile Include="Misc\RuleDependencyChecker.cs" />
|
|
||||||
<None Include="Misc\RuleDependencyProcessor.cs" />
|
|
||||||
<None Include="Misc\TestRig.cs" />
|
|
||||||
<Compile Include="Misc\Utils.cs" />
|
|
||||||
<Compile Include="NoViableAltException.cs" />
|
|
||||||
<Compile Include="Parser.cs" />
|
|
||||||
<Compile Include="ParserInterpreter.cs" />
|
|
||||||
<Compile Include="ParserRuleContext.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
<Compile Include="ProxyErrorListener`1.cs" />
|
|
||||||
<Compile Include="ProxyParserErrorListener.cs" />
|
|
||||||
<Compile Include="RecognitionException.cs" />
|
|
||||||
<Compile Include="Recognizer`2.cs" />
|
|
||||||
<Compile Include="RuleContext.cs" />
|
|
||||||
<Compile Include="RuleDependencyAttribute.cs" />
|
|
||||||
<Compile Include="RuleVersionAttribute.cs" />
|
|
||||||
<Compile Include="Sharpen\Arrays.cs" />
|
|
||||||
<Compile Include="Sharpen\AtomicReference`1.cs" />
|
|
||||||
<Compile Include="Sharpen\BitSet.cs" />
|
|
||||||
<Compile Include="Sharpen\Collections.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\CollectionDebuggerView`2.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\ConcurrentDictionary`2.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\Enumerable.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\ExtensionAttribute.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\Funcs.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\HashSet`1.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\IStructuralComparable.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\IStructuralEquatable.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\SplitOrderedList`2.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\Tuple.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\Tuples.cs" />
|
|
||||||
<Compile Include="Sharpen\DictionaryExtensions.cs" />
|
|
||||||
<Compile Include="Sharpen\ListExtensions.cs" />
|
|
||||||
<Compile Include="Sharpen\Runtime.cs" />
|
|
||||||
<Compile Include="Sharpen\SequenceEqualityComparer`1.cs" />
|
|
||||||
<Compile Include="TokenStreamRewriter.cs" />
|
|
||||||
<Compile Include="TokenTypes.cs" />
|
|
||||||
<Compile Include="Tree\AbstractParseTreeVisitor`1.cs" />
|
|
||||||
<Compile Include="Tree\ErrorNodeImpl.cs" />
|
|
||||||
<Compile Include="Tree\IErrorNode.cs" />
|
|
||||||
<Compile Include="Tree\IParseTree.cs" />
|
|
||||||
<Compile Include="Tree\IParseTreeListener.cs" />
|
|
||||||
<Compile Include="Tree\IParseTreeVisitor`1.cs" />
|
|
||||||
<Compile Include="Tree\IRuleNode.cs" />
|
|
||||||
<Compile Include="Tree\ISyntaxTree.cs" />
|
|
||||||
<Compile Include="Tree\ITerminalNode.cs" />
|
|
||||||
<Compile Include="Tree\ITree.cs" />
|
|
||||||
<Compile Include="Tree\ParseTreeProperty`1.cs" />
|
|
||||||
<Compile Include="Tree\ParseTreeWalker.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\Chunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreeMatch.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreePattern.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreePatternMatcher.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\RuleTagToken.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TagChunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TextChunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TokenTagToken.cs" />
|
|
||||||
<Compile Include="Tree\TerminalNodeImpl.cs" />
|
|
||||||
<Compile Include="Tree\Trees.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPath.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathLexerErrorListener.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathRuleAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathRuleElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathTokenAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathTokenElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathWildcardAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathWildcardElement.cs" />
|
|
||||||
<Compile Include="UnbufferedCharStream.cs" />
|
|
||||||
<Compile Include="UnbufferedTokenStream.cs" />
|
|
||||||
<None Include="packages.Antlr4.Runtime.net30.config" />
|
|
||||||
<Antlr4 Include="Tree\Xpath\XPathLexer.g4">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<CustomToolNamespace>Antlr4.Runtime.Tree.Xpath</CustomToolNamespace>
|
|
||||||
</Antlr4>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<Import Project="$(SolutionDir)\build\KeyReporting.targets" />
|
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.props'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.targets'))" />
|
|
||||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
|
||||||
</Target>
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.targets" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" />
|
|
||||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
|
@ -1,293 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\packages\Antlr4.VS2008.4.2.1-alpha001\build\Antlr4.props" Condition="Exists('..\packages\Antlr4.VS2008.4.2.1-alpha001\build\Antlr4.props')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProductVersion>9.0.30729</ProductVersion>
|
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
|
||||||
<ProjectGuid>{C5F9C476-200F-4440-9524-C5C3F9BE16D7}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>Antlr4.Runtime</RootNamespace>
|
|
||||||
<AssemblyName>Antlr4.Runtime</AssemblyName>
|
|
||||||
<ProjectTypeGuids>{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<PlatformFamilyName>WindowsCE</PlatformFamilyName>
|
|
||||||
<PlatformID>E2BECB1F-8C8C-41ba-B736-9BE7D946A398</PlatformID>
|
|
||||||
<OSVersion>5.0</OSVersion>
|
|
||||||
<DeployDirSuffix>Antlr4.Runtime.net35-cf</DeployDirSuffix>
|
|
||||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
|
||||||
<NativePlatformName>Windows CE</NativePlatformName>
|
|
||||||
<FormFactorID>
|
|
||||||
</FormFactorID>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<BaseIntermediateOutputPath>obj\net35-cf\</BaseIntermediateOutputPath>
|
|
||||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
|
||||||
<RestorePackages>true</RestorePackages>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\net35-cf\Debug\</OutputPath>
|
|
||||||
<DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
|
|
||||||
<DefineConstants>DEBUG;TRACE;$(PlatformFamilyName);COMPACT;NET35;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<NoStdLib>true</NoStdLib>
|
|
||||||
<NoConfig>true</NoConfig>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
|
||||||
<NoWarn>1591</NoWarn>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\net35-cf\Release\</OutputPath>
|
|
||||||
<DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
|
|
||||||
<DefineConstants>TRACE;$(PlatformFamilyName);COMPACT;NET35;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<NoStdLib>true</NoStdLib>
|
|
||||||
<NoConfig>true</NoConfig>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
|
||||||
<NoWarn>1591</NoWarn>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<SignAssembly>true</SignAssembly>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<AssemblyOriginatorKeyFile>..\..\..\..\..\..\keys\antlr\antlr-net35-cf.snk</AssemblyOriginatorKeyFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="mscorlib" />
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Core" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="AntlrFileStream.cs" />
|
|
||||||
<Compile Include="AntlrInputStream.cs" />
|
|
||||||
<Compile Include="Atn\AbstractPredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\ActionTransition.cs" />
|
|
||||||
<Compile Include="Atn\AmbiguityInfo.cs" />
|
|
||||||
<Compile Include="Atn\ArrayPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\ATN.cs" />
|
|
||||||
<Compile Include="Atn\ATNConfig.cs" />
|
|
||||||
<Compile Include="Atn\ATNConfigSet.cs" />
|
|
||||||
<Compile Include="Atn\ATNDeserializationOptions.cs" />
|
|
||||||
<Compile Include="Atn\ATNDeserializer.cs" />
|
|
||||||
<None Include="Atn\ATNSerializer.cs" />
|
|
||||||
<Compile Include="Atn\ATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\ATNState.cs" />
|
|
||||||
<Compile Include="Atn\ATNType.cs" />
|
|
||||||
<Compile Include="Atn\AtomTransition.cs" />
|
|
||||||
<Compile Include="Atn\BasicBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\BasicState.cs" />
|
|
||||||
<Compile Include="Atn\BlockEndState.cs" />
|
|
||||||
<Compile Include="Atn\BlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\ConflictInfo.cs" />
|
|
||||||
<Compile Include="Atn\ContextSensitivityInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionEventInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionState.cs" />
|
|
||||||
<Compile Include="Atn\EmptyPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\EpsilonTransition.cs" />
|
|
||||||
<Compile Include="Atn\ErrorInfo.cs" />
|
|
||||||
<Compile Include="Atn\ILexerAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerActionExecutor.cs" />
|
|
||||||
<Compile Include="Atn\LexerActionType.cs" />
|
|
||||||
<Compile Include="Atn\LexerATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\LexerChannelAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerCustomAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerIndexedCustomAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerMoreAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerPopModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerPushModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerSkipAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerTypeAction.cs" />
|
|
||||||
<Compile Include="Atn\LL1Analyzer.cs" />
|
|
||||||
<Compile Include="Atn\LookaheadEventInfo.cs" />
|
|
||||||
<Compile Include="Atn\LoopEndState.cs" />
|
|
||||||
<Compile Include="Atn\NotSetTransition.cs" />
|
|
||||||
<Compile Include="Atn\OrderedATNConfigSet.cs" />
|
|
||||||
<Compile Include="Atn\ParseInfo.cs" />
|
|
||||||
<Compile Include="Atn\ParserATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\PlusBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\PlusLoopbackState.cs" />
|
|
||||||
<Compile Include="Atn\PrecedencePredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\PredicateEvalInfo.cs" />
|
|
||||||
<Compile Include="Atn\PredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\PredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\PredictionContextCache.cs" />
|
|
||||||
<Compile Include="Atn\PredictionMode.cs" />
|
|
||||||
<Compile Include="Atn\ProfilingATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\RangeTransition.cs" />
|
|
||||||
<Compile Include="Atn\RuleStartState.cs" />
|
|
||||||
<Compile Include="Atn\RuleStopState.cs" />
|
|
||||||
<Compile Include="Atn\RuleTransition.cs" />
|
|
||||||
<Compile Include="Atn\SemanticContext.cs" />
|
|
||||||
<Compile Include="Atn\SetTransition.cs" />
|
|
||||||
<Compile Include="Atn\SimulatorState.cs" />
|
|
||||||
<Compile Include="Atn\SingletonPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\StarBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\StarLoopbackState.cs" />
|
|
||||||
<Compile Include="Atn\StarLoopEntryState.cs" />
|
|
||||||
<Compile Include="Atn\StateType.cs" />
|
|
||||||
<Compile Include="Atn\TokensStartState.cs" />
|
|
||||||
<Compile Include="Atn\Transition.cs" />
|
|
||||||
<Compile Include="Atn\TransitionType.cs" />
|
|
||||||
<Compile Include="Atn\WildcardTransition.cs" />
|
|
||||||
<Compile Include="BailErrorStrategy.cs" />
|
|
||||||
<Compile Include="BaseErrorListener.cs" />
|
|
||||||
<Compile Include="BufferedTokenStream.cs" />
|
|
||||||
<Compile Include="CommonToken.cs" />
|
|
||||||
<Compile Include="CommonTokenFactory.cs" />
|
|
||||||
<Compile Include="CommonTokenStream.cs" />
|
|
||||||
<Compile Include="ConsoleErrorListener.cs" />
|
|
||||||
<Compile Include="DefaultErrorStrategy.cs" />
|
|
||||||
<Compile Include="Dependents.cs" />
|
|
||||||
<Compile Include="Dfa\AbstractEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\AcceptStateInfo.cs" />
|
|
||||||
<Compile Include="Dfa\ArrayEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\DFA.cs" />
|
|
||||||
<Compile Include="Dfa\DFASerializer.cs" />
|
|
||||||
<Compile Include="Dfa\DFAState.cs" />
|
|
||||||
<Compile Include="Dfa\EmptyEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\IEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\LexerDFASerializer.cs" />
|
|
||||||
<Compile Include="Dfa\SingletonEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\SparseEdgeMap`1.cs" />
|
|
||||||
<Compile Include="DiagnosticErrorListener.cs" />
|
|
||||||
<Compile Include="FailedPredicateException.cs" />
|
|
||||||
<Compile Include="IAntlrErrorListener`1.cs" />
|
|
||||||
<Compile Include="IAntlrErrorStrategy.cs" />
|
|
||||||
<Compile Include="ICharStream.cs" />
|
|
||||||
<Compile Include="IIntStream.cs" />
|
|
||||||
<Compile Include="InputMismatchException.cs" />
|
|
||||||
<Compile Include="InterpreterRuleContext.cs" />
|
|
||||||
<Compile Include="IParserErrorListener.cs" />
|
|
||||||
<Compile Include="IRecognizer.cs" />
|
|
||||||
<Compile Include="IToken.cs" />
|
|
||||||
<Compile Include="ITokenFactory.cs" />
|
|
||||||
<Compile Include="ITokenSource.cs" />
|
|
||||||
<Compile Include="ITokenStream.cs" />
|
|
||||||
<Compile Include="IVocabulary.cs" />
|
|
||||||
<Compile Include="IWritableToken.cs" />
|
|
||||||
<Compile Include="Lexer.cs" />
|
|
||||||
<Compile Include="LexerInterpreter.cs" />
|
|
||||||
<Compile Include="LexerNoViableAltException.cs" />
|
|
||||||
<Compile Include="ListTokenSource.cs" />
|
|
||||||
<Compile Include="Misc\Args.cs" />
|
|
||||||
<None Include="..\..\..\..\..\..\keys\antlr\antlr-net35-cf.snk">
|
|
||||||
<Link>antlr-net35-cf.snk</Link>
|
|
||||||
</None>
|
|
||||||
<None Include="Misc\Array2DHashSet`1.cs" />
|
|
||||||
<Compile Include="Misc\MurmurHash.cs" />
|
|
||||||
<Compile Include="Misc\NullableAttribute.cs" />
|
|
||||||
<None Include="Misc\DoubleKeyMap`3.cs" />
|
|
||||||
<Compile Include="Misc\IIntSet.cs" />
|
|
||||||
<Compile Include="Misc\Interval.cs" />
|
|
||||||
<Compile Include="Misc\IntervalSet.cs" />
|
|
||||||
<Compile Include="Misc\MultiMap`2.cs" />
|
|
||||||
<Compile Include="Misc\NotNullAttribute.cs" />
|
|
||||||
<None Include="Misc\OrderedHashSet`1.cs" />
|
|
||||||
<Compile Include="Misc\ParseCanceledException.cs" />
|
|
||||||
<Compile Include="Misc\RuleDependencyChecker.cs" />
|
|
||||||
<None Include="Misc\RuleDependencyProcessor.cs" />
|
|
||||||
<None Include="Misc\TestRig.cs" />
|
|
||||||
<Compile Include="Misc\Utils.cs" />
|
|
||||||
<Compile Include="NoViableAltException.cs" />
|
|
||||||
<Compile Include="Parser.cs" />
|
|
||||||
<Compile Include="ParserInterpreter.cs" />
|
|
||||||
<Compile Include="ParserRuleContext.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
<Compile Include="ProxyErrorListener`1.cs" />
|
|
||||||
<Compile Include="ProxyParserErrorListener.cs" />
|
|
||||||
<Compile Include="RecognitionException.cs" />
|
|
||||||
<Compile Include="Recognizer`2.cs" />
|
|
||||||
<Compile Include="RuleContext.cs" />
|
|
||||||
<Compile Include="RuleDependencyAttribute.cs" />
|
|
||||||
<Compile Include="RuleVersionAttribute.cs" />
|
|
||||||
<Compile Include="Sharpen\Arrays.cs" />
|
|
||||||
<Compile Include="Sharpen\AtomicReference`1.cs" />
|
|
||||||
<Compile Include="Sharpen\BitSet.cs" />
|
|
||||||
<Compile Include="Sharpen\Collections.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\CollectionDebuggerView`2.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\ConcurrentDictionary`2.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\Enumerable.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\ExtensionAttribute.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\Funcs.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\HashSet`1.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\IStructuralComparable.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\IStructuralEquatable.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\SplitOrderedList`2.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\Tuple.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\Tuples.cs" />
|
|
||||||
<Compile Include="Sharpen\DictionaryExtensions.cs" />
|
|
||||||
<Compile Include="Sharpen\ListExtensions.cs" />
|
|
||||||
<Compile Include="Sharpen\Runtime.cs" />
|
|
||||||
<Compile Include="Sharpen\SequenceEqualityComparer`1.cs" />
|
|
||||||
<Compile Include="TokenStreamRewriter.cs" />
|
|
||||||
<Compile Include="TokenTypes.cs" />
|
|
||||||
<Compile Include="Tree\AbstractParseTreeVisitor`1.cs" />
|
|
||||||
<Compile Include="Tree\ErrorNodeImpl.cs" />
|
|
||||||
<Compile Include="Tree\IErrorNode.cs" />
|
|
||||||
<Compile Include="Tree\IParseTree.cs" />
|
|
||||||
<Compile Include="Tree\IParseTreeListener.cs" />
|
|
||||||
<Compile Include="Tree\IParseTreeVisitor`1.cs" />
|
|
||||||
<Compile Include="Tree\IRuleNode.cs" />
|
|
||||||
<Compile Include="Tree\ISyntaxTree.cs" />
|
|
||||||
<Compile Include="Tree\ITerminalNode.cs" />
|
|
||||||
<Compile Include="Tree\ITree.cs" />
|
|
||||||
<Compile Include="Tree\ParseTreeProperty`1.cs" />
|
|
||||||
<Compile Include="Tree\ParseTreeWalker.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\Chunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreeMatch.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreePattern.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreePatternMatcher.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\RuleTagToken.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TagChunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TextChunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TokenTagToken.cs" />
|
|
||||||
<Compile Include="Tree\TerminalNodeImpl.cs" />
|
|
||||||
<Compile Include="Tree\Trees.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPath.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathLexerErrorListener.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathRuleAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathRuleElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathTokenAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathTokenElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathWildcardAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathWildcardElement.cs" />
|
|
||||||
<Compile Include="UnbufferedCharStream.cs" />
|
|
||||||
<Compile Include="UnbufferedTokenStream.cs" />
|
|
||||||
<Compile Include="Vocabulary.cs" />
|
|
||||||
<None Include="packages.Antlr4.Runtime.net35-cf.config" />
|
|
||||||
<Antlr4 Include="Tree\Xpath\XPathLexer.g4">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<CustomToolNamespace>Antlr4.Runtime.Tree.Xpath</CustomToolNamespace>
|
|
||||||
</Antlr4>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
|
|
||||||
<ProjectExtensions>
|
|
||||||
<VisualStudio>
|
|
||||||
<FlavorProperties GUID="{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}">
|
|
||||||
<HostingProcess disable="1" />
|
|
||||||
</FlavorProperties>
|
|
||||||
</VisualStudio>
|
|
||||||
</ProjectExtensions>
|
|
||||||
<Import Project="..\packages\Antlr4.VS2008.4.2.1-alpha001\build\Antlr4.targets" Condition="Exists('..\packages\Antlr4.VS2008.4.2.1-alpha001\build\Antlr4.targets')" />
|
|
||||||
<Import Project="$(SolutionDir)\.nuget\NuGet.VS2008.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.VS2008.targets')" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
|
@ -1,276 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.props" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" />
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{E186FDA3-1411-47EE-94C7-9F3745F0474B}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>Antlr4.Runtime</RootNamespace>
|
|
||||||
<AssemblyName>Antlr4.Runtime</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
|
||||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<BaseIntermediateOutputPath>obj\net35-client\</BaseIntermediateOutputPath>
|
|
||||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
|
||||||
<RestorePackages>true</RestorePackages>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\net35-client\Debug\</OutputPath>
|
|
||||||
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
|
|
||||||
<DefineConstants>DEBUG;TRACE;NET35;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<NoWarn>1591</NoWarn>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\net35-client\Release\</OutputPath>
|
|
||||||
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
|
|
||||||
<DefineConstants>TRACE;NET35;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<NoWarn>1591</NoWarn>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<SignAssembly>true</SignAssembly>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<AssemblyOriginatorKeyFile>..\..\..\..\..\..\keys\antlr\antlr-net35-client.snk</AssemblyOriginatorKeyFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Core" />
|
|
||||||
<Reference Include="System.Xml.Linq" />
|
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="AntlrFileStream.cs" />
|
|
||||||
<Compile Include="AntlrInputStream.cs" />
|
|
||||||
<Compile Include="Atn\AbstractPredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\ActionTransition.cs" />
|
|
||||||
<Compile Include="Atn\AmbiguityInfo.cs" />
|
|
||||||
<Compile Include="Atn\ArrayPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\ATN.cs" />
|
|
||||||
<Compile Include="Atn\ATNConfig.cs" />
|
|
||||||
<Compile Include="Atn\ATNConfigSet.cs" />
|
|
||||||
<Compile Include="Atn\ATNDeserializationOptions.cs" />
|
|
||||||
<Compile Include="Atn\ATNDeserializer.cs" />
|
|
||||||
<Compile Include="Atn\ConflictInfo.cs" />
|
|
||||||
<Compile Include="Dfa\AcceptStateInfo.cs" />
|
|
||||||
<Compile Include="Dfa\EmptyEdgeMap`1.cs" />
|
|
||||||
<Compile Include="IVocabulary.cs" />
|
|
||||||
<Compile Include="Vocabulary.cs" />
|
|
||||||
<None Include="Atn\ATNSerializer.cs" />
|
|
||||||
<Compile Include="Atn\ATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\ATNState.cs" />
|
|
||||||
<Compile Include="Atn\ATNType.cs" />
|
|
||||||
<Compile Include="Atn\AtomTransition.cs" />
|
|
||||||
<Compile Include="Atn\BasicBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\BasicState.cs" />
|
|
||||||
<Compile Include="Atn\BlockEndState.cs" />
|
|
||||||
<Compile Include="Atn\BlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\ContextSensitivityInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionEventInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionState.cs" />
|
|
||||||
<Compile Include="Atn\EmptyPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\EpsilonTransition.cs" />
|
|
||||||
<Compile Include="Atn\ErrorInfo.cs" />
|
|
||||||
<Compile Include="Atn\ILexerAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerActionExecutor.cs" />
|
|
||||||
<Compile Include="Atn\LexerActionType.cs" />
|
|
||||||
<Compile Include="Atn\LexerATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\LexerChannelAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerCustomAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerIndexedCustomAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerMoreAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerPopModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerPushModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerSkipAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerTypeAction.cs" />
|
|
||||||
<Compile Include="Atn\LL1Analyzer.cs" />
|
|
||||||
<Compile Include="Atn\LookaheadEventInfo.cs" />
|
|
||||||
<Compile Include="Atn\LoopEndState.cs" />
|
|
||||||
<Compile Include="Atn\NotSetTransition.cs" />
|
|
||||||
<Compile Include="Atn\OrderedATNConfigSet.cs" />
|
|
||||||
<Compile Include="Atn\ParseInfo.cs" />
|
|
||||||
<Compile Include="Atn\ParserATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\PlusBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\PlusLoopbackState.cs" />
|
|
||||||
<Compile Include="Atn\PrecedencePredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\PredicateEvalInfo.cs" />
|
|
||||||
<Compile Include="Atn\PredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\PredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\PredictionContextCache.cs" />
|
|
||||||
<Compile Include="Atn\PredictionMode.cs" />
|
|
||||||
<Compile Include="Atn\ProfilingATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\RangeTransition.cs" />
|
|
||||||
<Compile Include="Atn\RuleStartState.cs" />
|
|
||||||
<Compile Include="Atn\RuleStopState.cs" />
|
|
||||||
<Compile Include="Atn\RuleTransition.cs" />
|
|
||||||
<Compile Include="Atn\SemanticContext.cs" />
|
|
||||||
<Compile Include="Atn\SetTransition.cs" />
|
|
||||||
<Compile Include="Atn\SimulatorState.cs" />
|
|
||||||
<Compile Include="Atn\SingletonPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\StarBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\StarLoopbackState.cs" />
|
|
||||||
<Compile Include="Atn\StarLoopEntryState.cs" />
|
|
||||||
<Compile Include="Atn\StateType.cs" />
|
|
||||||
<Compile Include="Atn\TokensStartState.cs" />
|
|
||||||
<Compile Include="Atn\Transition.cs" />
|
|
||||||
<Compile Include="Atn\TransitionType.cs" />
|
|
||||||
<Compile Include="Atn\WildcardTransition.cs" />
|
|
||||||
<Compile Include="BailErrorStrategy.cs" />
|
|
||||||
<Compile Include="BaseErrorListener.cs" />
|
|
||||||
<Compile Include="BufferedTokenStream.cs" />
|
|
||||||
<Compile Include="CommonToken.cs" />
|
|
||||||
<Compile Include="CommonTokenFactory.cs" />
|
|
||||||
<Compile Include="CommonTokenStream.cs" />
|
|
||||||
<Compile Include="ConsoleErrorListener.cs" />
|
|
||||||
<Compile Include="DefaultErrorStrategy.cs" />
|
|
||||||
<Compile Include="Dependents.cs" />
|
|
||||||
<Compile Include="Dfa\AbstractEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\ArrayEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\DFA.cs" />
|
|
||||||
<Compile Include="Dfa\DFASerializer.cs" />
|
|
||||||
<Compile Include="Dfa\DFAState.cs" />
|
|
||||||
<Compile Include="Dfa\IEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\LexerDFASerializer.cs" />
|
|
||||||
<Compile Include="Dfa\SingletonEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\SparseEdgeMap`1.cs" />
|
|
||||||
<Compile Include="DiagnosticErrorListener.cs" />
|
|
||||||
<Compile Include="FailedPredicateException.cs" />
|
|
||||||
<Compile Include="IAntlrErrorListener`1.cs" />
|
|
||||||
<Compile Include="IAntlrErrorStrategy.cs" />
|
|
||||||
<Compile Include="ICharStream.cs" />
|
|
||||||
<Compile Include="IIntStream.cs" />
|
|
||||||
<Compile Include="InputMismatchException.cs" />
|
|
||||||
<Compile Include="InterpreterRuleContext.cs" />
|
|
||||||
<Compile Include="IParserErrorListener.cs" />
|
|
||||||
<Compile Include="IRecognizer.cs" />
|
|
||||||
<Compile Include="IToken.cs" />
|
|
||||||
<Compile Include="ITokenFactory.cs" />
|
|
||||||
<Compile Include="ITokenSource.cs" />
|
|
||||||
<Compile Include="ITokenStream.cs" />
|
|
||||||
<Compile Include="IWritableToken.cs" />
|
|
||||||
<Compile Include="Lexer.cs" />
|
|
||||||
<Compile Include="LexerInterpreter.cs" />
|
|
||||||
<Compile Include="LexerNoViableAltException.cs" />
|
|
||||||
<Compile Include="ListTokenSource.cs" />
|
|
||||||
<Compile Include="Misc\Args.cs" />
|
|
||||||
<None Include="..\..\..\..\..\..\keys\antlr\antlr-net35-client.snk">
|
|
||||||
<Link>antlr-net35-client.snk</Link>
|
|
||||||
</None>
|
|
||||||
<None Include="Misc\Array2DHashSet`1.cs" />
|
|
||||||
<Compile Include="Misc\MurmurHash.cs" />
|
|
||||||
<Compile Include="Misc\NullableAttribute.cs" />
|
|
||||||
<None Include="Misc\DoubleKeyMap`3.cs" />
|
|
||||||
<Compile Include="Misc\IIntSet.cs" />
|
|
||||||
<Compile Include="Misc\Interval.cs" />
|
|
||||||
<Compile Include="Misc\IntervalSet.cs" />
|
|
||||||
<Compile Include="Misc\MultiMap`2.cs" />
|
|
||||||
<Compile Include="Misc\NotNullAttribute.cs" />
|
|
||||||
<None Include="Misc\OrderedHashSet`1.cs" />
|
|
||||||
<Compile Include="Misc\ParseCanceledException.cs" />
|
|
||||||
<Compile Include="Misc\RuleDependencyChecker.cs" />
|
|
||||||
<None Include="Misc\RuleDependencyProcessor.cs" />
|
|
||||||
<None Include="Misc\TestRig.cs" />
|
|
||||||
<Compile Include="Misc\Utils.cs" />
|
|
||||||
<Compile Include="NoViableAltException.cs" />
|
|
||||||
<Compile Include="Parser.cs" />
|
|
||||||
<Compile Include="ParserInterpreter.cs" />
|
|
||||||
<Compile Include="ParserRuleContext.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
<Compile Include="ProxyErrorListener`1.cs" />
|
|
||||||
<Compile Include="ProxyParserErrorListener.cs" />
|
|
||||||
<Compile Include="RecognitionException.cs" />
|
|
||||||
<Compile Include="Recognizer`2.cs" />
|
|
||||||
<Compile Include="RuleContext.cs" />
|
|
||||||
<Compile Include="RuleDependencyAttribute.cs" />
|
|
||||||
<Compile Include="RuleVersionAttribute.cs" />
|
|
||||||
<Compile Include="Sharpen\Arrays.cs" />
|
|
||||||
<Compile Include="Sharpen\AtomicReference`1.cs" />
|
|
||||||
<Compile Include="Sharpen\BitSet.cs" />
|
|
||||||
<Compile Include="Sharpen\Collections.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\CollectionDebuggerView`2.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\ConcurrentDictionary`2.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\IStructuralComparable.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\IStructuralEquatable.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\SplitOrderedList`2.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\Tuple.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\Tuples.cs" />
|
|
||||||
<Compile Include="Sharpen\DictionaryExtensions.cs" />
|
|
||||||
<Compile Include="Sharpen\ListExtensions.cs" />
|
|
||||||
<Compile Include="Sharpen\Runtime.cs" />
|
|
||||||
<Compile Include="Sharpen\SequenceEqualityComparer`1.cs" />
|
|
||||||
<Compile Include="TokenStreamRewriter.cs" />
|
|
||||||
<Compile Include="TokenTypes.cs" />
|
|
||||||
<Compile Include="Tree\AbstractParseTreeVisitor`1.cs" />
|
|
||||||
<Compile Include="Tree\ErrorNodeImpl.cs" />
|
|
||||||
<Compile Include="Tree\IErrorNode.cs" />
|
|
||||||
<Compile Include="Tree\IParseTree.cs" />
|
|
||||||
<Compile Include="Tree\IParseTreeListener.cs" />
|
|
||||||
<Compile Include="Tree\IParseTreeVisitor`1.cs" />
|
|
||||||
<Compile Include="Tree\IRuleNode.cs" />
|
|
||||||
<Compile Include="Tree\ISyntaxTree.cs" />
|
|
||||||
<Compile Include="Tree\ITerminalNode.cs" />
|
|
||||||
<Compile Include="Tree\ITree.cs" />
|
|
||||||
<Compile Include="Tree\ParseTreeProperty`1.cs" />
|
|
||||||
<Compile Include="Tree\ParseTreeWalker.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\Chunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreeMatch.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreePattern.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreePatternMatcher.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\RuleTagToken.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TagChunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TextChunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TokenTagToken.cs" />
|
|
||||||
<Compile Include="Tree\TerminalNodeImpl.cs" />
|
|
||||||
<Compile Include="Tree\Trees.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPath.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathLexerErrorListener.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathRuleAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathRuleElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathTokenAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathTokenElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathWildcardAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathWildcardElement.cs" />
|
|
||||||
<Compile Include="UnbufferedCharStream.cs" />
|
|
||||||
<Compile Include="UnbufferedTokenStream.cs" />
|
|
||||||
<None Include="packages.Antlr4.Runtime.net35-client.config" />
|
|
||||||
<Antlr4 Include="Tree\Xpath\XPathLexer.g4">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<CustomToolNamespace>Antlr4.Runtime.Tree.Xpath</CustomToolNamespace>
|
|
||||||
</Antlr4>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<Import Project="$(SolutionDir)\build\KeyReporting.targets" />
|
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.props'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.targets'))" />
|
|
||||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
|
||||||
</Target>
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.targets" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" />
|
|
||||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
|
@ -1,270 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.props" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" />
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{423978DF-85A4-409E-A16C-453683FE3969}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>Antlr4.Runtime</RootNamespace>
|
|
||||||
<AssemblyName>Antlr4.Runtime</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
|
||||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<BaseIntermediateOutputPath>obj\net40-client\</BaseIntermediateOutputPath>
|
|
||||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
|
||||||
<RestorePackages>true</RestorePackages>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\net40-client\Debug\</OutputPath>
|
|
||||||
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
|
|
||||||
<DefineConstants>TRACE;DEBUG;NET40;NET40PLUS;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<NoWarn>1591</NoWarn>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\net40-client\Release\</OutputPath>
|
|
||||||
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
|
|
||||||
<DefineConstants>TRACE;NET40;NET40PLUS;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<NoWarn>1591</NoWarn>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<SignAssembly>true</SignAssembly>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<AssemblyOriginatorKeyFile>..\..\..\..\..\..\keys\antlr\antlr-net40-client.snk</AssemblyOriginatorKeyFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Core" />
|
|
||||||
<Reference Include="System.Xml.Linq" />
|
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
|
||||||
<Reference Include="Microsoft.CSharp" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="AntlrFileStream.cs" />
|
|
||||||
<Compile Include="AntlrInputStream.cs" />
|
|
||||||
<Compile Include="Atn\AbstractPredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\ActionTransition.cs" />
|
|
||||||
<Compile Include="Atn\AmbiguityInfo.cs" />
|
|
||||||
<Compile Include="Atn\ArrayPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\ATN.cs" />
|
|
||||||
<Compile Include="Atn\ATNConfig.cs" />
|
|
||||||
<Compile Include="Atn\ATNConfigSet.cs" />
|
|
||||||
<Compile Include="Atn\ATNDeserializationOptions.cs" />
|
|
||||||
<Compile Include="Atn\ATNDeserializer.cs" />
|
|
||||||
<Compile Include="Atn\ConflictInfo.cs" />
|
|
||||||
<Compile Include="Dfa\AcceptStateInfo.cs" />
|
|
||||||
<Compile Include="Dfa\EmptyEdgeMap`1.cs" />
|
|
||||||
<Compile Include="IVocabulary.cs" />
|
|
||||||
<Compile Include="Vocabulary.cs" />
|
|
||||||
<None Include="Atn\ATNSerializer.cs" />
|
|
||||||
<Compile Include="Atn\ATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\ATNState.cs" />
|
|
||||||
<Compile Include="Atn\ATNType.cs" />
|
|
||||||
<Compile Include="Atn\AtomTransition.cs" />
|
|
||||||
<Compile Include="Atn\BasicBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\BasicState.cs" />
|
|
||||||
<Compile Include="Atn\BlockEndState.cs" />
|
|
||||||
<Compile Include="Atn\BlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\ContextSensitivityInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionEventInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionState.cs" />
|
|
||||||
<Compile Include="Atn\EmptyPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\EpsilonTransition.cs" />
|
|
||||||
<Compile Include="Atn\ErrorInfo.cs" />
|
|
||||||
<Compile Include="Atn\ILexerAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerActionExecutor.cs" />
|
|
||||||
<Compile Include="Atn\LexerActionType.cs" />
|
|
||||||
<Compile Include="Atn\LexerATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\LexerChannelAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerCustomAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerIndexedCustomAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerMoreAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerPopModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerPushModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerSkipAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerTypeAction.cs" />
|
|
||||||
<Compile Include="Atn\LL1Analyzer.cs" />
|
|
||||||
<Compile Include="Atn\LookaheadEventInfo.cs" />
|
|
||||||
<Compile Include="Atn\LoopEndState.cs" />
|
|
||||||
<Compile Include="Atn\NotSetTransition.cs" />
|
|
||||||
<Compile Include="Atn\OrderedATNConfigSet.cs" />
|
|
||||||
<Compile Include="Atn\ParseInfo.cs" />
|
|
||||||
<Compile Include="Atn\ParserATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\PlusBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\PlusLoopbackState.cs" />
|
|
||||||
<Compile Include="Atn\PrecedencePredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\PredicateEvalInfo.cs" />
|
|
||||||
<Compile Include="Atn\PredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\PredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\PredictionContextCache.cs" />
|
|
||||||
<Compile Include="Atn\PredictionMode.cs" />
|
|
||||||
<Compile Include="Atn\ProfilingATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\RangeTransition.cs" />
|
|
||||||
<Compile Include="Atn\RuleStartState.cs" />
|
|
||||||
<Compile Include="Atn\RuleStopState.cs" />
|
|
||||||
<Compile Include="Atn\RuleTransition.cs" />
|
|
||||||
<Compile Include="Atn\SemanticContext.cs" />
|
|
||||||
<Compile Include="Atn\SetTransition.cs" />
|
|
||||||
<Compile Include="Atn\SimulatorState.cs" />
|
|
||||||
<Compile Include="Atn\SingletonPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\StarBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\StarLoopbackState.cs" />
|
|
||||||
<Compile Include="Atn\StarLoopEntryState.cs" />
|
|
||||||
<Compile Include="Atn\StateType.cs" />
|
|
||||||
<Compile Include="Atn\TokensStartState.cs" />
|
|
||||||
<Compile Include="Atn\Transition.cs" />
|
|
||||||
<Compile Include="Atn\TransitionType.cs" />
|
|
||||||
<Compile Include="Atn\WildcardTransition.cs" />
|
|
||||||
<Compile Include="BailErrorStrategy.cs" />
|
|
||||||
<Compile Include="BaseErrorListener.cs" />
|
|
||||||
<Compile Include="BufferedTokenStream.cs" />
|
|
||||||
<Compile Include="CommonToken.cs" />
|
|
||||||
<Compile Include="CommonTokenFactory.cs" />
|
|
||||||
<Compile Include="CommonTokenStream.cs" />
|
|
||||||
<Compile Include="ConsoleErrorListener.cs" />
|
|
||||||
<Compile Include="DefaultErrorStrategy.cs" />
|
|
||||||
<Compile Include="Dependents.cs" />
|
|
||||||
<Compile Include="Dfa\AbstractEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\ArrayEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\DFA.cs" />
|
|
||||||
<Compile Include="Dfa\DFASerializer.cs" />
|
|
||||||
<Compile Include="Dfa\DFAState.cs" />
|
|
||||||
<Compile Include="Dfa\IEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\LexerDFASerializer.cs" />
|
|
||||||
<Compile Include="Dfa\SingletonEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\SparseEdgeMap`1.cs" />
|
|
||||||
<Compile Include="DiagnosticErrorListener.cs" />
|
|
||||||
<Compile Include="FailedPredicateException.cs" />
|
|
||||||
<Compile Include="IAntlrErrorListener`1.cs" />
|
|
||||||
<Compile Include="IAntlrErrorStrategy.cs" />
|
|
||||||
<Compile Include="ICharStream.cs" />
|
|
||||||
<Compile Include="IIntStream.cs" />
|
|
||||||
<Compile Include="InputMismatchException.cs" />
|
|
||||||
<Compile Include="InterpreterRuleContext.cs" />
|
|
||||||
<Compile Include="IParserErrorListener.cs" />
|
|
||||||
<Compile Include="IRecognizer.cs" />
|
|
||||||
<Compile Include="IToken.cs" />
|
|
||||||
<Compile Include="ITokenFactory.cs" />
|
|
||||||
<Compile Include="ITokenSource.cs" />
|
|
||||||
<Compile Include="ITokenStream.cs" />
|
|
||||||
<Compile Include="IWritableToken.cs" />
|
|
||||||
<Compile Include="Lexer.cs" />
|
|
||||||
<Compile Include="LexerInterpreter.cs" />
|
|
||||||
<Compile Include="LexerNoViableAltException.cs" />
|
|
||||||
<Compile Include="ListTokenSource.cs" />
|
|
||||||
<Compile Include="Misc\Args.cs" />
|
|
||||||
<None Include="..\..\..\..\..\..\keys\antlr\antlr-net40-client.snk">
|
|
||||||
<Link>antlr-net40-client.snk</Link>
|
|
||||||
</None>
|
|
||||||
<None Include="Misc\Array2DHashSet`1.cs" />
|
|
||||||
<Compile Include="Misc\MurmurHash.cs" />
|
|
||||||
<Compile Include="Misc\NullableAttribute.cs" />
|
|
||||||
<None Include="Misc\DoubleKeyMap`3.cs" />
|
|
||||||
<Compile Include="Misc\IIntSet.cs" />
|
|
||||||
<Compile Include="Misc\Interval.cs" />
|
|
||||||
<Compile Include="Misc\IntervalSet.cs" />
|
|
||||||
<Compile Include="Misc\MultiMap`2.cs" />
|
|
||||||
<Compile Include="Misc\NotNullAttribute.cs" />
|
|
||||||
<None Include="Misc\OrderedHashSet`1.cs" />
|
|
||||||
<Compile Include="Misc\ParseCanceledException.cs" />
|
|
||||||
<Compile Include="Misc\RuleDependencyChecker.cs" />
|
|
||||||
<None Include="Misc\RuleDependencyProcessor.cs" />
|
|
||||||
<None Include="Misc\TestRig.cs" />
|
|
||||||
<Compile Include="Misc\Utils.cs" />
|
|
||||||
<Compile Include="NoViableAltException.cs" />
|
|
||||||
<Compile Include="Parser.cs" />
|
|
||||||
<Compile Include="ParserInterpreter.cs" />
|
|
||||||
<Compile Include="ParserRuleContext.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
<Compile Include="ProxyErrorListener`1.cs" />
|
|
||||||
<Compile Include="ProxyParserErrorListener.cs" />
|
|
||||||
<Compile Include="RecognitionException.cs" />
|
|
||||||
<Compile Include="Recognizer`2.cs" />
|
|
||||||
<Compile Include="RuleContext.cs" />
|
|
||||||
<Compile Include="RuleDependencyAttribute.cs" />
|
|
||||||
<Compile Include="RuleVersionAttribute.cs" />
|
|
||||||
<Compile Include="Sharpen\Arrays.cs" />
|
|
||||||
<Compile Include="Sharpen\AtomicReference`1.cs" />
|
|
||||||
<Compile Include="Sharpen\BitSet.cs" />
|
|
||||||
<Compile Include="Sharpen\Collections.cs" />
|
|
||||||
<Compile Include="Sharpen\DictionaryExtensions.cs" />
|
|
||||||
<Compile Include="Sharpen\ListExtensions.cs" />
|
|
||||||
<Compile Include="Sharpen\Runtime.cs" />
|
|
||||||
<Compile Include="Sharpen\SequenceEqualityComparer`1.cs" />
|
|
||||||
<Compile Include="TokenStreamRewriter.cs" />
|
|
||||||
<Compile Include="TokenTypes.cs" />
|
|
||||||
<Compile Include="Tree\AbstractParseTreeVisitor`1.cs" />
|
|
||||||
<Compile Include="Tree\ErrorNodeImpl.cs" />
|
|
||||||
<Compile Include="Tree\IErrorNode.cs" />
|
|
||||||
<Compile Include="Tree\IParseTree.cs" />
|
|
||||||
<Compile Include="Tree\IParseTreeListener.cs" />
|
|
||||||
<Compile Include="Tree\IParseTreeVisitor`1.cs" />
|
|
||||||
<Compile Include="Tree\IRuleNode.cs" />
|
|
||||||
<Compile Include="Tree\ISyntaxTree.cs" />
|
|
||||||
<Compile Include="Tree\ITerminalNode.cs" />
|
|
||||||
<Compile Include="Tree\ITree.cs" />
|
|
||||||
<Compile Include="Tree\ParseTreeProperty`1.cs" />
|
|
||||||
<Compile Include="Tree\ParseTreeWalker.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\Chunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreeMatch.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreePattern.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreePatternMatcher.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\RuleTagToken.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TagChunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TextChunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TokenTagToken.cs" />
|
|
||||||
<Compile Include="Tree\TerminalNodeImpl.cs" />
|
|
||||||
<Compile Include="Tree\Trees.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPath.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathLexerErrorListener.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathRuleAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathRuleElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathTokenAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathTokenElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathWildcardAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathWildcardElement.cs" />
|
|
||||||
<Compile Include="UnbufferedCharStream.cs" />
|
|
||||||
<Compile Include="UnbufferedTokenStream.cs" />
|
|
||||||
<None Include="packages.Antlr4.Runtime.net40-client.config" />
|
|
||||||
<Antlr4 Include="Tree\Xpath\XPathLexer.g4">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<CustomToolNamespace>Antlr4.Runtime.Tree.Xpath</CustomToolNamespace>
|
|
||||||
</Antlr4>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<Import Project="$(SolutionDir)\build\KeyReporting.targets" />
|
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.props'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.targets'))" />
|
|
||||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
|
||||||
</Target>
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.targets" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" />
|
|
||||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
|
@ -1,269 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.props" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" />
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{E1D192DE-5347-48C4-A9F4-A8CBA2AF3869}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>Antlr4.Runtime</RootNamespace>
|
|
||||||
<AssemblyName>Antlr4.Runtime</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<BaseIntermediateOutputPath>obj\net45\</BaseIntermediateOutputPath>
|
|
||||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
|
||||||
<RestorePackages>true</RestorePackages>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\net45\Debug\</OutputPath>
|
|
||||||
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
|
|
||||||
<DefineConstants>TRACE;DEBUG;NET45;NET45PLUS;NET40PLUS;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<NoWarn>1591</NoWarn>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\net45\Release\</OutputPath>
|
|
||||||
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
|
|
||||||
<DefineConstants>TRACE;NET45;NET45PLUS;NET40PLUS;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<NoWarn>1591</NoWarn>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<SignAssembly>true</SignAssembly>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<AssemblyOriginatorKeyFile>..\..\..\..\..\..\keys\antlr\antlr-net45.snk</AssemblyOriginatorKeyFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Core" />
|
|
||||||
<Reference Include="System.Xml.Linq" />
|
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
|
||||||
<Reference Include="Microsoft.CSharp" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="AntlrFileStream.cs" />
|
|
||||||
<Compile Include="AntlrInputStream.cs" />
|
|
||||||
<Compile Include="Atn\AbstractPredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\ActionTransition.cs" />
|
|
||||||
<Compile Include="Atn\AmbiguityInfo.cs" />
|
|
||||||
<Compile Include="Atn\ArrayPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\ATN.cs" />
|
|
||||||
<Compile Include="Atn\ATNConfig.cs" />
|
|
||||||
<Compile Include="Atn\ATNConfigSet.cs" />
|
|
||||||
<Compile Include="Atn\ATNDeserializationOptions.cs" />
|
|
||||||
<Compile Include="Atn\ATNDeserializer.cs" />
|
|
||||||
<None Include="Atn\ATNSerializer.cs" />
|
|
||||||
<Compile Include="Atn\ATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\ATNState.cs" />
|
|
||||||
<Compile Include="Atn\ATNType.cs" />
|
|
||||||
<Compile Include="Atn\AtomTransition.cs" />
|
|
||||||
<Compile Include="Atn\BasicBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\BasicState.cs" />
|
|
||||||
<Compile Include="Atn\BlockEndState.cs" />
|
|
||||||
<Compile Include="Atn\BlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\ConflictInfo.cs" />
|
|
||||||
<Compile Include="Atn\ContextSensitivityInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionEventInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionState.cs" />
|
|
||||||
<Compile Include="Atn\EmptyPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\EpsilonTransition.cs" />
|
|
||||||
<Compile Include="Atn\ErrorInfo.cs" />
|
|
||||||
<Compile Include="Atn\ILexerAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerActionExecutor.cs" />
|
|
||||||
<Compile Include="Atn\LexerActionType.cs" />
|
|
||||||
<Compile Include="Atn\LexerATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\LexerChannelAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerCustomAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerIndexedCustomAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerMoreAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerPopModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerPushModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerSkipAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerTypeAction.cs" />
|
|
||||||
<Compile Include="Atn\LL1Analyzer.cs" />
|
|
||||||
<Compile Include="Atn\LookaheadEventInfo.cs" />
|
|
||||||
<Compile Include="Atn\LoopEndState.cs" />
|
|
||||||
<Compile Include="Atn\NotSetTransition.cs" />
|
|
||||||
<Compile Include="Atn\OrderedATNConfigSet.cs" />
|
|
||||||
<Compile Include="Atn\ParseInfo.cs" />
|
|
||||||
<Compile Include="Atn\ParserATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\PlusBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\PlusLoopbackState.cs" />
|
|
||||||
<Compile Include="Atn\PrecedencePredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\PredicateEvalInfo.cs" />
|
|
||||||
<Compile Include="Atn\PredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\PredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\PredictionContextCache.cs" />
|
|
||||||
<Compile Include="Atn\PredictionMode.cs" />
|
|
||||||
<Compile Include="Atn\ProfilingATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\RangeTransition.cs" />
|
|
||||||
<Compile Include="Atn\RuleStartState.cs" />
|
|
||||||
<Compile Include="Atn\RuleStopState.cs" />
|
|
||||||
<Compile Include="Atn\RuleTransition.cs" />
|
|
||||||
<Compile Include="Atn\SemanticContext.cs" />
|
|
||||||
<Compile Include="Atn\SetTransition.cs" />
|
|
||||||
<Compile Include="Atn\SimulatorState.cs" />
|
|
||||||
<Compile Include="Atn\SingletonPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\StarBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\StarLoopbackState.cs" />
|
|
||||||
<Compile Include="Atn\StarLoopEntryState.cs" />
|
|
||||||
<Compile Include="Atn\StateType.cs" />
|
|
||||||
<Compile Include="Atn\TokensStartState.cs" />
|
|
||||||
<Compile Include="Atn\Transition.cs" />
|
|
||||||
<Compile Include="Atn\TransitionType.cs" />
|
|
||||||
<Compile Include="Atn\WildcardTransition.cs" />
|
|
||||||
<Compile Include="BailErrorStrategy.cs" />
|
|
||||||
<Compile Include="BaseErrorListener.cs" />
|
|
||||||
<Compile Include="BufferedTokenStream.cs" />
|
|
||||||
<Compile Include="CommonToken.cs" />
|
|
||||||
<Compile Include="CommonTokenFactory.cs" />
|
|
||||||
<Compile Include="CommonTokenStream.cs" />
|
|
||||||
<Compile Include="ConsoleErrorListener.cs" />
|
|
||||||
<Compile Include="DefaultErrorStrategy.cs" />
|
|
||||||
<Compile Include="Dependents.cs" />
|
|
||||||
<Compile Include="Dfa\AbstractEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\AcceptStateInfo.cs" />
|
|
||||||
<Compile Include="Dfa\ArrayEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\DFA.cs" />
|
|
||||||
<Compile Include="Dfa\DFASerializer.cs" />
|
|
||||||
<Compile Include="Dfa\DFAState.cs" />
|
|
||||||
<Compile Include="Dfa\EmptyEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\IEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\LexerDFASerializer.cs" />
|
|
||||||
<Compile Include="Dfa\SingletonEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\SparseEdgeMap`1.cs" />
|
|
||||||
<Compile Include="DiagnosticErrorListener.cs" />
|
|
||||||
<Compile Include="FailedPredicateException.cs" />
|
|
||||||
<Compile Include="IAntlrErrorListener`1.cs" />
|
|
||||||
<Compile Include="IAntlrErrorStrategy.cs" />
|
|
||||||
<Compile Include="ICharStream.cs" />
|
|
||||||
<Compile Include="IIntStream.cs" />
|
|
||||||
<Compile Include="InputMismatchException.cs" />
|
|
||||||
<Compile Include="InterpreterRuleContext.cs" />
|
|
||||||
<Compile Include="IParserErrorListener.cs" />
|
|
||||||
<Compile Include="IRecognizer.cs" />
|
|
||||||
<Compile Include="IToken.cs" />
|
|
||||||
<Compile Include="ITokenFactory.cs" />
|
|
||||||
<Compile Include="ITokenSource.cs" />
|
|
||||||
<Compile Include="ITokenStream.cs" />
|
|
||||||
<Compile Include="IVocabulary.cs" />
|
|
||||||
<Compile Include="IWritableToken.cs" />
|
|
||||||
<Compile Include="Lexer.cs" />
|
|
||||||
<Compile Include="LexerInterpreter.cs" />
|
|
||||||
<Compile Include="LexerNoViableAltException.cs" />
|
|
||||||
<Compile Include="ListTokenSource.cs" />
|
|
||||||
<Compile Include="Misc\Args.cs" />
|
|
||||||
<None Include="..\..\..\..\..\..\keys\antlr\antlr-net45.snk">
|
|
||||||
<Link>antlr-net45.snk</Link>
|
|
||||||
</None>
|
|
||||||
<None Include="Misc\Array2DHashSet`1.cs" />
|
|
||||||
<Compile Include="Misc\NullableAttribute.cs" />
|
|
||||||
<None Include="Misc\DoubleKeyMap`3.cs" />
|
|
||||||
<Compile Include="Misc\IIntSet.cs" />
|
|
||||||
<Compile Include="Misc\Interval.cs" />
|
|
||||||
<Compile Include="Misc\IntervalSet.cs" />
|
|
||||||
<Compile Include="Misc\MultiMap`2.cs" />
|
|
||||||
<Compile Include="Misc\MurmurHash.cs" />
|
|
||||||
<Compile Include="Misc\NotNullAttribute.cs" />
|
|
||||||
<None Include="Misc\OrderedHashSet`1.cs" />
|
|
||||||
<Compile Include="Misc\ParseCanceledException.cs" />
|
|
||||||
<Compile Include="Misc\RuleDependencyChecker.cs" />
|
|
||||||
<None Include="Misc\RuleDependencyProcessor.cs" />
|
|
||||||
<None Include="Misc\TestRig.cs" />
|
|
||||||
<Compile Include="Misc\Utils.cs" />
|
|
||||||
<Compile Include="NoViableAltException.cs" />
|
|
||||||
<Compile Include="Parser.cs" />
|
|
||||||
<Compile Include="ParserInterpreter.cs" />
|
|
||||||
<Compile Include="ParserRuleContext.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
<Compile Include="ProxyErrorListener`1.cs" />
|
|
||||||
<Compile Include="ProxyParserErrorListener.cs" />
|
|
||||||
<Compile Include="RecognitionException.cs" />
|
|
||||||
<Compile Include="Recognizer`2.cs" />
|
|
||||||
<Compile Include="RuleContext.cs" />
|
|
||||||
<Compile Include="RuleDependencyAttribute.cs" />
|
|
||||||
<Compile Include="RuleVersionAttribute.cs" />
|
|
||||||
<Compile Include="Sharpen\Arrays.cs" />
|
|
||||||
<Compile Include="Sharpen\AtomicReference`1.cs" />
|
|
||||||
<Compile Include="Sharpen\BitSet.cs" />
|
|
||||||
<Compile Include="Sharpen\Collections.cs" />
|
|
||||||
<Compile Include="Sharpen\DictionaryExtensions.cs" />
|
|
||||||
<Compile Include="Sharpen\ListExtensions.cs" />
|
|
||||||
<Compile Include="Sharpen\Runtime.cs" />
|
|
||||||
<Compile Include="Sharpen\SequenceEqualityComparer`1.cs" />
|
|
||||||
<Compile Include="TokenStreamRewriter.cs" />
|
|
||||||
<Compile Include="TokenTypes.cs" />
|
|
||||||
<Compile Include="Tree\AbstractParseTreeVisitor`1.cs" />
|
|
||||||
<Compile Include="Tree\ErrorNodeImpl.cs" />
|
|
||||||
<Compile Include="Tree\IErrorNode.cs" />
|
|
||||||
<Compile Include="Tree\IParseTree.cs" />
|
|
||||||
<Compile Include="Tree\IParseTreeListener.cs" />
|
|
||||||
<Compile Include="Tree\IParseTreeVisitor`1.cs" />
|
|
||||||
<Compile Include="Tree\IRuleNode.cs" />
|
|
||||||
<Compile Include="Tree\ISyntaxTree.cs" />
|
|
||||||
<Compile Include="Tree\ITerminalNode.cs" />
|
|
||||||
<Compile Include="Tree\ITree.cs" />
|
|
||||||
<Compile Include="Tree\ParseTreeProperty`1.cs" />
|
|
||||||
<Compile Include="Tree\ParseTreeWalker.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\Chunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreeMatch.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreePattern.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreePatternMatcher.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\RuleTagToken.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TagChunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TextChunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TokenTagToken.cs" />
|
|
||||||
<Compile Include="Tree\TerminalNodeImpl.cs" />
|
|
||||||
<Compile Include="Tree\Trees.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPath.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathLexerErrorListener.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathRuleAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathRuleElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathTokenAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathTokenElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathWildcardAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathWildcardElement.cs" />
|
|
||||||
<Compile Include="UnbufferedCharStream.cs" />
|
|
||||||
<Compile Include="UnbufferedTokenStream.cs" />
|
|
||||||
<Compile Include="Vocabulary.cs" />
|
|
||||||
<None Include="packages.Antlr4.Runtime.net45.config" />
|
|
||||||
<Antlr4 Include="Tree\Xpath\XPathLexer.g4">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<CustomToolNamespace>Antlr4.Runtime.Tree.Xpath</CustomToolNamespace>
|
|
||||||
</Antlr4>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<Import Project="$(SolutionDir)\build\KeyReporting.targets" />
|
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.props'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.targets'))" />
|
|
||||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
|
||||||
</Target>
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.targets" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" />
|
|
||||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
|
@ -1,261 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.props" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" />
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{F3145DCA-EA26-4482-80D6-5232A79E2A3A}</ProjectGuid>
|
|
||||||
<ProjectTypeGuids>{BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>Antlr4.Runtime</RootNamespace>
|
|
||||||
<AssemblyName>Antlr4.Runtime</AssemblyName>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<BaseIntermediateOutputPath>obj\netcore45\</BaseIntermediateOutputPath>
|
|
||||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
|
||||||
<RestorePackages>true</RestorePackages>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\netcore45\Debug\</OutputPath>
|
|
||||||
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
|
|
||||||
<DefineConstants>TRACE;DEBUG;WINRT;PORTABLE;NET45;NET45PLUS;NET40PLUS;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<NoWarn>1591</NoWarn>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\netcore45\Release\</OutputPath>
|
|
||||||
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
|
|
||||||
<DefineConstants>TRACE;WINRT;PORTABLE;NET45;NET45PLUS;NET40PLUS;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<NoWarn>1591</NoWarn>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<SignAssembly>true</SignAssembly>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<AssemblyOriginatorKeyFile>..\..\..\..\..\..\keys\antlr\antlr-netcore45.snk</AssemblyOriginatorKeyFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="AntlrFileStream.cs" />
|
|
||||||
<Compile Include="AntlrInputStream.cs" />
|
|
||||||
<Compile Include="Atn\AbstractPredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\ActionTransition.cs" />
|
|
||||||
<Compile Include="Atn\AmbiguityInfo.cs" />
|
|
||||||
<Compile Include="Atn\ArrayPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\ATN.cs" />
|
|
||||||
<Compile Include="Atn\ATNConfig.cs" />
|
|
||||||
<Compile Include="Atn\ATNConfigSet.cs" />
|
|
||||||
<Compile Include="Atn\ATNDeserializationOptions.cs" />
|
|
||||||
<Compile Include="Atn\ATNDeserializer.cs" />
|
|
||||||
<Compile Include="Atn\ConflictInfo.cs" />
|
|
||||||
<Compile Include="Dfa\AcceptStateInfo.cs" />
|
|
||||||
<Compile Include="Dfa\EmptyEdgeMap`1.cs" />
|
|
||||||
<Compile Include="IVocabulary.cs" />
|
|
||||||
<Compile Include="Vocabulary.cs" />
|
|
||||||
<None Include="Atn\ATNSerializer.cs" />
|
|
||||||
<Compile Include="Atn\ATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\ATNState.cs" />
|
|
||||||
<Compile Include="Atn\ATNType.cs" />
|
|
||||||
<Compile Include="Atn\AtomTransition.cs" />
|
|
||||||
<Compile Include="Atn\BasicBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\BasicState.cs" />
|
|
||||||
<Compile Include="Atn\BlockEndState.cs" />
|
|
||||||
<Compile Include="Atn\BlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\ContextSensitivityInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionEventInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionState.cs" />
|
|
||||||
<Compile Include="Atn\EmptyPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\EpsilonTransition.cs" />
|
|
||||||
<Compile Include="Atn\ErrorInfo.cs" />
|
|
||||||
<Compile Include="Atn\ILexerAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerActionExecutor.cs" />
|
|
||||||
<Compile Include="Atn\LexerActionType.cs" />
|
|
||||||
<Compile Include="Atn\LexerATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\LexerChannelAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerCustomAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerIndexedCustomAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerMoreAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerPopModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerPushModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerSkipAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerTypeAction.cs" />
|
|
||||||
<Compile Include="Atn\LL1Analyzer.cs" />
|
|
||||||
<Compile Include="Atn\LookaheadEventInfo.cs" />
|
|
||||||
<Compile Include="Atn\LoopEndState.cs" />
|
|
||||||
<Compile Include="Atn\NotSetTransition.cs" />
|
|
||||||
<Compile Include="Atn\OrderedATNConfigSet.cs" />
|
|
||||||
<Compile Include="Atn\ParseInfo.cs" />
|
|
||||||
<Compile Include="Atn\ParserATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\PlusBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\PlusLoopbackState.cs" />
|
|
||||||
<Compile Include="Atn\PrecedencePredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\PredicateEvalInfo.cs" />
|
|
||||||
<Compile Include="Atn\PredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\PredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\PredictionContextCache.cs" />
|
|
||||||
<Compile Include="Atn\PredictionMode.cs" />
|
|
||||||
<Compile Include="Atn\ProfilingATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\RangeTransition.cs" />
|
|
||||||
<Compile Include="Atn\RuleStartState.cs" />
|
|
||||||
<Compile Include="Atn\RuleStopState.cs" />
|
|
||||||
<Compile Include="Atn\RuleTransition.cs" />
|
|
||||||
<Compile Include="Atn\SemanticContext.cs" />
|
|
||||||
<Compile Include="Atn\SetTransition.cs" />
|
|
||||||
<Compile Include="Atn\SimulatorState.cs" />
|
|
||||||
<Compile Include="Atn\SingletonPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\StarBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\StarLoopbackState.cs" />
|
|
||||||
<Compile Include="Atn\StarLoopEntryState.cs" />
|
|
||||||
<Compile Include="Atn\StateType.cs" />
|
|
||||||
<Compile Include="Atn\TokensStartState.cs" />
|
|
||||||
<Compile Include="Atn\Transition.cs" />
|
|
||||||
<Compile Include="Atn\TransitionType.cs" />
|
|
||||||
<Compile Include="Atn\WildcardTransition.cs" />
|
|
||||||
<Compile Include="BailErrorStrategy.cs" />
|
|
||||||
<Compile Include="BaseErrorListener.cs" />
|
|
||||||
<Compile Include="BufferedTokenStream.cs" />
|
|
||||||
<Compile Include="CommonToken.cs" />
|
|
||||||
<Compile Include="CommonTokenFactory.cs" />
|
|
||||||
<Compile Include="CommonTokenStream.cs" />
|
|
||||||
<Compile Include="ConsoleErrorListener.cs" />
|
|
||||||
<Compile Include="DefaultErrorStrategy.cs" />
|
|
||||||
<Compile Include="Dependents.cs" />
|
|
||||||
<Compile Include="Dfa\AbstractEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\ArrayEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\DFA.cs" />
|
|
||||||
<Compile Include="Dfa\DFASerializer.cs" />
|
|
||||||
<Compile Include="Dfa\DFAState.cs" />
|
|
||||||
<Compile Include="Dfa\IEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\LexerDFASerializer.cs" />
|
|
||||||
<Compile Include="Dfa\SingletonEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\SparseEdgeMap`1.cs" />
|
|
||||||
<Compile Include="DiagnosticErrorListener.cs" />
|
|
||||||
<Compile Include="FailedPredicateException.cs" />
|
|
||||||
<Compile Include="IAntlrErrorListener`1.cs" />
|
|
||||||
<Compile Include="IAntlrErrorStrategy.cs" />
|
|
||||||
<Compile Include="ICharStream.cs" />
|
|
||||||
<Compile Include="IIntStream.cs" />
|
|
||||||
<Compile Include="InputMismatchException.cs" />
|
|
||||||
<Compile Include="InterpreterRuleContext.cs" />
|
|
||||||
<Compile Include="IParserErrorListener.cs" />
|
|
||||||
<Compile Include="IRecognizer.cs" />
|
|
||||||
<Compile Include="IToken.cs" />
|
|
||||||
<Compile Include="ITokenFactory.cs" />
|
|
||||||
<Compile Include="ITokenSource.cs" />
|
|
||||||
<Compile Include="ITokenStream.cs" />
|
|
||||||
<Compile Include="IWritableToken.cs" />
|
|
||||||
<Compile Include="Lexer.cs" />
|
|
||||||
<Compile Include="LexerInterpreter.cs" />
|
|
||||||
<Compile Include="LexerNoViableAltException.cs" />
|
|
||||||
<Compile Include="ListTokenSource.cs" />
|
|
||||||
<Compile Include="Misc\Args.cs" />
|
|
||||||
<None Include="..\..\..\..\..\..\keys\antlr\antlr-netcore45.snk">
|
|
||||||
<Link>antlr-netcore45.snk</Link>
|
|
||||||
</None>
|
|
||||||
<None Include="Misc\Array2DHashSet`1.cs" />
|
|
||||||
<Compile Include="Misc\NullableAttribute.cs" />
|
|
||||||
<None Include="Misc\DoubleKeyMap`3.cs" />
|
|
||||||
<Compile Include="Misc\IIntSet.cs" />
|
|
||||||
<Compile Include="Misc\Interval.cs" />
|
|
||||||
<Compile Include="Misc\IntervalSet.cs" />
|
|
||||||
<Compile Include="Misc\MultiMap`2.cs" />
|
|
||||||
<Compile Include="Misc\MurmurHash.cs" />
|
|
||||||
<Compile Include="Misc\NotNullAttribute.cs" />
|
|
||||||
<None Include="Misc\OrderedHashSet`1.cs" />
|
|
||||||
<Compile Include="Misc\ParseCanceledException.cs" />
|
|
||||||
<Compile Include="Misc\RuleDependencyChecker.cs" />
|
|
||||||
<None Include="Misc\RuleDependencyProcessor.cs" />
|
|
||||||
<None Include="Misc\TestRig.cs" />
|
|
||||||
<Compile Include="Misc\Utils.cs" />
|
|
||||||
<Compile Include="NoViableAltException.cs" />
|
|
||||||
<Compile Include="Parser.cs" />
|
|
||||||
<Compile Include="ParserInterpreter.cs" />
|
|
||||||
<Compile Include="ParserRuleContext.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
<Compile Include="ProxyErrorListener`1.cs" />
|
|
||||||
<Compile Include="ProxyParserErrorListener.cs" />
|
|
||||||
<Compile Include="RecognitionException.cs" />
|
|
||||||
<Compile Include="Recognizer`2.cs" />
|
|
||||||
<Compile Include="RuleContext.cs" />
|
|
||||||
<Compile Include="RuleDependencyAttribute.cs" />
|
|
||||||
<Compile Include="RuleVersionAttribute.cs" />
|
|
||||||
<Compile Include="Sharpen\Arrays.cs" />
|
|
||||||
<Compile Include="Sharpen\AtomicReference`1.cs" />
|
|
||||||
<Compile Include="Sharpen\BitSet.cs" />
|
|
||||||
<Compile Include="Sharpen\Collections.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\SerializableAttribute.cs" />
|
|
||||||
<Compile Include="Sharpen\DictionaryExtensions.cs" />
|
|
||||||
<Compile Include="Sharpen\ListExtensions.cs" />
|
|
||||||
<Compile Include="Sharpen\Runtime.cs" />
|
|
||||||
<Compile Include="Sharpen\SequenceEqualityComparer`1.cs" />
|
|
||||||
<Compile Include="TokenStreamRewriter.cs" />
|
|
||||||
<Compile Include="TokenTypes.cs" />
|
|
||||||
<Compile Include="Tree\AbstractParseTreeVisitor`1.cs" />
|
|
||||||
<Compile Include="Tree\ErrorNodeImpl.cs" />
|
|
||||||
<Compile Include="Tree\IErrorNode.cs" />
|
|
||||||
<Compile Include="Tree\IParseTree.cs" />
|
|
||||||
<Compile Include="Tree\IParseTreeListener.cs" />
|
|
||||||
<Compile Include="Tree\IParseTreeVisitor`1.cs" />
|
|
||||||
<Compile Include="Tree\IRuleNode.cs" />
|
|
||||||
<Compile Include="Tree\ISyntaxTree.cs" />
|
|
||||||
<Compile Include="Tree\ITerminalNode.cs" />
|
|
||||||
<Compile Include="Tree\ITree.cs" />
|
|
||||||
<Compile Include="Tree\ParseTreeProperty`1.cs" />
|
|
||||||
<Compile Include="Tree\ParseTreeWalker.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\Chunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreeMatch.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreePattern.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreePatternMatcher.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\RuleTagToken.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TagChunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TextChunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TokenTagToken.cs" />
|
|
||||||
<Compile Include="Tree\TerminalNodeImpl.cs" />
|
|
||||||
<Compile Include="Tree\Trees.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPath.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathLexerErrorListener.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathRuleAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathRuleElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathTokenAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathTokenElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathWildcardAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathWildcardElement.cs" />
|
|
||||||
<Compile Include="UnbufferedCharStream.cs" />
|
|
||||||
<Compile Include="UnbufferedTokenStream.cs" />
|
|
||||||
<None Include="packages.Antlr4.Runtime.netcore45.config" />
|
|
||||||
<Antlr4 Include="Tree\Xpath\XPathLexer.g4">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<CustomToolNamespace>Antlr4.Runtime.Tree.Xpath</CustomToolNamespace>
|
|
||||||
</Antlr4>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
|
|
||||||
<Import Project="$(SolutionDir)\build\KeyReporting.targets" />
|
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.props'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.targets'))" />
|
|
||||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
|
||||||
</Target>
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.targets" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" />
|
|
||||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
|
@ -1,267 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.props" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" />
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<MinimumVisualStudioVersion>10.0</MinimumVisualStudioVersion>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{06C182C5-095C-4D43-9C33-C87E305C6BC2}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>Antlr4.Runtime</RootNamespace>
|
|
||||||
<AssemblyName>Antlr4.Runtime</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
|
||||||
<TargetFrameworkProfile>Profile328</TargetFrameworkProfile>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<BaseIntermediateOutputPath>obj\portable-net40\</BaseIntermediateOutputPath>
|
|
||||||
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
|
||||||
<RestorePackages>true</RestorePackages>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\portable-net40\Debug\</OutputPath>
|
|
||||||
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
|
|
||||||
<DefineConstants>TRACE;DEBUG;PORTABLE;NET40;NET40PLUS;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<NoWarn>1591</NoWarn>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\portable-net40\Release\</OutputPath>
|
|
||||||
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
|
|
||||||
<DefineConstants>TRACE;PORTABLE;NET40;NET40PLUS;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<NoWarn>1591</NoWarn>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<SignAssembly>true</SignAssembly>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<AssemblyOriginatorKeyFile>..\..\..\..\..\..\keys\antlr\antlr-portable-net40.snk</AssemblyOriginatorKeyFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="AntlrFileStream.cs" />
|
|
||||||
<Compile Include="AntlrInputStream.cs" />
|
|
||||||
<Compile Include="Atn\AbstractPredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\ActionTransition.cs" />
|
|
||||||
<Compile Include="Atn\AmbiguityInfo.cs" />
|
|
||||||
<Compile Include="Atn\ArrayPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\ATN.cs" />
|
|
||||||
<Compile Include="Atn\ATNConfig.cs" />
|
|
||||||
<Compile Include="Atn\ATNConfigSet.cs" />
|
|
||||||
<Compile Include="Atn\ATNDeserializationOptions.cs" />
|
|
||||||
<Compile Include="Atn\ATNDeserializer.cs" />
|
|
||||||
<Compile Include="Atn\ConflictInfo.cs" />
|
|
||||||
<Compile Include="Dfa\AcceptStateInfo.cs" />
|
|
||||||
<Compile Include="Dfa\EmptyEdgeMap`1.cs" />
|
|
||||||
<Compile Include="IVocabulary.cs" />
|
|
||||||
<Compile Include="Vocabulary.cs" />
|
|
||||||
<None Include="Atn\ATNSerializer.cs" />
|
|
||||||
<Compile Include="Atn\ATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\ATNState.cs" />
|
|
||||||
<Compile Include="Atn\ATNType.cs" />
|
|
||||||
<Compile Include="Atn\AtomTransition.cs" />
|
|
||||||
<Compile Include="Atn\BasicBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\BasicState.cs" />
|
|
||||||
<Compile Include="Atn\BlockEndState.cs" />
|
|
||||||
<Compile Include="Atn\BlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\ContextSensitivityInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionEventInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionState.cs" />
|
|
||||||
<Compile Include="Atn\EmptyPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\EpsilonTransition.cs" />
|
|
||||||
<Compile Include="Atn\ErrorInfo.cs" />
|
|
||||||
<Compile Include="Atn\ILexerAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerActionExecutor.cs" />
|
|
||||||
<Compile Include="Atn\LexerActionType.cs" />
|
|
||||||
<Compile Include="Atn\LexerATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\LexerChannelAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerCustomAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerIndexedCustomAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerMoreAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerPopModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerPushModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerSkipAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerTypeAction.cs" />
|
|
||||||
<Compile Include="Atn\LL1Analyzer.cs" />
|
|
||||||
<Compile Include="Atn\LookaheadEventInfo.cs" />
|
|
||||||
<Compile Include="Atn\LoopEndState.cs" />
|
|
||||||
<Compile Include="Atn\NotSetTransition.cs" />
|
|
||||||
<Compile Include="Atn\OrderedATNConfigSet.cs" />
|
|
||||||
<Compile Include="Atn\ParseInfo.cs" />
|
|
||||||
<Compile Include="Atn\ParserATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\PlusBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\PlusLoopbackState.cs" />
|
|
||||||
<Compile Include="Atn\PrecedencePredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\PredicateEvalInfo.cs" />
|
|
||||||
<Compile Include="Atn\PredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\PredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\PredictionContextCache.cs" />
|
|
||||||
<Compile Include="Atn\PredictionMode.cs" />
|
|
||||||
<Compile Include="Atn\ProfilingATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\RangeTransition.cs" />
|
|
||||||
<Compile Include="Atn\RuleStartState.cs" />
|
|
||||||
<Compile Include="Atn\RuleStopState.cs" />
|
|
||||||
<Compile Include="Atn\RuleTransition.cs" />
|
|
||||||
<Compile Include="Atn\SemanticContext.cs" />
|
|
||||||
<Compile Include="Atn\SetTransition.cs" />
|
|
||||||
<Compile Include="Atn\SimulatorState.cs" />
|
|
||||||
<Compile Include="Atn\SingletonPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\StarBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\StarLoopbackState.cs" />
|
|
||||||
<Compile Include="Atn\StarLoopEntryState.cs" />
|
|
||||||
<Compile Include="Atn\StateType.cs" />
|
|
||||||
<Compile Include="Atn\TokensStartState.cs" />
|
|
||||||
<Compile Include="Atn\Transition.cs" />
|
|
||||||
<Compile Include="Atn\TransitionType.cs" />
|
|
||||||
<Compile Include="Atn\WildcardTransition.cs" />
|
|
||||||
<Compile Include="BailErrorStrategy.cs" />
|
|
||||||
<Compile Include="BaseErrorListener.cs" />
|
|
||||||
<Compile Include="BufferedTokenStream.cs" />
|
|
||||||
<Compile Include="CommonToken.cs" />
|
|
||||||
<Compile Include="CommonTokenFactory.cs" />
|
|
||||||
<Compile Include="CommonTokenStream.cs" />
|
|
||||||
<Compile Include="ConsoleErrorListener.cs" />
|
|
||||||
<Compile Include="DefaultErrorStrategy.cs" />
|
|
||||||
<Compile Include="Dependents.cs" />
|
|
||||||
<Compile Include="Dfa\AbstractEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\ArrayEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\DFA.cs" />
|
|
||||||
<Compile Include="Dfa\DFASerializer.cs" />
|
|
||||||
<Compile Include="Dfa\DFAState.cs" />
|
|
||||||
<Compile Include="Dfa\IEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\LexerDFASerializer.cs" />
|
|
||||||
<Compile Include="Dfa\SingletonEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\SparseEdgeMap`1.cs" />
|
|
||||||
<Compile Include="DiagnosticErrorListener.cs" />
|
|
||||||
<Compile Include="FailedPredicateException.cs" />
|
|
||||||
<Compile Include="IAntlrErrorListener`1.cs" />
|
|
||||||
<Compile Include="IAntlrErrorStrategy.cs" />
|
|
||||||
<Compile Include="ICharStream.cs" />
|
|
||||||
<Compile Include="IIntStream.cs" />
|
|
||||||
<Compile Include="InputMismatchException.cs" />
|
|
||||||
<Compile Include="InterpreterRuleContext.cs" />
|
|
||||||
<Compile Include="IParserErrorListener.cs" />
|
|
||||||
<Compile Include="IRecognizer.cs" />
|
|
||||||
<Compile Include="IToken.cs" />
|
|
||||||
<Compile Include="ITokenFactory.cs" />
|
|
||||||
<Compile Include="ITokenSource.cs" />
|
|
||||||
<Compile Include="ITokenStream.cs" />
|
|
||||||
<Compile Include="IWritableToken.cs" />
|
|
||||||
<Compile Include="Lexer.cs" />
|
|
||||||
<Compile Include="LexerInterpreter.cs" />
|
|
||||||
<Compile Include="LexerNoViableAltException.cs" />
|
|
||||||
<Compile Include="ListTokenSource.cs" />
|
|
||||||
<Compile Include="Misc\Args.cs" />
|
|
||||||
<None Include="..\..\..\..\..\..\keys\antlr\antlr-portable-net40.snk">
|
|
||||||
<Link>antlr-portable-net40.snk</Link>
|
|
||||||
</None>
|
|
||||||
<None Include="Misc\Array2DHashSet`1.cs" />
|
|
||||||
<Compile Include="Misc\MurmurHash.cs" />
|
|
||||||
<Compile Include="Misc\NullableAttribute.cs" />
|
|
||||||
<None Include="Misc\DoubleKeyMap`3.cs" />
|
|
||||||
<Compile Include="Misc\IIntSet.cs" />
|
|
||||||
<Compile Include="Misc\Interval.cs" />
|
|
||||||
<Compile Include="Misc\IntervalSet.cs" />
|
|
||||||
<Compile Include="Misc\MultiMap`2.cs" />
|
|
||||||
<Compile Include="Misc\NotNullAttribute.cs" />
|
|
||||||
<None Include="Misc\OrderedHashSet`1.cs" />
|
|
||||||
<Compile Include="Misc\ParseCanceledException.cs" />
|
|
||||||
<Compile Include="Misc\RuleDependencyChecker.cs" />
|
|
||||||
<None Include="Misc\RuleDependencyProcessor.cs" />
|
|
||||||
<None Include="Misc\TestRig.cs" />
|
|
||||||
<Compile Include="Misc\Utils.cs" />
|
|
||||||
<Compile Include="NoViableAltException.cs" />
|
|
||||||
<Compile Include="Parser.cs" />
|
|
||||||
<Compile Include="ParserInterpreter.cs" />
|
|
||||||
<Compile Include="ParserRuleContext.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
<Compile Include="ProxyErrorListener`1.cs" />
|
|
||||||
<Compile Include="ProxyParserErrorListener.cs" />
|
|
||||||
<Compile Include="RecognitionException.cs" />
|
|
||||||
<Compile Include="Recognizer`2.cs" />
|
|
||||||
<Compile Include="RuleContext.cs" />
|
|
||||||
<Compile Include="RuleDependencyAttribute.cs" />
|
|
||||||
<Compile Include="RuleVersionAttribute.cs" />
|
|
||||||
<Compile Include="Sharpen\Arrays.cs" />
|
|
||||||
<Compile Include="Sharpen\AtomicReference`1.cs" />
|
|
||||||
<Compile Include="Sharpen\BitSet.cs" />
|
|
||||||
<Compile Include="Sharpen\Collections.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\CollectionDebuggerView`2.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\ConcurrentDictionary`2.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\SerializableAttribute.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\SplitOrderedList`2.cs" />
|
|
||||||
<Compile Include="Sharpen\DictionaryExtensions.cs" />
|
|
||||||
<Compile Include="Sharpen\ListExtensions.cs" />
|
|
||||||
<Compile Include="Sharpen\Runtime.cs" />
|
|
||||||
<Compile Include="Sharpen\SequenceEqualityComparer`1.cs" />
|
|
||||||
<Compile Include="TokenStreamRewriter.cs" />
|
|
||||||
<Compile Include="TokenTypes.cs" />
|
|
||||||
<Compile Include="Tree\AbstractParseTreeVisitor`1.cs" />
|
|
||||||
<Compile Include="Tree\ErrorNodeImpl.cs" />
|
|
||||||
<Compile Include="Tree\IErrorNode.cs" />
|
|
||||||
<Compile Include="Tree\IParseTree.cs" />
|
|
||||||
<Compile Include="Tree\IParseTreeListener.cs" />
|
|
||||||
<Compile Include="Tree\IParseTreeVisitor`1.cs" />
|
|
||||||
<Compile Include="Tree\IRuleNode.cs" />
|
|
||||||
<Compile Include="Tree\ISyntaxTree.cs" />
|
|
||||||
<Compile Include="Tree\ITerminalNode.cs" />
|
|
||||||
<Compile Include="Tree\ITree.cs" />
|
|
||||||
<Compile Include="Tree\ParseTreeProperty`1.cs" />
|
|
||||||
<Compile Include="Tree\ParseTreeWalker.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\Chunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreeMatch.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreePattern.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreePatternMatcher.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\RuleTagToken.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TagChunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TextChunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TokenTagToken.cs" />
|
|
||||||
<Compile Include="Tree\TerminalNodeImpl.cs" />
|
|
||||||
<Compile Include="Tree\Trees.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPath.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathLexerErrorListener.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathRuleAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathRuleElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathTokenAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathTokenElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathWildcardAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathWildcardElement.cs" />
|
|
||||||
<Compile Include="UnbufferedCharStream.cs" />
|
|
||||||
<Compile Include="UnbufferedTokenStream.cs" />
|
|
||||||
<None Include="packages.Antlr4.Runtime.portable-net40.config" />
|
|
||||||
<Antlr4 Include="Tree\Xpath\XPathLexer.g4">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<CustomToolNamespace>Antlr4.Runtime.Tree.Xpath</CustomToolNamespace>
|
|
||||||
</Antlr4>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
|
|
||||||
<Import Project="$(SolutionDir)\build\KeyReporting.targets" />
|
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.props'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.targets'))" />
|
|
||||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
|
||||||
</Target>
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.targets" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" />
|
|
||||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
|
@ -1,267 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.props" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" />
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{12269283-EE92-4FAA-B849-53CD24F341FA}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>Antlr4.Runtime</RootNamespace>
|
|
||||||
<AssemblyName>Antlr4.Runtime</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
|
||||||
<TargetFrameworkProfile>Profile259</TargetFrameworkProfile>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<BaseIntermediateOutputPath>obj\portable-net45\</BaseIntermediateOutputPath>
|
|
||||||
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
|
||||||
<RestorePackages>true</RestorePackages>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\portable-net45\Debug\</OutputPath>
|
|
||||||
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
|
|
||||||
<DefineConstants>TRACE;DEBUG;PORTABLE;NET45;NET45PLUS;NET40PLUS;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<NoWarn>1591</NoWarn>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\portable-net45\Release\</OutputPath>
|
|
||||||
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
|
|
||||||
<DefineConstants>TRACE;PORTABLE;NET45;NET45PLUS;NET40PLUS;NET35PLUS;NET30PLUS;NET20PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<NoWarn>1591</NoWarn>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<SignAssembly>true</SignAssembly>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<AssemblyOriginatorKeyFile>..\..\..\..\..\..\keys\antlr\antlr-portable-net45.snk</AssemblyOriginatorKeyFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="AntlrFileStream.cs" />
|
|
||||||
<Compile Include="AntlrInputStream.cs" />
|
|
||||||
<Compile Include="Atn\AbstractPredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\ActionTransition.cs" />
|
|
||||||
<Compile Include="Atn\AmbiguityInfo.cs" />
|
|
||||||
<Compile Include="Atn\ArrayPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\ATN.cs" />
|
|
||||||
<Compile Include="Atn\ATNConfig.cs" />
|
|
||||||
<Compile Include="Atn\ATNConfigSet.cs" />
|
|
||||||
<Compile Include="Atn\ATNDeserializationOptions.cs" />
|
|
||||||
<Compile Include="Atn\ATNDeserializer.cs" />
|
|
||||||
<Compile Include="Atn\ConflictInfo.cs" />
|
|
||||||
<Compile Include="Dfa\AcceptStateInfo.cs" />
|
|
||||||
<Compile Include="Dfa\EmptyEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Vocabulary.cs" />
|
|
||||||
<None Include="Atn\ATNSerializer.cs" />
|
|
||||||
<Compile Include="Atn\ATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\ATNState.cs" />
|
|
||||||
<Compile Include="Atn\ATNType.cs" />
|
|
||||||
<Compile Include="Atn\AtomTransition.cs" />
|
|
||||||
<Compile Include="Atn\BasicBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\BasicState.cs" />
|
|
||||||
<Compile Include="Atn\BlockEndState.cs" />
|
|
||||||
<Compile Include="Atn\BlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\ContextSensitivityInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionEventInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionInfo.cs" />
|
|
||||||
<Compile Include="Atn\DecisionState.cs" />
|
|
||||||
<Compile Include="Atn\EmptyPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\EpsilonTransition.cs" />
|
|
||||||
<Compile Include="Atn\ErrorInfo.cs" />
|
|
||||||
<Compile Include="Atn\ILexerAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerActionExecutor.cs" />
|
|
||||||
<Compile Include="Atn\LexerActionType.cs" />
|
|
||||||
<Compile Include="Atn\LexerATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\LexerChannelAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerCustomAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerIndexedCustomAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerMoreAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerPopModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerPushModeAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerSkipAction.cs" />
|
|
||||||
<Compile Include="Atn\LexerTypeAction.cs" />
|
|
||||||
<Compile Include="Atn\LL1Analyzer.cs" />
|
|
||||||
<Compile Include="Atn\LookaheadEventInfo.cs" />
|
|
||||||
<Compile Include="Atn\LoopEndState.cs" />
|
|
||||||
<Compile Include="Atn\NotSetTransition.cs" />
|
|
||||||
<Compile Include="Atn\OrderedATNConfigSet.cs" />
|
|
||||||
<Compile Include="Atn\ParseInfo.cs" />
|
|
||||||
<Compile Include="Atn\ParserATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\PlusBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\PlusLoopbackState.cs" />
|
|
||||||
<Compile Include="Atn\PrecedencePredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\PredicateEvalInfo.cs" />
|
|
||||||
<Compile Include="Atn\PredicateTransition.cs" />
|
|
||||||
<Compile Include="Atn\PredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\PredictionContextCache.cs" />
|
|
||||||
<Compile Include="Atn\PredictionMode.cs" />
|
|
||||||
<Compile Include="Atn\ProfilingATNSimulator.cs" />
|
|
||||||
<Compile Include="Atn\RangeTransition.cs" />
|
|
||||||
<Compile Include="Atn\RuleStartState.cs" />
|
|
||||||
<Compile Include="Atn\RuleStopState.cs" />
|
|
||||||
<Compile Include="Atn\RuleTransition.cs" />
|
|
||||||
<Compile Include="Atn\SemanticContext.cs" />
|
|
||||||
<Compile Include="Atn\SetTransition.cs" />
|
|
||||||
<Compile Include="Atn\SimulatorState.cs" />
|
|
||||||
<Compile Include="Atn\SingletonPredictionContext.cs" />
|
|
||||||
<Compile Include="Atn\StarBlockStartState.cs" />
|
|
||||||
<Compile Include="Atn\StarLoopbackState.cs" />
|
|
||||||
<Compile Include="Atn\StarLoopEntryState.cs" />
|
|
||||||
<Compile Include="Atn\StateType.cs" />
|
|
||||||
<Compile Include="Atn\TokensStartState.cs" />
|
|
||||||
<Compile Include="Atn\Transition.cs" />
|
|
||||||
<Compile Include="Atn\TransitionType.cs" />
|
|
||||||
<Compile Include="Atn\WildcardTransition.cs" />
|
|
||||||
<Compile Include="BailErrorStrategy.cs" />
|
|
||||||
<Compile Include="BaseErrorListener.cs" />
|
|
||||||
<Compile Include="BufferedTokenStream.cs" />
|
|
||||||
<Compile Include="CommonToken.cs" />
|
|
||||||
<Compile Include="CommonTokenFactory.cs" />
|
|
||||||
<Compile Include="CommonTokenStream.cs" />
|
|
||||||
<Compile Include="ConsoleErrorListener.cs" />
|
|
||||||
<Compile Include="DefaultErrorStrategy.cs" />
|
|
||||||
<Compile Include="Dependents.cs" />
|
|
||||||
<Compile Include="Dfa\AbstractEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\ArrayEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\DFA.cs" />
|
|
||||||
<Compile Include="Dfa\DFASerializer.cs" />
|
|
||||||
<Compile Include="Dfa\DFAState.cs" />
|
|
||||||
<Compile Include="Dfa\IEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\LexerDFASerializer.cs" />
|
|
||||||
<Compile Include="Dfa\SingletonEdgeMap`1.cs" />
|
|
||||||
<Compile Include="Dfa\SparseEdgeMap`1.cs" />
|
|
||||||
<Compile Include="DiagnosticErrorListener.cs" />
|
|
||||||
<Compile Include="FailedPredicateException.cs" />
|
|
||||||
<Compile Include="IAntlrErrorListener`1.cs" />
|
|
||||||
<Compile Include="IAntlrErrorStrategy.cs" />
|
|
||||||
<Compile Include="ICharStream.cs" />
|
|
||||||
<Compile Include="IIntStream.cs" />
|
|
||||||
<Compile Include="InputMismatchException.cs" />
|
|
||||||
<Compile Include="InterpreterRuleContext.cs" />
|
|
||||||
<Compile Include="IParserErrorListener.cs" />
|
|
||||||
<Compile Include="IRecognizer.cs" />
|
|
||||||
<Compile Include="IToken.cs" />
|
|
||||||
<Compile Include="ITokenFactory.cs" />
|
|
||||||
<Compile Include="ITokenSource.cs" />
|
|
||||||
<Compile Include="ITokenStream.cs" />
|
|
||||||
<Compile Include="IVocabulary.cs" />
|
|
||||||
<Compile Include="IWritableToken.cs" />
|
|
||||||
<Compile Include="Lexer.cs" />
|
|
||||||
<Compile Include="LexerInterpreter.cs" />
|
|
||||||
<Compile Include="LexerNoViableAltException.cs" />
|
|
||||||
<Compile Include="ListTokenSource.cs" />
|
|
||||||
<Compile Include="Misc\Args.cs" />
|
|
||||||
<None Include="..\..\..\..\..\..\keys\antlr\antlr-portable-net45.snk">
|
|
||||||
<Link>antlr-portable-net45.snk</Link>
|
|
||||||
</None>
|
|
||||||
<None Include="Misc\Array2DHashSet`1.cs" />
|
|
||||||
<Compile Include="Misc\MurmurHash.cs" />
|
|
||||||
<Compile Include="Misc\NullableAttribute.cs" />
|
|
||||||
<None Include="Misc\DoubleKeyMap`3.cs" />
|
|
||||||
<Compile Include="Misc\IIntSet.cs" />
|
|
||||||
<Compile Include="Misc\Interval.cs" />
|
|
||||||
<Compile Include="Misc\IntervalSet.cs" />
|
|
||||||
<Compile Include="Misc\MultiMap`2.cs" />
|
|
||||||
<Compile Include="Misc\NotNullAttribute.cs" />
|
|
||||||
<None Include="Misc\OrderedHashSet`1.cs" />
|
|
||||||
<Compile Include="Misc\ParseCanceledException.cs" />
|
|
||||||
<Compile Include="Misc\RuleDependencyChecker.cs" />
|
|
||||||
<None Include="Misc\RuleDependencyProcessor.cs" />
|
|
||||||
<None Include="Misc\TestRig.cs" />
|
|
||||||
<Compile Include="Misc\Utils.cs" />
|
|
||||||
<Compile Include="NoViableAltException.cs" />
|
|
||||||
<Compile Include="Parser.cs" />
|
|
||||||
<Compile Include="ParserInterpreter.cs" />
|
|
||||||
<Compile Include="ParserRuleContext.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
<Compile Include="ProxyErrorListener`1.cs" />
|
|
||||||
<Compile Include="ProxyParserErrorListener.cs" />
|
|
||||||
<Compile Include="RecognitionException.cs" />
|
|
||||||
<Compile Include="Recognizer`2.cs" />
|
|
||||||
<Compile Include="RuleContext.cs" />
|
|
||||||
<Compile Include="RuleDependencyAttribute.cs" />
|
|
||||||
<Compile Include="RuleVersionAttribute.cs" />
|
|
||||||
<Compile Include="Sharpen\Arrays.cs" />
|
|
||||||
<Compile Include="Sharpen\AtomicReference`1.cs" />
|
|
||||||
<Compile Include="Sharpen\BitSet.cs" />
|
|
||||||
<Compile Include="Sharpen\Collections.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\CollectionDebuggerView`2.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\ConcurrentDictionary`2.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\SerializableAttribute.cs" />
|
|
||||||
<Compile Include="Sharpen\Compat\SplitOrderedList`2.cs" />
|
|
||||||
<Compile Include="Sharpen\DictionaryExtensions.cs" />
|
|
||||||
<Compile Include="Sharpen\ListExtensions.cs" />
|
|
||||||
<Compile Include="Sharpen\Runtime.cs" />
|
|
||||||
<Compile Include="Sharpen\SequenceEqualityComparer`1.cs" />
|
|
||||||
<Compile Include="TokenStreamRewriter.cs" />
|
|
||||||
<Compile Include="TokenTypes.cs" />
|
|
||||||
<Compile Include="Tree\AbstractParseTreeVisitor`1.cs" />
|
|
||||||
<Compile Include="Tree\ErrorNodeImpl.cs" />
|
|
||||||
<Compile Include="Tree\IErrorNode.cs" />
|
|
||||||
<Compile Include="Tree\IParseTree.cs" />
|
|
||||||
<Compile Include="Tree\IParseTreeListener.cs" />
|
|
||||||
<Compile Include="Tree\IParseTreeVisitor`1.cs" />
|
|
||||||
<Compile Include="Tree\IRuleNode.cs" />
|
|
||||||
<Compile Include="Tree\ISyntaxTree.cs" />
|
|
||||||
<Compile Include="Tree\ITerminalNode.cs" />
|
|
||||||
<Compile Include="Tree\ITree.cs" />
|
|
||||||
<Compile Include="Tree\ParseTreeProperty`1.cs" />
|
|
||||||
<Compile Include="Tree\ParseTreeWalker.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\Chunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreeMatch.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreePattern.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\ParseTreePatternMatcher.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\RuleTagToken.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TagChunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TextChunk.cs" />
|
|
||||||
<Compile Include="Tree\Pattern\TokenTagToken.cs" />
|
|
||||||
<Compile Include="Tree\TerminalNodeImpl.cs" />
|
|
||||||
<Compile Include="Tree\Trees.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPath.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathLexerErrorListener.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathRuleAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathRuleElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathTokenAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathTokenElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathWildcardAnywhereElement.cs" />
|
|
||||||
<Compile Include="Tree\Xpath\XPathWildcardElement.cs" />
|
|
||||||
<Compile Include="UnbufferedCharStream.cs" />
|
|
||||||
<Compile Include="UnbufferedTokenStream.cs" />
|
|
||||||
<None Include="packages.Antlr4.Runtime.portable-net45.config" />
|
|
||||||
<Antlr4 Include="Tree\Xpath\XPathLexer.g4">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<CustomToolNamespace>Antlr4.Runtime.Tree.Xpath</CustomToolNamespace>
|
|
||||||
</Antlr4>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
|
|
||||||
<Import Project="$(SolutionDir)\build\KeyReporting.targets" />
|
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.props'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.targets'))" />
|
|
||||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
|
||||||
</Target>
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.targets" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" />
|
|
||||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.props" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" />
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
@ -15,6 +14,7 @@
|
||||||
<BaseIntermediateOutputPath>obj\net20\</BaseIntermediateOutputPath>
|
<BaseIntermediateOutputPath>obj\net20\</BaseIntermediateOutputPath>
|
||||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||||
<RestorePackages>true</RestorePackages>
|
<RestorePackages>true</RestorePackages>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
@ -37,15 +37,8 @@
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<NoWarn>1591</NoWarn>
|
<NoWarn>1591</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
|
||||||
<SignAssembly>true</SignAssembly>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<AssemblyOriginatorKeyFile>..\..\..\..\..\..\keys\antlr\antlr-net20.snk</AssemblyOriginatorKeyFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -64,8 +57,9 @@
|
||||||
<Compile Include="Dfa\AcceptStateInfo.cs" />
|
<Compile Include="Dfa\AcceptStateInfo.cs" />
|
||||||
<Compile Include="Dfa\EmptyEdgeMap`1.cs" />
|
<Compile Include="Dfa\EmptyEdgeMap`1.cs" />
|
||||||
<Compile Include="IVocabulary.cs" />
|
<Compile Include="IVocabulary.cs" />
|
||||||
|
<Compile Include="Recognizer.cs" />
|
||||||
|
<Compile Include="Tree\Xpath\XPathLexer.cs" />
|
||||||
<Compile Include="Vocabulary.cs" />
|
<Compile Include="Vocabulary.cs" />
|
||||||
<None Include="Atn\ATNSerializer.cs" />
|
|
||||||
<Compile Include="Atn\ATNSimulator.cs" />
|
<Compile Include="Atn\ATNSimulator.cs" />
|
||||||
<Compile Include="Atn\ATNState.cs" />
|
<Compile Include="Atn\ATNState.cs" />
|
||||||
<Compile Include="Atn\ATNType.cs" />
|
<Compile Include="Atn\ATNType.cs" />
|
||||||
|
@ -164,9 +158,6 @@
|
||||||
<Compile Include="LexerNoViableAltException.cs" />
|
<Compile Include="LexerNoViableAltException.cs" />
|
||||||
<Compile Include="ListTokenSource.cs" />
|
<Compile Include="ListTokenSource.cs" />
|
||||||
<Compile Include="Misc\Args.cs" />
|
<Compile Include="Misc\Args.cs" />
|
||||||
<None Include="..\..\..\..\..\..\keys\antlr\antlr-net20.snk">
|
|
||||||
<Link>antlr-net20.snk</Link>
|
|
||||||
</None>
|
|
||||||
<None Include="Misc\Array2DHashSet`1.cs" />
|
<None Include="Misc\Array2DHashSet`1.cs" />
|
||||||
<Compile Include="Misc\MurmurHash.cs" />
|
<Compile Include="Misc\MurmurHash.cs" />
|
||||||
<Compile Include="Misc\NullableAttribute.cs" />
|
<Compile Include="Misc\NullableAttribute.cs" />
|
||||||
|
@ -190,7 +181,6 @@
|
||||||
<Compile Include="ProxyErrorListener`1.cs" />
|
<Compile Include="ProxyErrorListener`1.cs" />
|
||||||
<Compile Include="ProxyParserErrorListener.cs" />
|
<Compile Include="ProxyParserErrorListener.cs" />
|
||||||
<Compile Include="RecognitionException.cs" />
|
<Compile Include="RecognitionException.cs" />
|
||||||
<Compile Include="Recognizer`2.cs" />
|
|
||||||
<Compile Include="RuleContext.cs" />
|
<Compile Include="RuleContext.cs" />
|
||||||
<Compile Include="RuleDependencyAttribute.cs" />
|
<Compile Include="RuleDependencyAttribute.cs" />
|
||||||
<Compile Include="RuleVersionAttribute.cs" />
|
<Compile Include="RuleVersionAttribute.cs" />
|
||||||
|
@ -248,29 +238,6 @@
|
||||||
<Compile Include="Tree\Xpath\XPathWildcardElement.cs" />
|
<Compile Include="Tree\Xpath\XPathWildcardElement.cs" />
|
||||||
<Compile Include="UnbufferedCharStream.cs" />
|
<Compile Include="UnbufferedCharStream.cs" />
|
||||||
<Compile Include="UnbufferedTokenStream.cs" />
|
<Compile Include="UnbufferedTokenStream.cs" />
|
||||||
<None Include="packages.Antlr4.Runtime.net20.config" />
|
|
||||||
<Antlr4 Include="Tree\Xpath\XPathLexer.g4">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<CustomToolNamespace>Antlr4.Runtime.Tree.Xpath</CustomToolNamespace>
|
|
||||||
</Antlr4>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<Import Project="$(SolutionDir)\build\KeyReporting.targets" />
|
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.props'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Antlr4.4.3.0\build\Antlr4.targets'))" />
|
|
||||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
|
||||||
</Target>
|
|
||||||
<Import Project="..\packages\Antlr4.4.3.0\build\Antlr4.targets" Condition="Exists('..\packages\Antlr4.4.3.0\build\Antlr4.targets')" />
|
|
||||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
</Project>
|
|
@ -1,720 +0,0 @@
|
||||||
/*
|
|
||||||
* [The "BSD license"]
|
|
||||||
* Copyright (c) 2013 Terence Parr
|
|
||||||
* Copyright (c) 2013 Sam Harwell
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
||||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
||||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.IO;
|
|
||||||
using System.Text;
|
|
||||||
using Antlr4.Runtime.Atn;
|
|
||||||
using Antlr4.Runtime.Misc;
|
|
||||||
using Antlr4.Runtime.Sharpen;
|
|
||||||
|
|
||||||
namespace Antlr4.Runtime.Atn
|
|
||||||
{
|
|
||||||
public class ATNSerializer
|
|
||||||
{
|
|
||||||
public ATN atn;
|
|
||||||
|
|
||||||
private IList<string> ruleNames;
|
|
||||||
|
|
||||||
private IList<string> tokenNames;
|
|
||||||
|
|
||||||
public ATNSerializer(ATN atn, IList<string> ruleNames)
|
|
||||||
{
|
|
||||||
System.Diagnostics.Debug.Assert(atn.grammarType != null);
|
|
||||||
this.atn = atn;
|
|
||||||
this.ruleNames = ruleNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ATNSerializer(ATN atn, IList<string> ruleNames, IList<string> tokenNames)
|
|
||||||
{
|
|
||||||
System.Diagnostics.Debug.Assert(atn.grammarType != null);
|
|
||||||
this.atn = atn;
|
|
||||||
this.ruleNames = ruleNames;
|
|
||||||
this.tokenNames = tokenNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Serialize state descriptors, edge descriptors, and decision→state map
|
|
||||||
/// into list of ints:
|
|
||||||
/// grammar-type, (ANTLRParser.LEXER, ...)
|
|
||||||
/// max token type,
|
|
||||||
/// num states,
|
|
||||||
/// state-0-type ruleIndex, state-1-type ruleIndex, ...
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Serialize state descriptors, edge descriptors, and decision→state map
|
|
||||||
/// into list of ints:
|
|
||||||
/// grammar-type, (ANTLRParser.LEXER, ...)
|
|
||||||
/// max token type,
|
|
||||||
/// num states,
|
|
||||||
/// state-0-type ruleIndex, state-1-type ruleIndex, ... state-i-type ruleIndex optional-arg ...
|
|
||||||
/// num rules,
|
|
||||||
/// rule-1-start-state rule-1-args, rule-2-start-state rule-2-args, ...
|
|
||||||
/// (args are token type,actionIndex in lexer else 0,0)
|
|
||||||
/// num modes,
|
|
||||||
/// mode-0-start-state, mode-1-start-state, ... (parser has 0 modes)
|
|
||||||
/// num sets
|
|
||||||
/// set-0-interval-count intervals, set-1-interval-count intervals, ...
|
|
||||||
/// num total edges,
|
|
||||||
/// src, trg, edge-type, edge arg1, optional edge arg2 (present always), ...
|
|
||||||
/// num decisions,
|
|
||||||
/// decision-0-start-state, decision-1-start-state, ...
|
|
||||||
/// Convenient to pack into unsigned shorts to make as Java string.
|
|
||||||
/// </remarks>
|
|
||||||
public virtual List<int> Serialize()
|
|
||||||
{
|
|
||||||
List<int> data = new List<int>();
|
|
||||||
data.Add(ATNDeserializer.SerializedVersion);
|
|
||||||
SerializeUUID(data, ATNDeserializer.SerializedUuid);
|
|
||||||
// convert grammar type to ATN const to avoid dependence on ANTLRParser
|
|
||||||
data.Add((int)(atn.grammarType));
|
|
||||||
data.Add(atn.maxTokenType);
|
|
||||||
int nedges = 0;
|
|
||||||
IDictionary<IntervalSet, int> setIndices = new Dictionary<IntervalSet, int>();
|
|
||||||
IList<IntervalSet> sets = new List<IntervalSet>();
|
|
||||||
// dump states, count edges and collect sets while doing so
|
|
||||||
List<int> nonGreedyStates = new List<int>();
|
|
||||||
List<int> sllStates = new List<int>();
|
|
||||||
List<int> precedenceStates = new List<int>();
|
|
||||||
data.Add(atn.states.Count);
|
|
||||||
foreach (ATNState s in atn.states)
|
|
||||||
{
|
|
||||||
if (s == null)
|
|
||||||
{
|
|
||||||
// might be optimized away
|
|
||||||
data.Add((int)(StateType.InvalidType));
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
StateType stateType = s.StateType;
|
|
||||||
if (s is DecisionState)
|
|
||||||
{
|
|
||||||
DecisionState decisionState = (DecisionState)s;
|
|
||||||
if (decisionState.nonGreedy)
|
|
||||||
{
|
|
||||||
nonGreedyStates.Add(s.stateNumber);
|
|
||||||
}
|
|
||||||
if (decisionState.sll)
|
|
||||||
{
|
|
||||||
sllStates.Add(s.stateNumber);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (s is RuleStartState && ((RuleStartState)s).isPrecedenceRule)
|
|
||||||
{
|
|
||||||
precedenceStates.Add(s.stateNumber);
|
|
||||||
}
|
|
||||||
data.Add((int)(stateType));
|
|
||||||
if (s.ruleIndex == -1)
|
|
||||||
{
|
|
||||||
data.Add(char.MaxValue);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
data.Add(s.ruleIndex);
|
|
||||||
}
|
|
||||||
if (s.StateType == StateType.LoopEnd)
|
|
||||||
{
|
|
||||||
data.Add(((LoopEndState)s).loopBackState.stateNumber);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (s is BlockStartState)
|
|
||||||
{
|
|
||||||
data.Add(((BlockStartState)s).endState.stateNumber);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (s.StateType != StateType.RuleStop)
|
|
||||||
{
|
|
||||||
// the deserializer can trivially derive these edges, so there's no need to serialize them
|
|
||||||
nedges += s.NumberOfTransitions;
|
|
||||||
}
|
|
||||||
for (int i = 0; i < s.NumberOfTransitions; i++)
|
|
||||||
{
|
|
||||||
Transition t = s.Transition(i);
|
|
||||||
TransitionType edgeType = Transition.serializationTypes.Get(t.GetType());
|
|
||||||
if (edgeType == TransitionType.Set || edgeType == TransitionType.NotSet)
|
|
||||||
{
|
|
||||||
SetTransition st = (SetTransition)t;
|
|
||||||
if (!setIndices.ContainsKey(st.set))
|
|
||||||
{
|
|
||||||
sets.Add(st.set);
|
|
||||||
setIndices.Put(st.set, sets.Count - 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// non-greedy states
|
|
||||||
data.Add(nonGreedyStates.Size());
|
|
||||||
for (int i_1 = 0; i_1 < nonGreedyStates.Size(); i_1++)
|
|
||||||
{
|
|
||||||
data.Add(nonGreedyStates.Get(i_1));
|
|
||||||
}
|
|
||||||
// SLL decisions
|
|
||||||
data.Add(sllStates.Size());
|
|
||||||
for (int i_2 = 0; i_2 < sllStates.Size(); i_2++)
|
|
||||||
{
|
|
||||||
data.Add(sllStates.Get(i_2));
|
|
||||||
}
|
|
||||||
// precedence states
|
|
||||||
data.Add(precedenceStates.Size());
|
|
||||||
for (int i_3 = 0; i_3 < precedenceStates.Size(); i_3++)
|
|
||||||
{
|
|
||||||
data.Add(precedenceStates.Get(i_3));
|
|
||||||
}
|
|
||||||
int nrules = atn.ruleToStartState.Length;
|
|
||||||
data.Add(nrules);
|
|
||||||
for (int r = 0; r < nrules; r++)
|
|
||||||
{
|
|
||||||
ATNState ruleStartState = atn.ruleToStartState[r];
|
|
||||||
data.Add(ruleStartState.stateNumber);
|
|
||||||
bool leftFactored = ruleNames[ruleStartState.ruleIndex].IndexOf(ATNSimulator.RuleVariantDelimiter) >= 0;
|
|
||||||
data.Add(leftFactored ? 1 : 0);
|
|
||||||
if (atn.grammarType == ATNType.Lexer)
|
|
||||||
{
|
|
||||||
if (atn.ruleToTokenType[r] == TokenConstants.Eof)
|
|
||||||
{
|
|
||||||
data.Add(char.MaxValue);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
data.Add(atn.ruleToTokenType[r]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int nmodes = atn.modeToStartState.Count;
|
|
||||||
data.Add(nmodes);
|
|
||||||
if (nmodes > 0)
|
|
||||||
{
|
|
||||||
foreach (ATNState modeStartState in atn.modeToStartState)
|
|
||||||
{
|
|
||||||
data.Add(modeStartState.stateNumber);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int nsets = sets.Count;
|
|
||||||
data.Add(nsets);
|
|
||||||
foreach (IntervalSet set in sets)
|
|
||||||
{
|
|
||||||
bool containsEof = set.Contains(TokenConstants.Eof);
|
|
||||||
if (containsEof && set.GetIntervals()[0].b == TokenConstants.Eof)
|
|
||||||
{
|
|
||||||
data.Add(set.GetIntervals().Count - 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
data.Add(set.GetIntervals().Count);
|
|
||||||
}
|
|
||||||
data.Add(containsEof ? 1 : 0);
|
|
||||||
foreach (Interval I in set.GetIntervals())
|
|
||||||
{
|
|
||||||
if (I.a == TokenConstants.Eof)
|
|
||||||
{
|
|
||||||
if (I.b == TokenConstants.Eof)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
data.Add(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
data.Add(I.a);
|
|
||||||
}
|
|
||||||
data.Add(I.b);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
data.Add(nedges);
|
|
||||||
foreach (ATNState s_1 in atn.states)
|
|
||||||
{
|
|
||||||
if (s_1 == null)
|
|
||||||
{
|
|
||||||
// might be optimized away
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (s_1.StateType == StateType.RuleStop)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
for (int i = 0; i_3 < s_1.NumberOfTransitions; i_3++)
|
|
||||||
{
|
|
||||||
Transition t = s_1.Transition(i_3);
|
|
||||||
if (atn.states[t.target.stateNumber] == null)
|
|
||||||
{
|
|
||||||
throw new InvalidOperationException("Cannot serialize a transition to a removed state.");
|
|
||||||
}
|
|
||||||
int src = s_1.stateNumber;
|
|
||||||
int trg = t.target.stateNumber;
|
|
||||||
TransitionType edgeType = Transition.serializationTypes.Get(t.GetType());
|
|
||||||
int arg1 = 0;
|
|
||||||
int arg2 = 0;
|
|
||||||
int arg3 = 0;
|
|
||||||
switch (edgeType)
|
|
||||||
{
|
|
||||||
case TransitionType.Rule:
|
|
||||||
{
|
|
||||||
trg = ((RuleTransition)t).followState.stateNumber;
|
|
||||||
arg1 = ((RuleTransition)t).target.stateNumber;
|
|
||||||
arg2 = ((RuleTransition)t).ruleIndex;
|
|
||||||
arg3 = ((RuleTransition)t).precedence;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case TransitionType.Precedence:
|
|
||||||
{
|
|
||||||
PrecedencePredicateTransition ppt = (PrecedencePredicateTransition)t;
|
|
||||||
arg1 = ppt.precedence;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case TransitionType.Predicate:
|
|
||||||
{
|
|
||||||
PredicateTransition pt = (PredicateTransition)t;
|
|
||||||
arg1 = pt.ruleIndex;
|
|
||||||
arg2 = pt.predIndex;
|
|
||||||
arg3 = pt.isCtxDependent ? 1 : 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case TransitionType.Range:
|
|
||||||
{
|
|
||||||
arg1 = ((RangeTransition)t).from;
|
|
||||||
arg2 = ((RangeTransition)t).to;
|
|
||||||
if (arg1 == TokenConstants.Eof)
|
|
||||||
{
|
|
||||||
arg1 = 0;
|
|
||||||
arg3 = 1;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case TransitionType.Atom:
|
|
||||||
{
|
|
||||||
arg1 = ((AtomTransition)t).label;
|
|
||||||
if (arg1 == TokenConstants.Eof)
|
|
||||||
{
|
|
||||||
arg1 = 0;
|
|
||||||
arg3 = 1;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case TransitionType.Action:
|
|
||||||
{
|
|
||||||
ActionTransition at = (ActionTransition)t;
|
|
||||||
arg1 = at.ruleIndex;
|
|
||||||
arg2 = at.actionIndex;
|
|
||||||
if (arg2 == -1)
|
|
||||||
{
|
|
||||||
arg2 = unchecked((int)(0xFFFF));
|
|
||||||
}
|
|
||||||
arg3 = at.isCtxDependent ? 1 : 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case TransitionType.Set:
|
|
||||||
{
|
|
||||||
arg1 = setIndices.Get(((SetTransition)t).set);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case TransitionType.NotSet:
|
|
||||||
{
|
|
||||||
arg1 = setIndices.Get(((SetTransition)t).set);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case TransitionType.Wildcard:
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
data.Add(src);
|
|
||||||
data.Add(trg);
|
|
||||||
data.Add((int)(edgeType));
|
|
||||||
data.Add(arg1);
|
|
||||||
data.Add(arg2);
|
|
||||||
data.Add(arg3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int ndecisions = atn.decisionToState.Count;
|
|
||||||
data.Add(ndecisions);
|
|
||||||
foreach (DecisionState decStartState in atn.decisionToState)
|
|
||||||
{
|
|
||||||
data.Add(decStartState.stateNumber);
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// LEXER ACTIONS
|
|
||||||
//
|
|
||||||
if (atn.grammarType == ATNType.Lexer)
|
|
||||||
{
|
|
||||||
data.Add(atn.lexerActions.Length);
|
|
||||||
foreach (ILexerAction action in atn.lexerActions)
|
|
||||||
{
|
|
||||||
data.Add((int)(action.ActionType));
|
|
||||||
switch (action.ActionType)
|
|
||||||
{
|
|
||||||
case LexerActionType.Channel:
|
|
||||||
{
|
|
||||||
int channel = ((LexerChannelAction)action).Channel;
|
|
||||||
data.Add(channel != -1 ? channel : unchecked((int)(0xFFFF)));
|
|
||||||
data.Add(0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case LexerActionType.Custom:
|
|
||||||
{
|
|
||||||
int ruleIndex = ((LexerCustomAction)action).RuleIndex;
|
|
||||||
int actionIndex = ((LexerCustomAction)action).ActionIndex;
|
|
||||||
data.Add(ruleIndex != -1 ? ruleIndex : unchecked((int)(0xFFFF)));
|
|
||||||
data.Add(actionIndex != -1 ? actionIndex : unchecked((int)(0xFFFF)));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case LexerActionType.Mode:
|
|
||||||
{
|
|
||||||
int mode = ((LexerModeAction)action).Mode;
|
|
||||||
data.Add(mode != -1 ? mode : unchecked((int)(0xFFFF)));
|
|
||||||
data.Add(0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case LexerActionType.More:
|
|
||||||
{
|
|
||||||
data.Add(0);
|
|
||||||
data.Add(0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case LexerActionType.PopMode:
|
|
||||||
{
|
|
||||||
data.Add(0);
|
|
||||||
data.Add(0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case LexerActionType.PushMode:
|
|
||||||
{
|
|
||||||
mode = ((LexerPushModeAction)action).Mode;
|
|
||||||
data.Add(mode != -1 ? mode : unchecked((int)(0xFFFF)));
|
|
||||||
data.Add(0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case LexerActionType.Skip:
|
|
||||||
{
|
|
||||||
data.Add(0);
|
|
||||||
data.Add(0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case LexerActionType.Type:
|
|
||||||
{
|
|
||||||
int type = ((LexerTypeAction)action).Type;
|
|
||||||
data.Add(type != -1 ? type : unchecked((int)(0xFFFF)));
|
|
||||||
data.Add(0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
string message = string.Format(CultureInfo.CurrentCulture, "The specified lexer action type {0} is not valid.", action.ActionType);
|
|
||||||
throw new ArgumentException(message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// don't adjust the first value since that's the version number
|
|
||||||
for (int i_4 = 1; i_4 < data.Size(); i_4++)
|
|
||||||
{
|
|
||||||
if (data.Get(i_4) < char.MinValue || data.Get(i_4) > char.MaxValue)
|
|
||||||
{
|
|
||||||
throw new NotSupportedException("Serialized ATN data element out of range.");
|
|
||||||
}
|
|
||||||
int value = (data.Get(i_4) + 2) & unchecked((int)(0xFFFF));
|
|
||||||
data.Set(i_4, value);
|
|
||||||
}
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual string Decode(char[] data)
|
|
||||||
{
|
|
||||||
data = data.Clone();
|
|
||||||
// don't adjust the first value since that's the version number
|
|
||||||
for (int i = 1; i < data.Length; i++)
|
|
||||||
{
|
|
||||||
data[i] = (char)(data[i] - 2);
|
|
||||||
}
|
|
||||||
StringBuilder buf = new StringBuilder();
|
|
||||||
int p = 0;
|
|
||||||
int version = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
if (version != ATNDeserializer.SerializedVersion)
|
|
||||||
{
|
|
||||||
string reason = string.Format("Could not deserialize ATN with version {0} (expected {1}).", version, ATNDeserializer.SerializedVersion);
|
|
||||||
throw new NotSupportedException(new InvalidClassException(typeof(ATN).FullName, reason));
|
|
||||||
}
|
|
||||||
Guid uuid = ATNDeserializer.ToUUID(data, p);
|
|
||||||
p += 8;
|
|
||||||
if (!uuid.Equals(ATNDeserializer.SerializedUuid))
|
|
||||||
{
|
|
||||||
string reason = string.Format(CultureInfo.CurrentCulture, "Could not deserialize ATN with UUID {0} (expected {1}).", uuid, ATNDeserializer.SerializedUuid);
|
|
||||||
throw new NotSupportedException(new InvalidClassException(typeof(ATN).FullName, reason));
|
|
||||||
}
|
|
||||||
p++;
|
|
||||||
// skip grammarType
|
|
||||||
int maxType = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
buf.Append("max type ").Append(maxType).Append("\n");
|
|
||||||
int nstates = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
for (int i_1 = 0; i_1 < nstates; i_1++)
|
|
||||||
{
|
|
||||||
StateType stype = StateType.Values()[ATNDeserializer.ToInt(data[p++])];
|
|
||||||
if (stype == StateType.InvalidType)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// ignore bad type of states
|
|
||||||
int ruleIndex = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
if (ruleIndex == char.MaxValue)
|
|
||||||
{
|
|
||||||
ruleIndex = -1;
|
|
||||||
}
|
|
||||||
string arg = string.Empty;
|
|
||||||
if (stype == StateType.LoopEnd)
|
|
||||||
{
|
|
||||||
int loopBackStateNumber = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
arg = " " + loopBackStateNumber;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (stype == StateType.PlusBlockStart || stype == StateType.StarBlockStart || stype == StateType.BlockStart)
|
|
||||||
{
|
|
||||||
int endStateNumber = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
arg = " " + endStateNumber;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
buf.Append(i_1).Append(":").Append(ATNState.serializationNames[(int)(stype)]).Append(" ").Append(ruleIndex).Append(arg).Append("\n");
|
|
||||||
}
|
|
||||||
int numNonGreedyStates = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
for (int i_2 = 0; i_2 < numNonGreedyStates; i_2++)
|
|
||||||
{
|
|
||||||
int stateNumber = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
}
|
|
||||||
int numSllStates = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
for (int i_3 = 0; i_3 < numSllStates; i_3++)
|
|
||||||
{
|
|
||||||
int stateNumber = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
}
|
|
||||||
int numPrecedenceStates = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
for (int i_4 = 0; i_4 < numPrecedenceStates; i_4++)
|
|
||||||
{
|
|
||||||
int stateNumber = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
}
|
|
||||||
int nrules = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
for (int i_5 = 0; i_5 < nrules; i_5++)
|
|
||||||
{
|
|
||||||
int s = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
bool leftFactored = ATNDeserializer.ToInt(data[p++]) != 0;
|
|
||||||
if (atn.grammarType == ATNType.Lexer)
|
|
||||||
{
|
|
||||||
int arg1 = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
buf.Append("rule ").Append(i_5).Append(":").Append(s).Append(" ").Append(arg1).Append('\n');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
buf.Append("rule ").Append(i_5).Append(":").Append(s).Append('\n');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int nmodes = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
for (int i_6 = 0; i_6 < nmodes; i_6++)
|
|
||||||
{
|
|
||||||
int s = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
buf.Append("mode ").Append(i_6).Append(":").Append(s).Append('\n');
|
|
||||||
}
|
|
||||||
int nsets = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
for (int i_7 = 0; i_7 < nsets; i_7++)
|
|
||||||
{
|
|
||||||
int nintervals = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
buf.Append(i_7).Append(":");
|
|
||||||
bool containsEof = data[p++] != 0;
|
|
||||||
if (containsEof)
|
|
||||||
{
|
|
||||||
buf.Append(GetTokenName(TokenConstants.Eof));
|
|
||||||
}
|
|
||||||
for (int j = 0; j < nintervals; j++)
|
|
||||||
{
|
|
||||||
if (containsEof || j > 0)
|
|
||||||
{
|
|
||||||
buf.Append(", ");
|
|
||||||
}
|
|
||||||
buf.Append(GetTokenName(ATNDeserializer.ToInt(data[p]))).Append("..").Append(GetTokenName(ATNDeserializer.ToInt(data[p + 1])));
|
|
||||||
p += 2;
|
|
||||||
}
|
|
||||||
buf.Append("\n");
|
|
||||||
}
|
|
||||||
int nedges = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
for (int i_8 = 0; i_8 < nedges; i_8++)
|
|
||||||
{
|
|
||||||
int src = ATNDeserializer.ToInt(data[p]);
|
|
||||||
int trg = ATNDeserializer.ToInt(data[p + 1]);
|
|
||||||
int ttype = ATNDeserializer.ToInt(data[p + 2]);
|
|
||||||
int arg1 = ATNDeserializer.ToInt(data[p + 3]);
|
|
||||||
int arg2 = ATNDeserializer.ToInt(data[p + 4]);
|
|
||||||
int arg3 = ATNDeserializer.ToInt(data[p + 5]);
|
|
||||||
buf.Append(src).Append("->").Append(trg).Append(" ").Append(Transition.serializationNames[ttype]).Append(" ").Append(arg1).Append(",").Append(arg2).Append(",").Append(arg3).Append("\n");
|
|
||||||
p += 6;
|
|
||||||
}
|
|
||||||
int ndecisions = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
for (int i_9 = 0; i_9 < ndecisions; i_9++)
|
|
||||||
{
|
|
||||||
int s = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
buf.Append(i_9).Append(":").Append(s).Append("\n");
|
|
||||||
}
|
|
||||||
if (atn.grammarType == ATNType.Lexer)
|
|
||||||
{
|
|
||||||
int lexerActionCount = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
for (int i_10 = 0; i_10 < lexerActionCount; i_10++)
|
|
||||||
{
|
|
||||||
LexerActionType actionType = LexerActionType.Values()[ATNDeserializer.ToInt(data[p++])];
|
|
||||||
int data1 = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
int data2 = ATNDeserializer.ToInt(data[p++]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return buf.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual string GetTokenName(int t)
|
|
||||||
{
|
|
||||||
if (t == -1)
|
|
||||||
{
|
|
||||||
return "EOF";
|
|
||||||
}
|
|
||||||
if (atn.grammarType == ATNType.Lexer && t >= char.MinValue && t <= char.MaxValue)
|
|
||||||
{
|
|
||||||
switch (t)
|
|
||||||
{
|
|
||||||
case '\n':
|
|
||||||
{
|
|
||||||
return "'\\n'";
|
|
||||||
}
|
|
||||||
|
|
||||||
case '\r':
|
|
||||||
{
|
|
||||||
return "'\\r'";
|
|
||||||
}
|
|
||||||
|
|
||||||
case '\t':
|
|
||||||
{
|
|
||||||
return "'\\t'";
|
|
||||||
}
|
|
||||||
|
|
||||||
case '\b':
|
|
||||||
{
|
|
||||||
return "'\\b'";
|
|
||||||
}
|
|
||||||
|
|
||||||
case '\f':
|
|
||||||
{
|
|
||||||
return "'\\f'";
|
|
||||||
}
|
|
||||||
|
|
||||||
case '\\':
|
|
||||||
{
|
|
||||||
return "'\\\\'";
|
|
||||||
}
|
|
||||||
|
|
||||||
case '\'':
|
|
||||||
{
|
|
||||||
return "'\\''";
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
if (Character.UnicodeBlock.Of((char)t) == Character.UnicodeBlock.BasicLatin && !char.IsISOControl((char)t))
|
|
||||||
{
|
|
||||||
return '\'' + char.ToString((char)t) + '\'';
|
|
||||||
}
|
|
||||||
// turn on the bit above max "\uFFFF" value so that we pad with zeros
|
|
||||||
// then only take last 4 digits
|
|
||||||
string hex = Sharpen.Runtime.Substring(Antlr4.Runtime.Sharpen.Extensions.ToHexString(t | unchecked((int)(0x10000))).ToUpper(), 1, 5);
|
|
||||||
string unicodeStr = "'\\u" + hex + "'";
|
|
||||||
return unicodeStr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (tokenNames != null && t >= 0 && t < tokenNames.Count)
|
|
||||||
{
|
|
||||||
return tokenNames[t];
|
|
||||||
}
|
|
||||||
return t.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Used by Java target to encode short/int array as chars in string.</summary>
|
|
||||||
/// <remarks>Used by Java target to encode short/int array as chars in string.</remarks>
|
|
||||||
public static string GetSerializedAsString(ATN atn, IList<string> ruleNames)
|
|
||||||
{
|
|
||||||
return new string(GetSerializedAsChars(atn, ruleNames));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<int> GetSerialized(ATN atn, IList<string> ruleNames)
|
|
||||||
{
|
|
||||||
return new Antlr4.Runtime.Atn.ATNSerializer(atn, ruleNames).Serialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static char[] GetSerializedAsChars(ATN atn, IList<string> ruleNames)
|
|
||||||
{
|
|
||||||
return Utils.ToCharArray(GetSerialized(atn, ruleNames));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetDecoded(ATN atn, IList<string> ruleNames, IList<string> tokenNames)
|
|
||||||
{
|
|
||||||
List<int> serialized = GetSerialized(atn, ruleNames);
|
|
||||||
char[] data = Utils.ToCharArray(serialized);
|
|
||||||
return new Antlr4.Runtime.Atn.ATNSerializer(atn, ruleNames, tokenNames).Decode(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SerializeUUID(List<int> data, Guid uuid)
|
|
||||||
{
|
|
||||||
SerializeLong(data, uuid.GetLeastSignificantBits());
|
|
||||||
SerializeLong(data, uuid.GetMostSignificantBits());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SerializeLong(List<int> data, long value)
|
|
||||||
{
|
|
||||||
SerializeInt(data, (int)value);
|
|
||||||
SerializeInt(data, (int)(value >> 32));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SerializeInt(List<int> data, int value)
|
|
||||||
{
|
|
||||||
data.Add((char)value);
|
|
||||||
data.Add((char)(value >> 16));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -31,9 +31,7 @@ using System.Collections.Generic;
|
||||||
using Antlr4.Runtime.Atn;
|
using Antlr4.Runtime.Atn;
|
||||||
using Antlr4.Runtime.Dfa;
|
using Antlr4.Runtime.Dfa;
|
||||||
using Antlr4.Runtime.Sharpen;
|
using Antlr4.Runtime.Sharpen;
|
||||||
#if !PORTABLE || NET45PLUS
|
|
||||||
using Stopwatch = System.Diagnostics.Stopwatch;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace Antlr4.Runtime.Atn
|
namespace Antlr4.Runtime.Atn
|
||||||
{
|
{
|
||||||
|
@ -66,24 +64,6 @@ namespace Antlr4.Runtime.Atn
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public long invocations;
|
public long invocations;
|
||||||
|
|
||||||
#if !PORTABLE || NET45PLUS
|
|
||||||
/// <summary>
|
|
||||||
/// The total time spent in
|
|
||||||
/// <see cref="ParserATNSimulator.AdaptivePredict(ITokenStream, int, ParserRuleContext)"/>
|
|
||||||
/// for
|
|
||||||
/// this decision, in nanoseconds.
|
|
||||||
/// <p>
|
|
||||||
/// The value of this field is computed by <see cref="Stopwatch"/>,
|
|
||||||
/// and is not adjusted to compensate for JIT
|
|
||||||
/// and/or garbage collection overhead. For best accuracy, perform profiling
|
|
||||||
/// in a separate process which is warmed up by parsing the input prior to
|
|
||||||
/// profiling. If desired, call <see cref="ATNSimulator.ClearDFA()"/>
|
|
||||||
/// to reset the DFA cache to its initial
|
|
||||||
/// state before starting the profiling measurement pass.</p>
|
|
||||||
/// </summary>
|
|
||||||
public long timeInPrediction;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/// <summary>The sum of the lookahead required for SLL prediction for this decision.</summary>
|
/// <summary>The sum of the lookahead required for SLL prediction for this decision.</summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// The sum of the lookahead required for SLL prediction for this decision.
|
/// The sum of the lookahead required for SLL prediction for this decision.
|
||||||
|
|
|
@ -81,7 +81,7 @@ namespace Antlr4.Runtime.Atn
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Gets the decision numbers for decisions that required one or more
|
/// Gets the decision numbers for decisions that required one or more
|
||||||
/// full-context predictions during parsing. These are decisions for which
|
/// full-context predictions during parsing. These are decisions for which
|
||||||
/// <see cref="DecisionInfo.LL_Fallback"/>
|
/// <see cref="Antlr4.Runtime.Atn.DecisionInfo.LL_Fallback"/>
|
||||||
/// is non-zero.
|
/// is non-zero.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
|
@ -104,29 +104,6 @@ namespace Antlr4.Runtime.Atn
|
||||||
return Ll;
|
return Ll;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !PORTABLE || NET45PLUS
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the total time spent during prediction across all decisions made
|
|
||||||
/// during parsing.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Gets the total time spent during prediction across all decisions made
|
|
||||||
/// during parsing. This value is the sum of
|
|
||||||
/// <see cref="DecisionInfo.timeInPrediction"/>
|
|
||||||
/// for all decisions.
|
|
||||||
/// </remarks>
|
|
||||||
public virtual long GetTotalTimeInPrediction()
|
|
||||||
{
|
|
||||||
Antlr4.Runtime.Atn.DecisionInfo[] decisions = atnSimulator.DecisionInfo;
|
|
||||||
long t = 0;
|
|
||||||
for (int i = 0; i < decisions.Length; i++)
|
|
||||||
{
|
|
||||||
t += decisions[i].timeInPrediction;
|
|
||||||
}
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the total number of SLL lookahead operations across all decisions
|
/// Gets the total number of SLL lookahead operations across all decisions
|
||||||
/// made during parsing.
|
/// made during parsing.
|
||||||
|
@ -134,7 +111,7 @@ namespace Antlr4.Runtime.Atn
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Gets the total number of SLL lookahead operations across all decisions
|
/// Gets the total number of SLL lookahead operations across all decisions
|
||||||
/// made during parsing. This value is the sum of
|
/// made during parsing. This value is the sum of
|
||||||
/// <see cref="DecisionInfo.SLL_TotalLook"/>
|
/// <see cref="Antlr4.Runtime.Atn.DecisionInfo.SLL_TotalLook"/>
|
||||||
/// for all decisions.
|
/// for all decisions.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public virtual long GetTotalSLLLookaheadOps()
|
public virtual long GetTotalSLLLookaheadOps()
|
||||||
|
@ -155,7 +132,7 @@ namespace Antlr4.Runtime.Atn
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Gets the total number of LL lookahead operations across all decisions
|
/// Gets the total number of LL lookahead operations across all decisions
|
||||||
/// made during parsing. This value is the sum of
|
/// made during parsing. This value is the sum of
|
||||||
/// <see cref="DecisionInfo.LL_TotalLook"/>
|
/// <see cref="Antlr4.Runtime.Atn.DecisionInfo.LL_TotalLook"/>
|
||||||
/// for all decisions.
|
/// for all decisions.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public virtual long GetTotalLLLookaheadOps()
|
public virtual long GetTotalLLLookaheadOps()
|
||||||
|
|
|
@ -246,7 +246,6 @@ namespace Antlr4.Runtime.Atn
|
||||||
/// <c>)</c>
|
/// <c>)</c>
|
||||||
/// ;
|
/// ;
|
||||||
/// parser.
|
/// parser.
|
||||||
/// <see cref="Parser.ErrorHandler"/>
|
|
||||||
/// (new
|
/// (new
|
||||||
/// <see cref="Antlr4.Runtime.BailErrorStrategy"/>
|
/// <see cref="Antlr4.Runtime.BailErrorStrategy"/>
|
||||||
/// ());
|
/// ());
|
||||||
|
@ -737,7 +736,7 @@ namespace Antlr4.Runtime.Atn
|
||||||
/// and
|
/// and
|
||||||
/// <see cref="PredictionMode()"/>
|
/// <see cref="PredictionMode()"/>
|
||||||
/// is
|
/// is
|
||||||
/// <see cref="PredictionMode.LlExactAmbigDetection"/>
|
/// <see cref="Antlr4.Runtime.Atn.PredictionMode.LlExactAmbigDetection"/>
|
||||||
/// . In that case, only
|
/// . In that case, only
|
||||||
/// conflict states where
|
/// conflict states where
|
||||||
/// <see cref="ATNConfigSet.IsExactConflict()"/>
|
/// <see cref="ATNConfigSet.IsExactConflict()"/>
|
||||||
|
|
|
@ -32,9 +32,6 @@ using Antlr4.Runtime;
|
||||||
using Antlr4.Runtime.Atn;
|
using Antlr4.Runtime.Atn;
|
||||||
using Antlr4.Runtime.Dfa;
|
using Antlr4.Runtime.Dfa;
|
||||||
using Antlr4.Runtime.Sharpen;
|
using Antlr4.Runtime.Sharpen;
|
||||||
#if !PORTABLE || NET45PLUS
|
|
||||||
using Stopwatch = System.Diagnostics.Stopwatch;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace Antlr4.Runtime.Atn
|
namespace Antlr4.Runtime.Atn
|
||||||
{
|
{
|
||||||
|
@ -100,14 +97,8 @@ namespace Antlr4.Runtime.Atn
|
||||||
this.currentDecision = decision;
|
this.currentDecision = decision;
|
||||||
this.currentState = null;
|
this.currentState = null;
|
||||||
this.conflictingAltResolvedBySLL = ATN.InvalidAltNumber;
|
this.conflictingAltResolvedBySLL = ATN.InvalidAltNumber;
|
||||||
#if !PORTABLE || NET45PLUS
|
|
||||||
Stopwatch stopwatch = Stopwatch.StartNew();
|
|
||||||
#endif
|
|
||||||
// expensive but useful info
|
// expensive but useful info
|
||||||
int alt = base.AdaptivePredict(input, decision, outerContext);
|
int alt = base.AdaptivePredict(input, decision, outerContext);
|
||||||
#if !PORTABLE || NET45PLUS
|
|
||||||
decisions[decision].timeInPrediction += stopwatch.ElapsedTicks * 100;
|
|
||||||
#endif
|
|
||||||
decisions[decision].invocations++;
|
decisions[decision].invocations++;
|
||||||
int SLL_k = _sllStopIndex - _startIndex + 1;
|
int SLL_k = _sllStopIndex - _startIndex + 1;
|
||||||
decisions[decision].SLL_TotalLook += SLL_k;
|
decisions[decision].SLL_TotalLook += SLL_k;
|
||||||
|
|
|
@ -106,7 +106,7 @@ namespace Antlr4.Runtime
|
||||||
/// Indicates whether the
|
/// Indicates whether the
|
||||||
/// <see cref="TokenConstants.Eof"/>
|
/// <see cref="TokenConstants.Eof"/>
|
||||||
/// token has been fetched from
|
/// token has been fetched from
|
||||||
/// <see cref="tokenSource"/>
|
/// <see cref="_tokenSource"/>
|
||||||
/// and added to
|
/// and added to
|
||||||
/// <see cref="tokens"/>
|
/// <see cref="tokens"/>
|
||||||
/// . This field improves
|
/// . This field improves
|
||||||
|
|
|
@ -164,14 +164,14 @@ namespace Antlr4.Runtime
|
||||||
/// <see cref="CommonToken"/>
|
/// <see cref="CommonToken"/>
|
||||||
/// instance, the newly
|
/// instance, the newly
|
||||||
/// constructed token will share a reference to the
|
/// constructed token will share a reference to the
|
||||||
/// <see cref="text"/>
|
/// <see cref="Text()"/>
|
||||||
/// field and
|
/// field and
|
||||||
/// the
|
/// the
|
||||||
/// <see cref="Tuple{T1, T2}"/>
|
/// <see cref="Tuple{T1, T2}"/>
|
||||||
/// stored in
|
/// stored in
|
||||||
/// <see cref="source"/>
|
/// <see cref="source"/>
|
||||||
/// . Otherwise,
|
/// . Otherwise,
|
||||||
/// <see cref="text"/>
|
/// <see cref="Text()"/>
|
||||||
/// will
|
/// will
|
||||||
/// be assigned the result of calling
|
/// be assigned the result of calling
|
||||||
/// <see cref="Text()"/>
|
/// <see cref="Text()"/>
|
||||||
|
|
|
@ -234,6 +234,7 @@ namespace Antlr4.Runtime.Dfa
|
||||||
/// <summary>Get the start state for a specific precedence value.</summary>
|
/// <summary>Get the start state for a specific precedence value.</summary>
|
||||||
/// <remarks>Get the start state for a specific precedence value.</remarks>
|
/// <remarks>Get the start state for a specific precedence value.</remarks>
|
||||||
/// <param name="precedence">The current precedence.</param>
|
/// <param name="precedence">The current precedence.</param>
|
||||||
|
/// <param name="fullContext">Whether to get from local of full context.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// The start state corresponding to the specified precedence, or
|
/// The start state corresponding to the specified precedence, or
|
||||||
/// <see langword="null"/>
|
/// <see langword="null"/>
|
||||||
|
@ -260,6 +261,7 @@ namespace Antlr4.Runtime.Dfa
|
||||||
/// <summary>Set the start state for a specific precedence value.</summary>
|
/// <summary>Set the start state for a specific precedence value.</summary>
|
||||||
/// <remarks>Set the start state for a specific precedence value.</remarks>
|
/// <remarks>Set the start state for a specific precedence value.</remarks>
|
||||||
/// <param name="precedence">The current precedence.</param>
|
/// <param name="precedence">The current precedence.</param>
|
||||||
|
/// <param name="fullContext">Whether to set local of full context.</param>
|
||||||
/// <param name="startState">
|
/// <param name="startState">
|
||||||
/// The start state corresponding to the specified
|
/// The start state corresponding to the specified
|
||||||
/// precedence.
|
/// precedence.
|
||||||
|
|
|
@ -1,689 +0,0 @@
|
||||||
/*
|
|
||||||
* [The "BSD license"]
|
|
||||||
* Copyright (c) 2013 Terence Parr
|
|
||||||
* Copyright (c) 2013 Sam Harwell
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
||||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
||||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using Antlr4.Runtime.Misc;
|
|
||||||
using Antlr4.Runtime.Sharpen;
|
|
||||||
|
|
||||||
namespace Antlr4.Runtime.Misc
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// <see cref="Antlr4.Runtime.Sharpen.ISet{E}"/>
|
|
||||||
/// implementation with closed hashing (open addressing).
|
|
||||||
/// </summary>
|
|
||||||
public class Array2DHashSet<T> : HashSet<T>
|
|
||||||
{
|
|
||||||
public const int InitalCapacity = 16;
|
|
||||||
|
|
||||||
public const int InitalBucketCapacity = 8;
|
|
||||||
|
|
||||||
public const double LoadFactor = 0.75;
|
|
||||||
|
|
||||||
[NotNull]
|
|
||||||
protected internal readonly EqualityComparer<T> comparator;
|
|
||||||
|
|
||||||
protected internal T[][] buckets;
|
|
||||||
|
|
||||||
/// <summary>How many elements in set</summary>
|
|
||||||
protected internal int n = 0;
|
|
||||||
|
|
||||||
protected internal int threshold = (int)(InitalCapacity * LoadFactor);
|
|
||||||
|
|
||||||
protected internal int currentPrime = 1;
|
|
||||||
|
|
||||||
protected internal int initialBucketCapacity = InitalBucketCapacity;
|
|
||||||
|
|
||||||
public Array2DHashSet()
|
|
||||||
: this(null, InitalCapacity, InitalBucketCapacity)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public Array2DHashSet(EqualityComparer<T> comparator)
|
|
||||||
: this(comparator, InitalCapacity, InitalBucketCapacity)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public Array2DHashSet(EqualityComparer<T> comparator, int initialCapacity, int initialBucketCapacity)
|
|
||||||
{
|
|
||||||
// must be power of 2
|
|
||||||
// when to expand
|
|
||||||
// jump by 4 primes each expand or whatever
|
|
||||||
if (comparator == null)
|
|
||||||
{
|
|
||||||
comparator = ObjectEqualityComparator.Instance;
|
|
||||||
}
|
|
||||||
this.comparator = comparator;
|
|
||||||
this.buckets = CreateBuckets(initialCapacity);
|
|
||||||
this.initialBucketCapacity = initialBucketCapacity;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add
|
|
||||||
/// <paramref name="o"/>
|
|
||||||
/// to set if not there; return existing value if already
|
|
||||||
/// there. This method performs the same operation as
|
|
||||||
/// <see cref="Array2DHashSet{T}.Add(object)"/>
|
|
||||||
/// aside from
|
|
||||||
/// the return value.
|
|
||||||
/// </summary>
|
|
||||||
public T GetOrAdd(T o)
|
|
||||||
{
|
|
||||||
if (n > threshold)
|
|
||||||
{
|
|
||||||
Expand();
|
|
||||||
}
|
|
||||||
return GetOrAddImpl(o);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected internal virtual T GetOrAddImpl(T o)
|
|
||||||
{
|
|
||||||
int b = GetBucket(o);
|
|
||||||
T[] bucket = buckets[b];
|
|
||||||
// NEW BUCKET
|
|
||||||
if (bucket == null)
|
|
||||||
{
|
|
||||||
bucket = CreateBucket(initialBucketCapacity);
|
|
||||||
bucket[0] = o;
|
|
||||||
buckets[b] = bucket;
|
|
||||||
n++;
|
|
||||||
return o;
|
|
||||||
}
|
|
||||||
// LOOK FOR IT IN BUCKET
|
|
||||||
for (int i = 0; i < bucket.Length; i++)
|
|
||||||
{
|
|
||||||
T existing = bucket[i];
|
|
||||||
if (existing == null)
|
|
||||||
{
|
|
||||||
// empty slot; not there, add.
|
|
||||||
bucket[i] = o;
|
|
||||||
n++;
|
|
||||||
return o;
|
|
||||||
}
|
|
||||||
if (comparator.Equals(existing, o))
|
|
||||||
{
|
|
||||||
return existing;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// found existing, quit
|
|
||||||
// FULL BUCKET, expand and add to end
|
|
||||||
int oldLength = bucket.Length;
|
|
||||||
bucket = Arrays.CopyOf(bucket, bucket.Length * 2);
|
|
||||||
buckets[b] = bucket;
|
|
||||||
bucket[oldLength] = o;
|
|
||||||
// add to end
|
|
||||||
n++;
|
|
||||||
return o;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual T Get(T o)
|
|
||||||
{
|
|
||||||
if (o == null)
|
|
||||||
{
|
|
||||||
return o;
|
|
||||||
}
|
|
||||||
int b = GetBucket(o);
|
|
||||||
T[] bucket = buckets[b];
|
|
||||||
if (bucket == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
// no bucket
|
|
||||||
foreach (T e in bucket)
|
|
||||||
{
|
|
||||||
if (e == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
// empty slot; not there
|
|
||||||
if (comparator.Equals(e, o))
|
|
||||||
{
|
|
||||||
return e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected internal int GetBucket(T o)
|
|
||||||
{
|
|
||||||
int hash = comparator.GetHashCode(o);
|
|
||||||
int b = hash & (buckets.Length - 1);
|
|
||||||
// assumes len is power of 2
|
|
||||||
return b;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int GetHashCode()
|
|
||||||
{
|
|
||||||
int hash = MurmurHash.Initialize();
|
|
||||||
foreach (T[] bucket in buckets)
|
|
||||||
{
|
|
||||||
if (bucket == null)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
foreach (T o in bucket)
|
|
||||||
{
|
|
||||||
if (o == null)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
hash = MurmurHash.Update(hash, comparator.GetHashCode(o));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
hash = MurmurHash.Finish(hash, Count);
|
|
||||||
return hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool Equals(object o)
|
|
||||||
{
|
|
||||||
if (o == this)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (!(o is Antlr4.Runtime.Misc.Array2DHashSet))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Antlr4.Runtime.Misc.Array2DHashSet<object> other = (Antlr4.Runtime.Misc.Array2DHashSet<object>)o;
|
|
||||||
if (other.Count != Count)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
bool same = this.ContainsAll(other);
|
|
||||||
return same;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected internal virtual void Expand()
|
|
||||||
{
|
|
||||||
T[][] old = buckets;
|
|
||||||
currentPrime += 4;
|
|
||||||
int newCapacity = buckets.Length * 2;
|
|
||||||
T[][] newTable = CreateBuckets(newCapacity);
|
|
||||||
int[] newBucketLengths = new int[newTable.Length];
|
|
||||||
buckets = newTable;
|
|
||||||
threshold = (int)(newCapacity * LoadFactor);
|
|
||||||
// System.out.println("new size="+newCapacity+", thres="+threshold);
|
|
||||||
// rehash all existing entries
|
|
||||||
int oldSize = Count;
|
|
||||||
foreach (T[] bucket in old)
|
|
||||||
{
|
|
||||||
if (bucket == null)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
foreach (T o in bucket)
|
|
||||||
{
|
|
||||||
if (o == null)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
int b = GetBucket(o);
|
|
||||||
int bucketLength = newBucketLengths[b];
|
|
||||||
T[] newBucket;
|
|
||||||
if (bucketLength == 0)
|
|
||||||
{
|
|
||||||
// new bucket
|
|
||||||
newBucket = CreateBucket(initialBucketCapacity);
|
|
||||||
newTable[b] = newBucket;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
newBucket = newTable[b];
|
|
||||||
if (bucketLength == newBucket.Length)
|
|
||||||
{
|
|
||||||
// expand
|
|
||||||
newBucket = Arrays.CopyOf(newBucket, newBucket.Length * 2);
|
|
||||||
newTable[b] = newBucket;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
newBucket[bucketLength] = o;
|
|
||||||
newBucketLengths[b]++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
System.Diagnostics.Debug.Assert(n == oldSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Add(T t)
|
|
||||||
{
|
|
||||||
T existing = GetOrAdd(t);
|
|
||||||
return existing == t;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int Count
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return n;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsEmpty()
|
|
||||||
{
|
|
||||||
return n == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Contains(object o)
|
|
||||||
{
|
|
||||||
return ContainsFast(AsElementType(o));
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual bool ContainsFast(T obj)
|
|
||||||
{
|
|
||||||
if (obj == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return Get(obj) != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual IEnumerator<T> GetEnumerator()
|
|
||||||
{
|
|
||||||
return new Array2DHashSet.SetIterator(this, Sharpen.Collections.ToArray(this));
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual T[] ToArray()
|
|
||||||
{
|
|
||||||
T[] a = CreateBucket(Count);
|
|
||||||
int i = 0;
|
|
||||||
foreach (T[] bucket in buckets)
|
|
||||||
{
|
|
||||||
if (bucket == null)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
foreach (T o in bucket)
|
|
||||||
{
|
|
||||||
if (o == null)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
a[i++] = o;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual U[] ToArray<U>(U[] a)
|
|
||||||
{
|
|
||||||
if (a.Length < Count)
|
|
||||||
{
|
|
||||||
a = Arrays.CopyOf(a, Count);
|
|
||||||
}
|
|
||||||
int i = 0;
|
|
||||||
foreach (T[] bucket in buckets)
|
|
||||||
{
|
|
||||||
if (bucket == null)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
foreach (T o in bucket)
|
|
||||||
{
|
|
||||||
if (o == null)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
U targetElement = (U)o;
|
|
||||||
// array store will check this
|
|
||||||
a[i++] = targetElement;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Remove(object o)
|
|
||||||
{
|
|
||||||
return RemoveFast(AsElementType(o));
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual bool RemoveFast(T obj)
|
|
||||||
{
|
|
||||||
if (obj == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
int b = GetBucket(obj);
|
|
||||||
T[] bucket = buckets[b];
|
|
||||||
if (bucket == null)
|
|
||||||
{
|
|
||||||
// no bucket
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
for (int i = 0; i < bucket.Length; i++)
|
|
||||||
{
|
|
||||||
T e = bucket[i];
|
|
||||||
if (e == null)
|
|
||||||
{
|
|
||||||
// empty slot; not there
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (comparator.Equals(e, obj))
|
|
||||||
{
|
|
||||||
// found it
|
|
||||||
// shift all elements to the right down one
|
|
||||||
System.Array.Copy(bucket, i + 1, bucket, i, bucket.Length - i - 1);
|
|
||||||
bucket[bucket.Length - 1] = null;
|
|
||||||
n--;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual bool ContainsAll<_T0>(ICollection<_T0> collection)
|
|
||||||
{
|
|
||||||
if (collection is Antlr4.Runtime.Misc.Array2DHashSet)
|
|
||||||
{
|
|
||||||
Antlr4.Runtime.Misc.Array2DHashSet<object> s = (Antlr4.Runtime.Misc.Array2DHashSet<object>)collection;
|
|
||||||
foreach (object[] bucket in s.buckets)
|
|
||||||
{
|
|
||||||
if (bucket == null)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
foreach (object o in bucket)
|
|
||||||
{
|
|
||||||
if (o == null)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (!this.ContainsFast(AsElementType(o)))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach (object o in collection)
|
|
||||||
{
|
|
||||||
if (!this.ContainsFast(AsElementType(o)))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual bool AddAll<_T0>(ICollection<_T0> c)
|
|
||||||
where _T0 : T
|
|
||||||
{
|
|
||||||
bool changed = false;
|
|
||||||
foreach (T o in c)
|
|
||||||
{
|
|
||||||
T existing = GetOrAdd(o);
|
|
||||||
if (existing != o)
|
|
||||||
{
|
|
||||||
changed = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return changed;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual bool RetainAll<_T0>(ICollection<_T0> c)
|
|
||||||
{
|
|
||||||
int newsize = 0;
|
|
||||||
foreach (T[] bucket in buckets)
|
|
||||||
{
|
|
||||||
if (bucket == null)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
int i;
|
|
||||||
int j;
|
|
||||||
for (i = 0, j = 0; i < bucket.Length; i++)
|
|
||||||
{
|
|
||||||
if (bucket[i] == null)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (!c.Contains(bucket[i]))
|
|
||||||
{
|
|
||||||
// removed
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// keep
|
|
||||||
if (i != j)
|
|
||||||
{
|
|
||||||
bucket[j] = bucket[i];
|
|
||||||
}
|
|
||||||
j++;
|
|
||||||
newsize++;
|
|
||||||
}
|
|
||||||
newsize += j;
|
|
||||||
while (j < i)
|
|
||||||
{
|
|
||||||
bucket[j] = null;
|
|
||||||
j++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
bool changed = newsize != n;
|
|
||||||
n = newsize;
|
|
||||||
return changed;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual bool RemoveAll<_T0>(ICollection<_T0> c)
|
|
||||||
{
|
|
||||||
bool changed = false;
|
|
||||||
foreach (object o in c)
|
|
||||||
{
|
|
||||||
changed |= RemoveFast(AsElementType(o));
|
|
||||||
}
|
|
||||||
return changed;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void Clear()
|
|
||||||
{
|
|
||||||
buckets = CreateBuckets(InitalCapacity);
|
|
||||||
n = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string ToString()
|
|
||||||
{
|
|
||||||
if (Count == 0)
|
|
||||||
{
|
|
||||||
return "{}";
|
|
||||||
}
|
|
||||||
StringBuilder buf = new StringBuilder();
|
|
||||||
buf.Append('{');
|
|
||||||
bool first = true;
|
|
||||||
foreach (T[] bucket in buckets)
|
|
||||||
{
|
|
||||||
if (bucket == null)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
foreach (T o in bucket)
|
|
||||||
{
|
|
||||||
if (o == null)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (first)
|
|
||||||
{
|
|
||||||
first = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
buf.Append(", ");
|
|
||||||
}
|
|
||||||
buf.Append(o.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
buf.Append('}');
|
|
||||||
return buf.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual string ToTableString()
|
|
||||||
{
|
|
||||||
StringBuilder buf = new StringBuilder();
|
|
||||||
foreach (T[] bucket in buckets)
|
|
||||||
{
|
|
||||||
if (bucket == null)
|
|
||||||
{
|
|
||||||
buf.Append("null\n");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
buf.Append('[');
|
|
||||||
bool first = true;
|
|
||||||
foreach (T o in bucket)
|
|
||||||
{
|
|
||||||
if (first)
|
|
||||||
{
|
|
||||||
first = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
buf.Append(" ");
|
|
||||||
}
|
|
||||||
if (o == null)
|
|
||||||
{
|
|
||||||
buf.Append("_");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
buf.Append(o.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
buf.Append("]\n");
|
|
||||||
}
|
|
||||||
return buf.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Return
|
|
||||||
/// <paramref name="o"/>
|
|
||||||
/// as an instance of the element type
|
|
||||||
/// <c>T</c>
|
|
||||||
/// . If
|
|
||||||
/// <paramref name="o"/>
|
|
||||||
/// is non-null but known to not be an instance of
|
|
||||||
/// <c>T</c>
|
|
||||||
/// , this
|
|
||||||
/// method returns
|
|
||||||
/// <see langword="null"/>
|
|
||||||
/// . The base implementation does not perform any
|
|
||||||
/// type checks; override this method to provide strong type checks for the
|
|
||||||
/// <see cref="Array2DHashSet{T}.Contains(object)"/>
|
|
||||||
/// and
|
|
||||||
/// <see cref="Array2DHashSet{T}.Remove(object)"/>
|
|
||||||
/// methods to ensure the arguments to
|
|
||||||
/// the
|
|
||||||
/// <see cref="IEqualityComparator{T}"/>
|
|
||||||
/// for the set always have the expected
|
|
||||||
/// types.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="o">the object to try and cast to the element type of the set</param>
|
|
||||||
/// <returns>
|
|
||||||
///
|
|
||||||
/// <paramref name="o"/>
|
|
||||||
/// if it could be an instance of
|
|
||||||
/// <c>T</c>
|
|
||||||
/// , otherwise
|
|
||||||
/// <see langword="null"/>
|
|
||||||
/// .
|
|
||||||
/// </returns>
|
|
||||||
protected internal virtual T AsElementType(object o)
|
|
||||||
{
|
|
||||||
return (T)o;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Return an array of
|
|
||||||
/// <c>T[]</c>
|
|
||||||
/// with length
|
|
||||||
/// <paramref name="capacity"/>
|
|
||||||
/// .
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="capacity">the length of the array to return</param>
|
|
||||||
/// <returns>the newly constructed array</returns>
|
|
||||||
protected internal virtual T[][] CreateBuckets(int capacity)
|
|
||||||
{
|
|
||||||
return new T[capacity][];
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Return an array of
|
|
||||||
/// <c>T</c>
|
|
||||||
/// with length
|
|
||||||
/// <paramref name="capacity"/>
|
|
||||||
/// .
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="capacity">the length of the array to return</param>
|
|
||||||
/// <returns>the newly constructed array</returns>
|
|
||||||
protected internal virtual T[] CreateBucket(int capacity)
|
|
||||||
{
|
|
||||||
return new T[capacity];
|
|
||||||
}
|
|
||||||
|
|
||||||
protected internal class SetIterator : IEnumerator<T>
|
|
||||||
{
|
|
||||||
internal readonly T[] data;
|
|
||||||
|
|
||||||
internal int nextIndex = 0;
|
|
||||||
|
|
||||||
internal bool removed = true;
|
|
||||||
|
|
||||||
public SetIterator(Array2DHashSet<T> _enclosing, T[] data)
|
|
||||||
{
|
|
||||||
this._enclosing = _enclosing;
|
|
||||||
this.data = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual bool HasNext()
|
|
||||||
{
|
|
||||||
return this.nextIndex < this.data.Length;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual T Next()
|
|
||||||
{
|
|
||||||
if (!this.HasNext())
|
|
||||||
{
|
|
||||||
throw new InvalidOperationException();
|
|
||||||
}
|
|
||||||
this.removed = false;
|
|
||||||
return this.data[this.nextIndex++];
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void Remove()
|
|
||||||
{
|
|
||||||
if (this.removed)
|
|
||||||
{
|
|
||||||
throw new InvalidOperationException();
|
|
||||||
}
|
|
||||||
this._enclosing._enclosing.Remove(this.data[this.nextIndex - 1]);
|
|
||||||
this.removed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private readonly Array2DHashSet<T> _enclosing;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,106 +0,0 @@
|
||||||
/*
|
|
||||||
* [The "BSD license"]
|
|
||||||
* Copyright (c) 2013 Terence Parr
|
|
||||||
* Copyright (c) 2013 Sam Harwell
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
||||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
||||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Antlr4.Runtime.Misc;
|
|
||||||
using Antlr4.Runtime.Sharpen;
|
|
||||||
|
|
||||||
namespace Antlr4.Runtime.Misc
|
|
||||||
{
|
|
||||||
/// <summary>Sometimes we need to map a key to a value but key is two pieces of data.</summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Sometimes we need to map a key to a value but key is two pieces of data.
|
|
||||||
/// This nested hash table saves creating a single key each time we access
|
|
||||||
/// map; avoids mem creation.
|
|
||||||
/// </remarks>
|
|
||||||
public class DoubleKeyMap<Key1, Key2, Value>
|
|
||||||
{
|
|
||||||
internal IDictionary<Key1, IDictionary<Key2, Value>> data = new LinkedHashMap<Key1, IDictionary<Key2, Value>>();
|
|
||||||
|
|
||||||
public virtual Value Put(Key1 k1, Key2 k2, Value v)
|
|
||||||
{
|
|
||||||
IDictionary<Key2, Value> data2 = data.Get(k1);
|
|
||||||
Value prev = null;
|
|
||||||
if (data2 == null)
|
|
||||||
{
|
|
||||||
data2 = new LinkedHashMap<Key2, Value>();
|
|
||||||
data.Put(k1, data2);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
prev = data2.Get(k2);
|
|
||||||
}
|
|
||||||
data2.Put(k2, v);
|
|
||||||
return prev;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual Value Get(Key1 k1, Key2 k2)
|
|
||||||
{
|
|
||||||
IDictionary<Key2, Value> data2 = data.Get(k1);
|
|
||||||
if (data2 == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return data2.Get(k2);
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual IDictionary<Key2, Value> Get(Key1 k1)
|
|
||||||
{
|
|
||||||
return data.Get(k1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Get all values associated with primary key</summary>
|
|
||||||
public virtual ICollection<Value> Values(Key1 k1)
|
|
||||||
{
|
|
||||||
IDictionary<Key2, Value> data2 = data.Get(k1);
|
|
||||||
if (data2 == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return data2.Values;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>get all primary keys</summary>
|
|
||||||
public virtual HashSet<Key1> KeySet()
|
|
||||||
{
|
|
||||||
return data.Keys;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>get all secondary keys associated with a primary key</summary>
|
|
||||||
public virtual HashSet<Key2> KeySet(Key1 k1)
|
|
||||||
{
|
|
||||||
IDictionary<Key2, Value> data2 = data.Get(k1);
|
|
||||||
if (data2 == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return data2.Keys;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,166 +0,0 @@
|
||||||
/*
|
|
||||||
* [The "BSD license"]
|
|
||||||
* Copyright (c) 2013 Terence Parr
|
|
||||||
* Copyright (c) 2013 Sam Harwell
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
||||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
||||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Antlr4.Runtime.Misc;
|
|
||||||
using Antlr4.Runtime.Sharpen;
|
|
||||||
|
|
||||||
namespace Antlr4.Runtime.Misc
|
|
||||||
{
|
|
||||||
/// <summary>A HashMap that remembers the order that the elements were added.</summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// A HashMap that remembers the order that the elements were added.
|
|
||||||
/// You can alter the ith element with set(i,value) too :) Unique list.
|
|
||||||
/// I need the replace/set-element-i functionality so I'm subclassing
|
|
||||||
/// LinkedHashSet.
|
|
||||||
/// </remarks>
|
|
||||||
[System.Serializable]
|
|
||||||
public class OrderedHashSet<T> : LinkedHashSet<T>
|
|
||||||
{
|
|
||||||
private const long serialVersionUID = 5281944403755906761L;
|
|
||||||
|
|
||||||
/// <summary>Track the elements as they are added to the set</summary>
|
|
||||||
protected internal List<T> elements = new List<T>();
|
|
||||||
|
|
||||||
public virtual T Get(int i)
|
|
||||||
{
|
|
||||||
return elements[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Replace an existing value with a new value; updates the element
|
|
||||||
/// list and the hash table, but not the key as that has not changed.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Replace an existing value with a new value; updates the element
|
|
||||||
/// list and the hash table, but not the key as that has not changed.
|
|
||||||
/// </remarks>
|
|
||||||
public virtual T Set(int i, T value)
|
|
||||||
{
|
|
||||||
T oldElement = elements[i];
|
|
||||||
elements.Set(i, value);
|
|
||||||
// update list
|
|
||||||
base.Remove(oldElement);
|
|
||||||
// now update the set: remove/add
|
|
||||||
base.Add(value);
|
|
||||||
return oldElement;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual bool Remove(int i)
|
|
||||||
{
|
|
||||||
T o = elements.RemoveAt(i);
|
|
||||||
return base.Remove(o);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add a value to list; keep in hashtable for consistency also;
|
|
||||||
/// Key is object itself.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Add a value to list; keep in hashtable for consistency also;
|
|
||||||
/// Key is object itself. Good for say asking if a certain string is in
|
|
||||||
/// a list of strings.
|
|
||||||
/// </remarks>
|
|
||||||
public override bool Add(T value)
|
|
||||||
{
|
|
||||||
bool result = base.Add(value);
|
|
||||||
if (result)
|
|
||||||
{
|
|
||||||
// only track if new element not in set
|
|
||||||
elements.Add(value);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool Remove(object o)
|
|
||||||
{
|
|
||||||
throw new NotSupportedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Clear()
|
|
||||||
{
|
|
||||||
elements.Clear();
|
|
||||||
base.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int GetHashCode()
|
|
||||||
{
|
|
||||||
return elements.GetHashCode();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool Equals(object o)
|
|
||||||
{
|
|
||||||
if (!(o is OrderedHashSet<object>))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// System.out.print("equals " + this + ", " + o+" = ");
|
|
||||||
bool same = elements != null && elements.Equals(((OrderedHashSet<object>)o).elements);
|
|
||||||
// System.out.println(same);
|
|
||||||
return same;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override IEnumerator<T> GetEnumerator()
|
|
||||||
{
|
|
||||||
return elements.GetEnumerator();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Return the List holding list of table elements.</summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Return the List holding list of table elements. Note that you are
|
|
||||||
/// NOT getting a copy so don't write to the list.
|
|
||||||
/// </remarks>
|
|
||||||
public virtual IList<T> Elements
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return elements;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override object Clone()
|
|
||||||
{
|
|
||||||
OrderedHashSet<T> dup = (OrderedHashSet<T>)base.Clone();
|
|
||||||
// safe (result of clone)
|
|
||||||
dup.elements = new List<T>(this.elements);
|
|
||||||
return dup;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override object[] ToArray()
|
|
||||||
{
|
|
||||||
return Sharpen.Collections.ToArray(elements);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string ToString()
|
|
||||||
{
|
|
||||||
return elements.ToString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,789 +0,0 @@
|
||||||
/*
|
|
||||||
* [The "BSD license"]
|
|
||||||
* Copyright (c) 2013 Terence Parr
|
|
||||||
* Copyright (c) 2013 Sam Harwell
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
||||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
||||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Antlr4.Runtime;
|
|
||||||
using Antlr4.Runtime.Atn;
|
|
||||||
using Antlr4.Runtime.Misc;
|
|
||||||
using Antlr4.Runtime.Sharpen;
|
|
||||||
using Antlr4.Runtime.Sharpen.Annotation;
|
|
||||||
using Javax.Annotation.Processing;
|
|
||||||
using Javax.Lang.Model;
|
|
||||||
using Javax.Lang.Model.Element;
|
|
||||||
using Javax.Lang.Model.Type;
|
|
||||||
using Javax.Tools;
|
|
||||||
|
|
||||||
namespace Antlr4.Runtime.Misc
|
|
||||||
{
|
|
||||||
/// <summary>A compile-time validator for rule dependencies.</summary>
|
|
||||||
/// <remarks>A compile-time validator for rule dependencies.</remarks>
|
|
||||||
/// <seealso cref="Antlr4.Runtime.RuleDependency"/>
|
|
||||||
/// <seealso cref="Antlr4.Runtime.RuleDependencies"/>
|
|
||||||
/// <author>Sam Harwell</author>
|
|
||||||
public class RuleDependencyProcessor : AbstractProcessor
|
|
||||||
{
|
|
||||||
public const string RuleDependencyClassName = "org.antlr.v4.runtime.RuleDependency";
|
|
||||||
|
|
||||||
public const string RuleDependenciesClassName = "org.antlr.v4.runtime.RuleDependencies";
|
|
||||||
|
|
||||||
public const string RuleVersionClassName = "org.antlr.v4.runtime.RuleVersion";
|
|
||||||
|
|
||||||
public RuleDependencyProcessor()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override SourceVersion GetSupportedSourceVersion()
|
|
||||||
{
|
|
||||||
SourceVersion latestSupported = SourceVersion.LatestSupported();
|
|
||||||
if ((int)(latestSupported) <= 6)
|
|
||||||
{
|
|
||||||
return SourceVersion.Release6;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ((int)(latestSupported) <= 8)
|
|
||||||
{
|
|
||||||
return latestSupported;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// this annotation processor is tested through Java 8
|
|
||||||
return SourceVersion.Values()[8];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool Process<_T0>(HashSet<_T0> annotations, IRoundEnvironment roundEnv)
|
|
||||||
{
|
|
||||||
if (!CheckClassNameConstants())
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
IList<Tuple<RuleDependency, IElement>> dependencies = GetDependencies(roundEnv);
|
|
||||||
IDictionary<ITypeMirror, IList<Tuple<RuleDependency, IElement>>> recognizerDependencies = new Dictionary<ITypeMirror, IList<Tuple<RuleDependency, IElement>>>();
|
|
||||||
foreach (Tuple<RuleDependency, IElement> dependency in dependencies)
|
|
||||||
{
|
|
||||||
ITypeMirror recognizerType = GetRecognizerType(dependency.Item1);
|
|
||||||
IList<Tuple<RuleDependency, IElement>> list = recognizerDependencies.Get(recognizerType);
|
|
||||||
if (list == null)
|
|
||||||
{
|
|
||||||
list = new List<Tuple<RuleDependency, IElement>>();
|
|
||||||
recognizerDependencies.Put(recognizerType, list);
|
|
||||||
}
|
|
||||||
list.Add(dependency);
|
|
||||||
}
|
|
||||||
foreach (KeyValuePair<ITypeMirror, IList<Tuple<RuleDependency, IElement>>> entry in recognizerDependencies.EntrySet())
|
|
||||||
{
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Note, string.Format("ANTLR 4: Validating {0} dependencies on rules in {1}.", entry.Value.Count, entry.Key.ToString()));
|
|
||||||
CheckDependencies(entry.Value, entry.Key);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool CheckClassNameConstants()
|
|
||||||
{
|
|
||||||
bool success = CheckClassNameConstant(RuleDependencyClassName, typeof(RuleDependency));
|
|
||||||
success &= CheckClassNameConstant(RuleDependenciesClassName, typeof(RuleDependencies));
|
|
||||||
success &= CheckClassNameConstant(RuleVersionClassName, typeof(RuleVersion));
|
|
||||||
return success;
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool CheckClassNameConstant<_T0>(string className, System.Type<_T0> clazz)
|
|
||||||
{
|
|
||||||
Args.NotNull("className", className);
|
|
||||||
Args.NotNull("clazz", clazz);
|
|
||||||
if (!className.Equals(clazz.GetCanonicalName()))
|
|
||||||
{
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Error, string.Format("Unable to process rule dependencies due to class name mismatch: {0} != {1}", className, clazz.GetCanonicalName()));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static ITypeMirror GetRecognizerType(RuleDependency dependency)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
dependency.Recognizer();
|
|
||||||
string message = string.Format("Expected {0} to get the {1}.", typeof(MirroredTypeException).Name, typeof(ITypeMirror).Name);
|
|
||||||
throw new NotSupportedException(message);
|
|
||||||
}
|
|
||||||
catch (MirroredTypeException ex)
|
|
||||||
{
|
|
||||||
return ex.GetTypeMirror();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CheckDependencies(IList<Tuple<RuleDependency, IElement>> dependencies, ITypeMirror recognizerType)
|
|
||||||
{
|
|
||||||
string[] ruleNames = GetRuleNames(recognizerType);
|
|
||||||
int[] ruleVersions = GetRuleVersions(recognizerType, ruleNames);
|
|
||||||
RuleDependencyProcessor.RuleRelations relations = ExtractRuleRelations(recognizerType);
|
|
||||||
foreach (Tuple<RuleDependency, IElement> dependency in dependencies)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (!processingEnv.GetTypeUtils().IsAssignable(GetRecognizerType(dependency.Item1), recognizerType))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// this is the rule in the dependency set with the highest version number
|
|
||||||
int effectiveRule = dependency.Item1.Rule();
|
|
||||||
if (effectiveRule < 0 || effectiveRule >= ruleVersions.Length)
|
|
||||||
{
|
|
||||||
Tuple<IAnnotationMirror, IAnnotationValue> ruleReferenceElement = FindRuleDependencyProperty(dependency, RuleDependencyProcessor.RuleDependencyProperty.Rule);
|
|
||||||
string message = string.Format("Rule dependency on unknown rule {0}@{1} in {2}", dependency.Item1.Rule(), dependency.Item1.Version(), GetRecognizerType(dependency.Item1).ToString());
|
|
||||||
if (ruleReferenceElement != null)
|
|
||||||
{
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Error, message, dependency.Item2, ruleReferenceElement.Item1, ruleReferenceElement.Item2);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Error, message, dependency.Item2);
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
EnumSet<Dependents> dependents = EnumSet.Of(Dependents.Self, dependency.Item1.Dependents());
|
|
||||||
ReportUnimplementedDependents(dependency, dependents);
|
|
||||||
BitSet @checked = new BitSet();
|
|
||||||
int highestRequiredDependency = CheckDependencyVersion(dependency, ruleNames, ruleVersions, effectiveRule, null);
|
|
||||||
if (dependents.Contains(Dependents.Parents))
|
|
||||||
{
|
|
||||||
BitSet parents = relations.parents[dependency.Item1.Rule()];
|
|
||||||
for (int parent = parents.NextSetBit(0); parent >= 0; parent = parents.NextSetBit(parent + 1))
|
|
||||||
{
|
|
||||||
if (parent < 0 || parent >= ruleVersions.Length || @checked.Get(parent))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
@checked.Set(parent);
|
|
||||||
int required = CheckDependencyVersion(dependency, ruleNames, ruleVersions, parent, "parent");
|
|
||||||
highestRequiredDependency = Math.Max(highestRequiredDependency, required);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (dependents.Contains(Dependents.Children))
|
|
||||||
{
|
|
||||||
BitSet children = relations.children[dependency.Item1.Rule()];
|
|
||||||
for (int child = children.NextSetBit(0); child >= 0; child = children.NextSetBit(child + 1))
|
|
||||||
{
|
|
||||||
if (child < 0 || child >= ruleVersions.Length || @checked.Get(child))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
@checked.Set(child);
|
|
||||||
int required = CheckDependencyVersion(dependency, ruleNames, ruleVersions, child, "child");
|
|
||||||
highestRequiredDependency = Math.Max(highestRequiredDependency, required);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (dependents.Contains(Dependents.Ancestors))
|
|
||||||
{
|
|
||||||
BitSet ancestors = relations.GetAncestors(dependency.Item1.Rule());
|
|
||||||
for (int ancestor = ancestors.NextSetBit(0); ancestor >= 0; ancestor = ancestors.NextSetBit(ancestor + 1))
|
|
||||||
{
|
|
||||||
if (ancestor < 0 || ancestor >= ruleVersions.Length || @checked.Get(ancestor))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
@checked.Set(ancestor);
|
|
||||||
int required = CheckDependencyVersion(dependency, ruleNames, ruleVersions, ancestor, "ancestor");
|
|
||||||
highestRequiredDependency = Math.Max(highestRequiredDependency, required);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (dependents.Contains(Dependents.Descendants))
|
|
||||||
{
|
|
||||||
BitSet descendants = relations.GetDescendants(dependency.Item1.Rule());
|
|
||||||
for (int descendant = descendants.NextSetBit(0); descendant >= 0; descendant = descendants.NextSetBit(descendant + 1))
|
|
||||||
{
|
|
||||||
if (descendant < 0 || descendant >= ruleVersions.Length || @checked.Get(descendant))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
@checked.Set(descendant);
|
|
||||||
int required = CheckDependencyVersion(dependency, ruleNames, ruleVersions, descendant, "descendant");
|
|
||||||
highestRequiredDependency = Math.Max(highestRequiredDependency, required);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int declaredVersion = dependency.Item1.Version();
|
|
||||||
if (declaredVersion > highestRequiredDependency)
|
|
||||||
{
|
|
||||||
Tuple<IAnnotationMirror, IAnnotationValue> versionElement = FindRuleDependencyProperty(dependency, RuleDependencyProcessor.RuleDependencyProperty.Version);
|
|
||||||
string message = string.Format("Rule dependency version mismatch: {0} has maximum dependency version {1} (expected {2}) in {3}", ruleNames[dependency.Item1.Rule()], highestRequiredDependency, declaredVersion, GetRecognizerType(dependency.Item1).ToString());
|
|
||||||
if (versionElement != null)
|
|
||||||
{
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Error, message, dependency.Item2, versionElement.Item1, versionElement.Item2);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Error, message, dependency.Item2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (AnnotationTypeMismatchException)
|
|
||||||
{
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Warning, string.Format("Could not validate rule dependencies for element {0}", dependency.Item2.ToString()), dependency.Item2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static readonly HashSet<Dependents> ImplementedDependents = EnumSet.Of(Dependents.Self, Dependents.Parents, Dependents.Children, Dependents.Ancestors, Dependents.Descendants);
|
|
||||||
|
|
||||||
private void ReportUnimplementedDependents(Tuple<RuleDependency, IElement> dependency, EnumSet<Dependents> dependents)
|
|
||||||
{
|
|
||||||
EnumSet<Dependents> unimplemented = dependents.Clone();
|
|
||||||
unimplemented.RemoveAll(ImplementedDependents);
|
|
||||||
if (!unimplemented.IsEmpty())
|
|
||||||
{
|
|
||||||
Tuple<IAnnotationMirror, IAnnotationValue> dependentsElement = FindRuleDependencyProperty(dependency, RuleDependencyProcessor.RuleDependencyProperty.Dependents);
|
|
||||||
if (dependentsElement == null)
|
|
||||||
{
|
|
||||||
dependentsElement = FindRuleDependencyProperty(dependency, RuleDependencyProcessor.RuleDependencyProperty.Rule);
|
|
||||||
}
|
|
||||||
string message = string.Format("Cannot validate the following dependents of rule {0}: {1}", dependency.Item1.Rule(), unimplemented);
|
|
||||||
if (dependentsElement != null)
|
|
||||||
{
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Warning, message, dependency.Item2, dependentsElement.Item1, dependentsElement.Item2);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Warning, message, dependency.Item2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private int CheckDependencyVersion(Tuple<RuleDependency, IElement> dependency, string[] ruleNames, int[] ruleVersions, int relatedRule, string relation)
|
|
||||||
{
|
|
||||||
string ruleName = ruleNames[dependency.Item1.Rule()];
|
|
||||||
string path;
|
|
||||||
if (relation == null)
|
|
||||||
{
|
|
||||||
path = ruleName;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
string mismatchedRuleName = ruleNames[relatedRule];
|
|
||||||
path = string.Format("rule {0} ({1} of {2})", mismatchedRuleName, relation, ruleName);
|
|
||||||
}
|
|
||||||
int declaredVersion = dependency.Item1.Version();
|
|
||||||
int actualVersion = ruleVersions[relatedRule];
|
|
||||||
if (actualVersion > declaredVersion)
|
|
||||||
{
|
|
||||||
Tuple<IAnnotationMirror, IAnnotationValue> versionElement = FindRuleDependencyProperty(dependency, RuleDependencyProcessor.RuleDependencyProperty.Version);
|
|
||||||
string message = string.Format("Rule dependency version mismatch: {0} has version {1} (expected <= {2}) in {3}", path, actualVersion, declaredVersion, GetRecognizerType(dependency.Item1).ToString());
|
|
||||||
if (versionElement != null)
|
|
||||||
{
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Error, message, dependency.Item2, versionElement.Item1, versionElement.Item2);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Error, message, dependency.Item2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return actualVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
private int[] GetRuleVersions(ITypeMirror recognizerClass, string[] ruleNames)
|
|
||||||
{
|
|
||||||
int[] versions = new int[ruleNames.Length];
|
|
||||||
IList<IElement> elements = processingEnv.GetElementUtils().GetAllMembers((ITypeElement)processingEnv.GetTypeUtils().AsElement(recognizerClass));
|
|
||||||
foreach (IElement element in elements)
|
|
||||||
{
|
|
||||||
if (element.GetKind() != ElementKind.Field)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
IVariableElement field = (IVariableElement)element;
|
|
||||||
bool isStatic = element.GetModifiers().Contains(Modifier.Static);
|
|
||||||
object constantValue = field.GetConstantValue();
|
|
||||||
bool isInteger = constantValue is int;
|
|
||||||
string name = field.GetSimpleName().ToString();
|
|
||||||
if (isStatic && isInteger && name.StartsWith("RULE_"))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
name = Sharpen.Runtime.Substring(name, "RULE_".Length);
|
|
||||||
if (name.IsEmpty() || !System.Char.IsLower(name[0]))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
int index = (int)constantValue;
|
|
||||||
if (index < 0 || index >= versions.Length)
|
|
||||||
{
|
|
||||||
string message = string.Format("Rule index {0} for rule '{1}' out of bounds for recognizer {2}.", index, name, recognizerClass.ToString());
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Error, message, element);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (name.IndexOf(ATNSimulator.RuleVariantDelimiter) >= 0)
|
|
||||||
{
|
|
||||||
// ignore left-factored pseudo-rules
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
IExecutableElement ruleMethod = GetRuleMethod(recognizerClass, name);
|
|
||||||
if (ruleMethod == null)
|
|
||||||
{
|
|
||||||
string message = string.Format("Could not find rule method for rule '{0}' in recognizer {1}.", name, recognizerClass.ToString());
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Error, message, element);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
RuleVersion ruleVersion = ruleMethod.GetAnnotation<RuleVersion>();
|
|
||||||
int version = ruleVersion != null ? ruleVersion.Value() : 0;
|
|
||||||
versions[index] = version;
|
|
||||||
}
|
|
||||||
catch (ArgumentException)
|
|
||||||
{
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Error, "Exception occurred while validating rule dependencies.", element);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return versions;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IExecutableElement GetRuleMethod(ITypeMirror recognizerClass, string name)
|
|
||||||
{
|
|
||||||
IList<IElement> elements = processingEnv.GetElementUtils().GetAllMembers((ITypeElement)processingEnv.GetTypeUtils().AsElement(recognizerClass));
|
|
||||||
foreach (IElement element in elements)
|
|
||||||
{
|
|
||||||
if (element.GetKind() != ElementKind.Method)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
IExecutableElement method = (IExecutableElement)element;
|
|
||||||
if (method.GetSimpleName().ContentEquals(name) && HasRuleVersionAnnotation(method))
|
|
||||||
{
|
|
||||||
return method;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool HasRuleVersionAnnotation(IExecutableElement method)
|
|
||||||
{
|
|
||||||
ITypeElement ruleVersionAnnotationElement = processingEnv.GetElementUtils().GetTypeElement(RuleVersionClassName);
|
|
||||||
if (ruleVersionAnnotationElement == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
foreach (IAnnotationMirror annotation in method.GetAnnotationMirrors())
|
|
||||||
{
|
|
||||||
if (processingEnv.GetTypeUtils().IsSameType(annotation.GetAnnotationType(), ruleVersionAnnotationElement.AsType()))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private string[] GetRuleNames(ITypeMirror recognizerClass)
|
|
||||||
{
|
|
||||||
IList<string> result = new List<string>();
|
|
||||||
IList<IElement> elements = processingEnv.GetElementUtils().GetAllMembers((ITypeElement)processingEnv.GetTypeUtils().AsElement(recognizerClass));
|
|
||||||
foreach (IElement element in elements)
|
|
||||||
{
|
|
||||||
if (element.GetKind() != ElementKind.Field)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
IVariableElement field = (IVariableElement)element;
|
|
||||||
bool isStatic = element.GetModifiers().Contains(Modifier.Static);
|
|
||||||
object constantValue = field.GetConstantValue();
|
|
||||||
bool isInteger = constantValue is int;
|
|
||||||
string name = field.GetSimpleName().ToString();
|
|
||||||
if (isStatic && isInteger && name.StartsWith("RULE_"))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
name = Sharpen.Runtime.Substring(name, "RULE_".Length);
|
|
||||||
if (name.IsEmpty() || !System.Char.IsLower(name[0]))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
int index = (int)constantValue;
|
|
||||||
if (index < 0)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
while (result.Count <= index)
|
|
||||||
{
|
|
||||||
result.Add(string.Empty);
|
|
||||||
}
|
|
||||||
result.Set(index, name);
|
|
||||||
}
|
|
||||||
catch (ArgumentException)
|
|
||||||
{
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Error, "Exception occurred while validating rule dependencies.", element);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Sharpen.Collections.ToArray(result, new string[result.Count]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IList<Tuple<RuleDependency, IElement>> GetDependencies(IRoundEnvironment roundEnv)
|
|
||||||
{
|
|
||||||
IList<Tuple<RuleDependency, IElement>> result = new List<Tuple<RuleDependency, IElement>>();
|
|
||||||
HashSet<IElement> elements = roundEnv.GetElementsAnnotatedWith(typeof(RuleDependency));
|
|
||||||
foreach (IElement element in elements)
|
|
||||||
{
|
|
||||||
RuleDependency dependency = element.GetAnnotation<RuleDependency>();
|
|
||||||
if (dependency == null)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
result.Add(Tuple.Create(dependency, element));
|
|
||||||
}
|
|
||||||
elements = roundEnv.GetElementsAnnotatedWith(typeof(RuleDependencies));
|
|
||||||
foreach (IElement element_1 in elements)
|
|
||||||
{
|
|
||||||
RuleDependencies dependencies = element_1.GetAnnotation<RuleDependencies>();
|
|
||||||
if (dependencies == null || dependencies.Value() == null)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
foreach (RuleDependency dependency in dependencies.Value())
|
|
||||||
{
|
|
||||||
result.Add(Tuple.Create(dependency, element_1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum RuleDependencyProperty
|
|
||||||
{
|
|
||||||
Recognizer,
|
|
||||||
Rule,
|
|
||||||
Version,
|
|
||||||
Dependents
|
|
||||||
}
|
|
||||||
|
|
||||||
[Nullable]
|
|
||||||
private Tuple<IAnnotationMirror, IAnnotationValue> FindRuleDependencyProperty(Tuple<RuleDependency, IElement> dependency, RuleDependencyProcessor.RuleDependencyProperty property)
|
|
||||||
{
|
|
||||||
ITypeElement ruleDependencyTypeElement = processingEnv.GetElementUtils().GetTypeElement(RuleDependencyClassName);
|
|
||||||
ITypeElement ruleDependenciesTypeElement = processingEnv.GetElementUtils().GetTypeElement(RuleDependenciesClassName);
|
|
||||||
IList<IAnnotationMirror> mirrors = dependency.Item2.GetAnnotationMirrors();
|
|
||||||
foreach (IAnnotationMirror annotationMirror in mirrors)
|
|
||||||
{
|
|
||||||
if (processingEnv.GetTypeUtils().IsSameType(ruleDependencyTypeElement.AsType(), annotationMirror.GetAnnotationType()))
|
|
||||||
{
|
|
||||||
IAnnotationValue element = FindRuleDependencyProperty(dependency, annotationMirror, property);
|
|
||||||
if (element != null)
|
|
||||||
{
|
|
||||||
return Tuple.Create(annotationMirror, element);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (processingEnv.GetTypeUtils().IsSameType(ruleDependenciesTypeElement.AsType(), annotationMirror.GetAnnotationType()))
|
|
||||||
{
|
|
||||||
IDictionary<IExecutableElement, IAnnotationValue> values = annotationMirror.GetElementValues();
|
|
||||||
foreach (KeyValuePair<IExecutableElement, IAnnotationValue> value in values.EntrySet())
|
|
||||||
{
|
|
||||||
if ("value()".Equals(value.Key.ToString()))
|
|
||||||
{
|
|
||||||
IAnnotationValue annotationValue = value.Value;
|
|
||||||
if (!(annotationValue.GetValue() is IList))
|
|
||||||
{
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Warning, "Expected array of RuleDependency annotations for annotation property 'value()'.", dependency.Item2, annotationMirror, annotationValue);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
IList<object> annotationValueList = (IList<object>)annotationValue.GetValue();
|
|
||||||
foreach (object obj in annotationValueList)
|
|
||||||
{
|
|
||||||
if (!(obj is IAnnotationMirror))
|
|
||||||
{
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Warning, "Expected RuleDependency annotation mirror for element of property 'value()'.", dependency.Item2, annotationMirror, annotationValue);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
IAnnotationValue element = FindRuleDependencyProperty(dependency, (IAnnotationMirror)obj, property);
|
|
||||||
if (element != null)
|
|
||||||
{
|
|
||||||
return Tuple.Create((IAnnotationMirror)obj, element);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Error, string.Format("Unexpected annotation property {0}.", value.Key.ToString()), dependency.Item2, annotationMirror, value.Value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
[Nullable]
|
|
||||||
private IAnnotationValue FindRuleDependencyProperty(Tuple<RuleDependency, IElement> dependency, IAnnotationMirror annotationMirror, RuleDependencyProcessor.RuleDependencyProperty property)
|
|
||||||
{
|
|
||||||
IAnnotationValue recognizerValue = null;
|
|
||||||
IAnnotationValue ruleValue = null;
|
|
||||||
IAnnotationValue versionValue = null;
|
|
||||||
IAnnotationValue dependentsValue = null;
|
|
||||||
IDictionary<IExecutableElement, IAnnotationValue> values = annotationMirror.GetElementValues();
|
|
||||||
foreach (KeyValuePair<IExecutableElement, IAnnotationValue> value in values.EntrySet())
|
|
||||||
{
|
|
||||||
IAnnotationValue annotationValue = value.Value;
|
|
||||||
if ("rule()".Equals(value.Key.ToString()))
|
|
||||||
{
|
|
||||||
ruleValue = annotationValue;
|
|
||||||
if (!(annotationValue.GetValue() is int))
|
|
||||||
{
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Warning, "Expected int constant for annotation property 'rule()'.", dependency.Item2, annotationMirror, annotationValue);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if ((int)annotationValue.GetValue() != dependency.Item1.Rule())
|
|
||||||
{
|
|
||||||
// this is a valid dependency annotation, but not the one we're looking for
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ("recognizer()".Equals(value.Key.ToString()))
|
|
||||||
{
|
|
||||||
recognizerValue = annotationValue;
|
|
||||||
if (!(annotationValue.GetValue() is ITypeMirror))
|
|
||||||
{
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Warning, "Expected Class constant for annotation property 'recognizer()'.", dependency.Item2, annotationMirror, annotationValue);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
ITypeMirror annotationRecognizer = (ITypeMirror)annotationValue.GetValue();
|
|
||||||
ITypeMirror expectedRecognizer = GetRecognizerType(dependency.Item1);
|
|
||||||
if (!processingEnv.GetTypeUtils().IsSameType(expectedRecognizer, annotationRecognizer))
|
|
||||||
{
|
|
||||||
// this is a valid dependency annotation, but not the one we're looking for
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ("version()".Equals(value.Key.ToString()))
|
|
||||||
{
|
|
||||||
versionValue = annotationValue;
|
|
||||||
if (!(annotationValue.GetValue() is int))
|
|
||||||
{
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Warning, "Expected int constant for annotation property 'version()'.", dependency.Item2, annotationMirror, annotationValue);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if ((int)annotationValue.GetValue() != dependency.Item1.Version())
|
|
||||||
{
|
|
||||||
// this is a valid dependency annotation, but not the one we're looking for
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (recognizerValue != null)
|
|
||||||
{
|
|
||||||
if (property == RuleDependencyProcessor.RuleDependencyProperty.Recognizer)
|
|
||||||
{
|
|
||||||
return recognizerValue;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (ruleValue != null)
|
|
||||||
{
|
|
||||||
if (property == RuleDependencyProcessor.RuleDependencyProperty.Rule)
|
|
||||||
{
|
|
||||||
return ruleValue;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (versionValue != null)
|
|
||||||
{
|
|
||||||
if (property == RuleDependencyProcessor.RuleDependencyProperty.Version)
|
|
||||||
{
|
|
||||||
return versionValue;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (property == RuleDependencyProcessor.RuleDependencyProperty.Dependents)
|
|
||||||
{
|
|
||||||
return dependentsValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (recognizerValue == null)
|
|
||||||
{
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Warning, "Could not find 'recognizer()' element in annotation.", dependency.Item2, annotationMirror);
|
|
||||||
}
|
|
||||||
if (property == RuleDependencyProcessor.RuleDependencyProperty.Recognizer)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (ruleValue == null)
|
|
||||||
{
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Warning, "Could not find 'rule()' element in annotation.", dependency.Item2, annotationMirror);
|
|
||||||
}
|
|
||||||
if (property == RuleDependencyProcessor.RuleDependencyProperty.Rule)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (versionValue == null)
|
|
||||||
{
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Warning, "Could not find 'version()' element in annotation.", dependency.Item2, annotationMirror);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private RuleDependencyProcessor.RuleRelations ExtractRuleRelations(ITypeMirror recognizer)
|
|
||||||
{
|
|
||||||
string serializedATN = GetSerializedATN(recognizer);
|
|
||||||
if (serializedATN == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
ATN atn = new ATNDeserializer().Deserialize(serializedATN.ToCharArray());
|
|
||||||
RuleDependencyProcessor.RuleRelations relations = new RuleDependencyProcessor.RuleRelations(atn.ruleToStartState.Length);
|
|
||||||
foreach (ATNState state in atn.states)
|
|
||||||
{
|
|
||||||
if (!state.epsilonOnlyTransitions)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
foreach (Transition transition in state.Transitions)
|
|
||||||
{
|
|
||||||
if (transition.TransitionType != TransitionType.Rule)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
RuleTransition ruleTransition = (RuleTransition)transition;
|
|
||||||
relations.AddRuleInvocation(state.ruleIndex, ruleTransition.target.ruleIndex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return relations;
|
|
||||||
}
|
|
||||||
|
|
||||||
private string GetSerializedATN(ITypeMirror recognizerClass)
|
|
||||||
{
|
|
||||||
IList<IElement> elements = processingEnv.GetElementUtils().GetAllMembers((ITypeElement)processingEnv.GetTypeUtils().AsElement(recognizerClass));
|
|
||||||
foreach (IElement element in elements)
|
|
||||||
{
|
|
||||||
if (element.GetKind() != ElementKind.Field)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
IVariableElement field = (IVariableElement)element;
|
|
||||||
bool isStatic = element.GetModifiers().Contains(Modifier.Static);
|
|
||||||
object constantValue = field.GetConstantValue();
|
|
||||||
bool isString = constantValue is string;
|
|
||||||
string name = field.GetSimpleName().ToString();
|
|
||||||
if (isStatic && isString && name.Equals("_serializedATN"))
|
|
||||||
{
|
|
||||||
return (string)constantValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
processingEnv.GetMessager().PrintMessage(Diagnostic.Kind.Error, "Could not retrieve serialized ATN from grammar.");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private sealed class RuleRelations
|
|
||||||
{
|
|
||||||
private readonly BitSet[] parents;
|
|
||||||
|
|
||||||
private readonly BitSet[] children;
|
|
||||||
|
|
||||||
public RuleRelations(int ruleCount)
|
|
||||||
{
|
|
||||||
parents = new BitSet[ruleCount];
|
|
||||||
for (int i = 0; i < ruleCount; i++)
|
|
||||||
{
|
|
||||||
parents[i] = new BitSet();
|
|
||||||
}
|
|
||||||
children = new BitSet[ruleCount];
|
|
||||||
for (int i_1 = 0; i_1 < ruleCount; i_1++)
|
|
||||||
{
|
|
||||||
children[i_1] = new BitSet();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool AddRuleInvocation(int caller, int callee)
|
|
||||||
{
|
|
||||||
if (caller < 0)
|
|
||||||
{
|
|
||||||
// tokens rule
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (children[caller].Get(callee))
|
|
||||||
{
|
|
||||||
// already added
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
children[caller].Set(callee);
|
|
||||||
parents[callee].Set(caller);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BitSet GetAncestors(int rule)
|
|
||||||
{
|
|
||||||
BitSet ancestors = new BitSet();
|
|
||||||
ancestors.Or(parents[rule]);
|
|
||||||
while (true)
|
|
||||||
{
|
|
||||||
int cardinality = ancestors.Cardinality();
|
|
||||||
for (int i = ancestors.NextSetBit(0); i >= 0; i = ancestors.NextSetBit(i + 1))
|
|
||||||
{
|
|
||||||
ancestors.Or(parents[i]);
|
|
||||||
}
|
|
||||||
if (ancestors.Cardinality() == cardinality)
|
|
||||||
{
|
|
||||||
// nothing changed
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ancestors;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BitSet GetDescendants(int rule)
|
|
||||||
{
|
|
||||||
BitSet descendants = new BitSet();
|
|
||||||
descendants.Or(children[rule]);
|
|
||||||
while (true)
|
|
||||||
{
|
|
||||||
int cardinality = descendants.Cardinality();
|
|
||||||
for (int i = descendants.NextSetBit(0); i >= 0; i = descendants.NextSetBit(i + 1))
|
|
||||||
{
|
|
||||||
descendants.Or(children[i]);
|
|
||||||
}
|
|
||||||
if (descendants.Cardinality() == cardinality)
|
|
||||||
{
|
|
||||||
// nothing changed
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return descendants;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,335 +0,0 @@
|
||||||
/*
|
|
||||||
* [The "BSD license"]
|
|
||||||
* Copyright (c) 2013 Terence Parr
|
|
||||||
* Copyright (c) 2013 Sam Harwell
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
||||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
||||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Reflection;
|
|
||||||
using Antlr4.Runtime;
|
|
||||||
using Antlr4.Runtime.Atn;
|
|
||||||
using Antlr4.Runtime.Sharpen;
|
|
||||||
using Antlr4.Runtime.Sharpen.Reflect;
|
|
||||||
|
|
||||||
namespace Antlr4.Runtime.Misc
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Run a lexer/parser combo, optionally printing tree string or generating
|
|
||||||
/// postscript file.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Run a lexer/parser combo, optionally printing tree string or generating
|
|
||||||
/// postscript file. Optionally taking input file.
|
|
||||||
/// $ java org.antlr.v4.runtime.misc.TestRig GrammarName startRuleName
|
|
||||||
/// [-tree]
|
|
||||||
/// [-tokens] [-gui] [-ps file.ps]
|
|
||||||
/// [-trace]
|
|
||||||
/// [-diagnostics]
|
|
||||||
/// [-SLL]
|
|
||||||
/// [input-filename(s)]
|
|
||||||
/// </remarks>
|
|
||||||
public class TestRig
|
|
||||||
{
|
|
||||||
public const string LexerStartRuleName = "tokens";
|
|
||||||
|
|
||||||
protected internal string grammarName;
|
|
||||||
|
|
||||||
protected internal string startRuleName;
|
|
||||||
|
|
||||||
protected internal readonly IList<string> inputFiles = new List<string>();
|
|
||||||
|
|
||||||
protected internal bool printTree = false;
|
|
||||||
|
|
||||||
protected internal bool gui = false;
|
|
||||||
|
|
||||||
protected internal string psFile = null;
|
|
||||||
|
|
||||||
protected internal bool showTokens = false;
|
|
||||||
|
|
||||||
protected internal bool trace = false;
|
|
||||||
|
|
||||||
protected internal bool diagnostics = false;
|
|
||||||
|
|
||||||
protected internal string encoding = null;
|
|
||||||
|
|
||||||
protected internal bool Sll = false;
|
|
||||||
|
|
||||||
/// <exception cref="System.Exception"/>
|
|
||||||
public TestRig(string[] args)
|
|
||||||
{
|
|
||||||
if (args.Length < 2)
|
|
||||||
{
|
|
||||||
System.Console.Error.WriteLine("java org.antlr.v4.runtime.misc.TestRig GrammarName startRuleName\n" + " [-tokens] [-tree] [-gui] [-ps file.ps] [-encoding encodingname]\n" + " [-trace] [-diagnostics] [-SLL]\n" + " [input-filename(s)]");
|
|
||||||
System.Console.Error.WriteLine("Use startRuleName='tokens' if GrammarName is a lexer grammar.");
|
|
||||||
System.Console.Error.WriteLine("Omitting input-filename makes rig read from stdin.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int i = 0;
|
|
||||||
grammarName = args[i];
|
|
||||||
i++;
|
|
||||||
startRuleName = args[i];
|
|
||||||
i++;
|
|
||||||
while (i < args.Length)
|
|
||||||
{
|
|
||||||
string arg = args[i];
|
|
||||||
i++;
|
|
||||||
if (arg[0] != '-')
|
|
||||||
{
|
|
||||||
// input file name
|
|
||||||
inputFiles.Add(arg);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (arg.Equals("-tree"))
|
|
||||||
{
|
|
||||||
printTree = true;
|
|
||||||
}
|
|
||||||
if (arg.Equals("-gui"))
|
|
||||||
{
|
|
||||||
gui = true;
|
|
||||||
}
|
|
||||||
if (arg.Equals("-tokens"))
|
|
||||||
{
|
|
||||||
showTokens = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (arg.Equals("-trace"))
|
|
||||||
{
|
|
||||||
trace = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (arg.Equals("-SLL"))
|
|
||||||
{
|
|
||||||
Sll = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (arg.Equals("-diagnostics"))
|
|
||||||
{
|
|
||||||
diagnostics = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (arg.Equals("-encoding"))
|
|
||||||
{
|
|
||||||
if (i >= args.Length)
|
|
||||||
{
|
|
||||||
System.Console.Error.WriteLine("missing encoding on -encoding");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
encoding = args[i];
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (arg.Equals("-ps"))
|
|
||||||
{
|
|
||||||
if (i >= args.Length)
|
|
||||||
{
|
|
||||||
System.Console.Error.WriteLine("missing filename on -ps");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
psFile = args[i];
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <exception cref="System.Exception"/>
|
|
||||||
public static void Main(string[] args)
|
|
||||||
{
|
|
||||||
Antlr4.Runtime.Misc.TestRig testRig = new Antlr4.Runtime.Misc.TestRig(args);
|
|
||||||
if (args.Length >= 2)
|
|
||||||
{
|
|
||||||
testRig.Process();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <exception cref="System.Exception"/>
|
|
||||||
public virtual void Process()
|
|
||||||
{
|
|
||||||
// System.out.println("exec "+grammarName+"."+startRuleName);
|
|
||||||
string lexerName = grammarName + "Lexer";
|
|
||||||
ClassLoader cl = Antlr4.Runtime.Sharpen.Thread.CurrentThread().GetContextClassLoader();
|
|
||||||
Type lexerClass = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
lexerClass = cl.LoadClass(lexerName).AsSubclass<Lexer>();
|
|
||||||
}
|
|
||||||
catch (TypeLoadException)
|
|
||||||
{
|
|
||||||
// might be pure lexer grammar; no Lexer suffix then
|
|
||||||
lexerName = grammarName;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
lexerClass = cl.LoadClass(lexerName).AsSubclass<Lexer>();
|
|
||||||
}
|
|
||||||
catch (TypeLoadException)
|
|
||||||
{
|
|
||||||
System.Console.Error.WriteLine("Can't load " + lexerName + " as lexer or parser");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Constructor<Lexer> lexerCtor = lexerClass.GetConstructor(typeof(ICharStream));
|
|
||||||
Lexer lexer = lexerCtor.NewInstance((ICharStream)null);
|
|
||||||
Type parserClass = null;
|
|
||||||
Parser parser = null;
|
|
||||||
if (!startRuleName.Equals(LexerStartRuleName))
|
|
||||||
{
|
|
||||||
string parserName = grammarName + "Parser";
|
|
||||||
parserClass = cl.LoadClass(parserName).AsSubclass<Parser>();
|
|
||||||
if (parserClass == null)
|
|
||||||
{
|
|
||||||
System.Console.Error.WriteLine("Can't load " + parserName);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Constructor<Parser> parserCtor = parserClass.GetConstructor(typeof(ITokenStream));
|
|
||||||
parser = parserCtor.NewInstance((ITokenStream)null);
|
|
||||||
}
|
|
||||||
if (inputFiles.IsEmpty())
|
|
||||||
{
|
|
||||||
Stream @is = Sharpen.Runtime.@in;
|
|
||||||
TextReader r;
|
|
||||||
if (encoding != null)
|
|
||||||
{
|
|
||||||
r = new StreamReader(@is, encoding);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
r = new StreamReader(@is);
|
|
||||||
}
|
|
||||||
Process(lexer, parserClass, parser, @is, r);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
foreach (string inputFile in inputFiles)
|
|
||||||
{
|
|
||||||
Stream @is = Sharpen.Runtime.@in;
|
|
||||||
if (inputFile != null)
|
|
||||||
{
|
|
||||||
@is = new FileInputStream(inputFile);
|
|
||||||
}
|
|
||||||
TextReader r;
|
|
||||||
if (encoding != null)
|
|
||||||
{
|
|
||||||
r = new StreamReader(@is, encoding);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
r = new StreamReader(@is);
|
|
||||||
}
|
|
||||||
if (inputFiles.Count > 1)
|
|
||||||
{
|
|
||||||
System.Console.Error.WriteLine(inputFile);
|
|
||||||
}
|
|
||||||
Process(lexer, parserClass, parser, @is, r);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <exception cref="System.IO.IOException"/>
|
|
||||||
/// <exception cref="System.MemberAccessException"/>
|
|
||||||
/// <exception cref="System.Reflection.TargetInvocationException"/>
|
|
||||||
/// <exception cref="Javax.Print.PrintException"/>
|
|
||||||
protected internal virtual void Process<_T0>(Lexer lexer, Type<_T0> parserClass, Parser parser, Stream @is, TextReader r)
|
|
||||||
where _T0 : Parser
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
AntlrInputStream input = new AntlrInputStream(r);
|
|
||||||
lexer.SetInputStream(input);
|
|
||||||
CommonTokenStream tokens = new CommonTokenStream(lexer);
|
|
||||||
tokens.Fill();
|
|
||||||
if (showTokens)
|
|
||||||
{
|
|
||||||
foreach (object tok in tokens.GetTokens())
|
|
||||||
{
|
|
||||||
System.Console.Out.WriteLine(tok);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (startRuleName.Equals(LexerStartRuleName))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (diagnostics)
|
|
||||||
{
|
|
||||||
parser.AddErrorListener(new DiagnosticErrorListener());
|
|
||||||
parser.Interpreter.PredictionMode = PredictionMode.LlExactAmbigDetection;
|
|
||||||
}
|
|
||||||
if (printTree || gui || psFile != null)
|
|
||||||
{
|
|
||||||
parser.BuildParseTree = true;
|
|
||||||
}
|
|
||||||
if (Sll)
|
|
||||||
{
|
|
||||||
// overrides diagnostics
|
|
||||||
parser.Interpreter.PredictionMode = PredictionMode.Sll;
|
|
||||||
}
|
|
||||||
parser.SetInputStream(tokens);
|
|
||||||
parser.Trace = trace;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
MethodInfo startRule = parserClass.GetMethod(startRuleName, (Type[])null);
|
|
||||||
ParserRuleContext tree = (ParserRuleContext)startRule.Invoke(parser, (object[])null);
|
|
||||||
if (printTree)
|
|
||||||
{
|
|
||||||
System.Console.Out.WriteLine(tree.ToStringTree(parser));
|
|
||||||
}
|
|
||||||
if (gui)
|
|
||||||
{
|
|
||||||
tree.Inspect(parser);
|
|
||||||
}
|
|
||||||
if (psFile != null)
|
|
||||||
{
|
|
||||||
tree.Save(parser, psFile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (NoSuchMethodException)
|
|
||||||
{
|
|
||||||
// Generate postscript
|
|
||||||
System.Console.Error.WriteLine("No method for rule " + startRuleName + " or it has arguments");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
if (r != null)
|
|
||||||
{
|
|
||||||
r.Close();
|
|
||||||
}
|
|
||||||
if (@is != null)
|
|
||||||
{
|
|
||||||
@is.Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -126,8 +126,7 @@ namespace Antlr4.Runtime
|
||||||
/// <summary>The input stream.</summary>
|
/// <summary>The input stream.</summary>
|
||||||
/// <remarks>The input stream.</remarks>
|
/// <remarks>The input stream.</remarks>
|
||||||
/// <seealso cref="InputStream()"/>
|
/// <seealso cref="InputStream()"/>
|
||||||
/// <seealso cref="SetInputStream(ITokenStream)"/>
|
private ITokenStream _input;
|
||||||
private ITokenStream _input;
|
|
||||||
|
|
||||||
private readonly List<int> _precedenceStack = new List<int> { 0 };
|
private readonly List<int> _precedenceStack = new List<int> { 0 };
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
*/
|
*/
|
||||||
namespace Antlr4.Runtime.Sharpen
|
namespace Antlr4.Runtime.Sharpen
|
||||||
{
|
{
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
|
|
||||||
|
@ -87,4 +88,5 @@ namespace Antlr4.Runtime.Sharpen
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,6 @@ using Antlr4.Runtime.Atn;
|
||||||
using Antlr4.Runtime.Misc;
|
using Antlr4.Runtime.Misc;
|
||||||
using DFA = Antlr4.Runtime.Dfa.DFA;
|
using DFA = Antlr4.Runtime.Dfa.DFA;
|
||||||
|
|
||||||
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.4.1-dev")]
|
|
||||||
[System.CLSCompliant(false)]
|
[System.CLSCompliant(false)]
|
||||||
public partial class XPathLexer : Lexer {
|
public partial class XPathLexer : Lexer {
|
||||||
public const int
|
public const int
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="Antlr4" version="4.3.0" targetFramework="net20" />
|
|
||||||
<package id="Antlr4.Runtime" version="4.3.0" targetFramework="net20" />
|
|
||||||
</packages>
|
|
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="Antlr4" version="4.3.0" targetFramework="net30" />
|
|
||||||
<package id="Antlr4.Runtime" version="4.3.0" targetFramework="net30" />
|
|
||||||
</packages>
|
|
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="Antlr4.VS2008" version="4.2.1-alpha001" targetFramework="net35-cf" />
|
|
||||||
<package id="Antlr4.Runtime" version="4.2.1-alpha001" targetFramework="net35-cf" />
|
|
||||||
</packages>
|
|
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="Antlr4" version="4.3.0" targetFramework="net35-client" />
|
|
||||||
<package id="Antlr4.Runtime" version="4.3.0" targetFramework="net35-client" />
|
|
||||||
</packages>
|
|
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="Antlr4" version="4.3.0" targetFramework="net40-client" />
|
|
||||||
<package id="Antlr4.Runtime" version="4.3.0" targetFramework="net40-client" />
|
|
||||||
</packages>
|
|
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="Antlr4" version="4.3.0" targetFramework="net45" />
|
|
||||||
<package id="Antlr4.Runtime" version="4.3.0" targetFramework="net45" />
|
|
||||||
</packages>
|
|
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="Antlr4" version="4.3.0" targetFramework="netcore45" />
|
|
||||||
<package id="Antlr4.Runtime" version="4.3.0" targetFramework="netcore45" />
|
|
||||||
</packages>
|
|
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="Antlr4" version="4.3.0" targetFramework="portable-net40+sl50+win+wp80" />
|
|
||||||
<package id="Antlr4.Runtime" version="4.3.0" targetFramework="portable-net40+sl50+win+wp80" />
|
|
||||||
</packages>
|
|
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="Antlr4" version="4.3.0" targetFramework="portable-net45+wp80+win" />
|
|
||||||
<package id="Antlr4.Runtime" version="4.3.0" targetFramework="portable-net45+wp80+win" />
|
|
||||||
</packages>
|
|
|
@ -1,28 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
|
|
||||||
// Information about this assembly is defined by the following attributes.
|
|
||||||
// Change them to the values specific to your project.
|
|
||||||
|
|
||||||
[assembly: AssemblyTitle ("Antlr4.Test.mono")]
|
|
||||||
[assembly: AssemblyDescription ("")]
|
|
||||||
[assembly: AssemblyConfiguration ("")]
|
|
||||||
[assembly: AssemblyCompany ("")]
|
|
||||||
[assembly: AssemblyProduct ("")]
|
|
||||||
[assembly: AssemblyCopyright ("ericvergnaud")]
|
|
||||||
[assembly: AssemblyTrademark ("")]
|
|
||||||
[assembly: AssemblyCulture ("")]
|
|
||||||
[assembly: CLSCompliant (true)]
|
|
||||||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
|
|
||||||
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
|
||||||
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
|
||||||
|
|
||||||
[assembly: AssemblyVersion ("1.0.*")]
|
|
||||||
|
|
||||||
// The following attributes are used to specify the signing key for the assembly,
|
|
||||||
// if desired. See the Mono documentation for more information about signing.
|
|
||||||
|
|
||||||
//[assembly: AssemblyDelaySign(false)]
|
|
||||||
//[assembly: AssemblyKeyFile("")]
|
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
grammar T;
|
|
||||||
@members {
|
|
||||||
bool pred(bool v) {
|
|
||||||
Console.WriteLine("eval="+v.ToString().ToLower());
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
s : e {this.pred(true)}? {Console.WriteLine("parse");} '!' ;
|
|
||||||
t : e {this.pred(false)}? ID ;
|
|
||||||
e : ID | ; // non-LL(1) so we use ATN
|
|
||||||
ID : 'a'..'z'+ ;
|
|
||||||
INT : '0'..'9'+;
|
|
||||||
WS : (' '|'\n') -> skip ;
|
|
|
@ -1,5 +0,0 @@
|
||||||
T__0=1
|
|
||||||
ID=2
|
|
||||||
INT=3
|
|
||||||
WS=4
|
|
||||||
'!'=1
|
|
|
@ -1,84 +0,0 @@
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by a tool.
|
|
||||||
// ANTLR Version: 4.4.1-dev
|
|
||||||
//
|
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
|
||||||
// the code is regenerated.
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// Generated from /users/ericvergnaud/Development/antlr4/antlr/antlr4-csharp/runtime/CSharp/Antlr4.Test.mono/T.g4 by ANTLR 4.4.1-dev
|
|
||||||
|
|
||||||
// Unreachable code detected
|
|
||||||
#pragma warning disable 0162
|
|
||||||
// The variable '...' is assigned but its value is never used
|
|
||||||
#pragma warning disable 0219
|
|
||||||
// Missing XML comment for publicly visible type or member '...'
|
|
||||||
#pragma warning disable 1591
|
|
||||||
|
|
||||||
|
|
||||||
using Antlr4.Runtime.Misc;
|
|
||||||
using IErrorNode = Antlr4.Runtime.Tree.IErrorNode;
|
|
||||||
using ITerminalNode = Antlr4.Runtime.Tree.ITerminalNode;
|
|
||||||
using IToken = Antlr4.Runtime.IToken;
|
|
||||||
using ParserRuleContext = Antlr4.Runtime.ParserRuleContext;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// This class provides an empty implementation of <see cref="ITListener"/>,
|
|
||||||
/// which can be extended to create a listener which only needs to handle a subset
|
|
||||||
/// of the available methods.
|
|
||||||
/// </summary>
|
|
||||||
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.4.1-dev")]
|
|
||||||
[System.CLSCompliant(false)]
|
|
||||||
public partial class TBaseListener : ITListener {
|
|
||||||
/// <summary>
|
|
||||||
/// Enter a parse tree produced by <see cref="TParser.s"/>.
|
|
||||||
/// <para>The default implementation does nothing.</para>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="context">The parse tree.</param>
|
|
||||||
public virtual void EnterS([NotNull] TParser.SContext context) { }
|
|
||||||
/// <summary>
|
|
||||||
/// Exit a parse tree produced by <see cref="TParser.s"/>.
|
|
||||||
/// <para>The default implementation does nothing.</para>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="context">The parse tree.</param>
|
|
||||||
public virtual void ExitS([NotNull] TParser.SContext context) { }
|
|
||||||
/// <summary>
|
|
||||||
/// Enter a parse tree produced by <see cref="TParser.t"/>.
|
|
||||||
/// <para>The default implementation does nothing.</para>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="context">The parse tree.</param>
|
|
||||||
public virtual void EnterT([NotNull] TParser.TContext context) { }
|
|
||||||
/// <summary>
|
|
||||||
/// Exit a parse tree produced by <see cref="TParser.t"/>.
|
|
||||||
/// <para>The default implementation does nothing.</para>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="context">The parse tree.</param>
|
|
||||||
public virtual void ExitT([NotNull] TParser.TContext context) { }
|
|
||||||
/// <summary>
|
|
||||||
/// Enter a parse tree produced by <see cref="TParser.e"/>.
|
|
||||||
/// <para>The default implementation does nothing.</para>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="context">The parse tree.</param>
|
|
||||||
public virtual void EnterE([NotNull] TParser.EContext context) { }
|
|
||||||
/// <summary>
|
|
||||||
/// Exit a parse tree produced by <see cref="TParser.e"/>.
|
|
||||||
/// <para>The default implementation does nothing.</para>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="context">The parse tree.</param>
|
|
||||||
public virtual void ExitE([NotNull] TParser.EContext context) { }
|
|
||||||
|
|
||||||
/// <inheritdoc/>
|
|
||||||
/// <remarks>The default implementation does nothing.</remarks>
|
|
||||||
public virtual void EnterEveryRule([NotNull] ParserRuleContext context) { }
|
|
||||||
/// <inheritdoc/>
|
|
||||||
/// <remarks>The default implementation does nothing.</remarks>
|
|
||||||
public virtual void ExitEveryRule([NotNull] ParserRuleContext context) { }
|
|
||||||
/// <inheritdoc/>
|
|
||||||
/// <remarks>The default implementation does nothing.</remarks>
|
|
||||||
public virtual void VisitTerminal([NotNull] ITerminalNode node) { }
|
|
||||||
/// <inheritdoc/>
|
|
||||||
/// <remarks>The default implementation does nothing.</remarks>
|
|
||||||
public virtual void VisitErrorNode([NotNull] IErrorNode node) { }
|
|
||||||
}
|
|
|
@ -1,64 +0,0 @@
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by a tool.
|
|
||||||
// ANTLR Version: 4.4.1-dev
|
|
||||||
//
|
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
|
||||||
// the code is regenerated.
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// Generated from /users/ericvergnaud/Development/antlr4/antlr/antlr4-csharp/runtime/CSharp/Antlr4.Test.mono/T.g4 by ANTLR 4.4.1-dev
|
|
||||||
|
|
||||||
// Unreachable code detected
|
|
||||||
#pragma warning disable 0162
|
|
||||||
// The variable '...' is assigned but its value is never used
|
|
||||||
#pragma warning disable 0219
|
|
||||||
// Missing XML comment for publicly visible type or member '...'
|
|
||||||
#pragma warning disable 1591
|
|
||||||
|
|
||||||
using Antlr4.Runtime.Misc;
|
|
||||||
using Antlr4.Runtime.Tree;
|
|
||||||
using IToken = Antlr4.Runtime.IToken;
|
|
||||||
using ParserRuleContext = Antlr4.Runtime.ParserRuleContext;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// This class provides an empty implementation of <see cref="ITVisitor{Result}"/>,
|
|
||||||
/// which can be extended to create a visitor which only needs to handle a subset
|
|
||||||
/// of the available methods.
|
|
||||||
/// </summary>
|
|
||||||
/// <typeparam name="Result">The return type of the visit operation.</typeparam>
|
|
||||||
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.4.1-dev")]
|
|
||||||
[System.CLSCompliant(false)]
|
|
||||||
public partial class TBaseVisitor<Result> : AbstractParseTreeVisitor<Result>, ITVisitor<Result> {
|
|
||||||
/// <summary>
|
|
||||||
/// Visit a parse tree produced by <see cref="TParser.s"/>.
|
|
||||||
/// <para>
|
|
||||||
/// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
|
|
||||||
/// on <paramref name="context"/>.
|
|
||||||
/// </para>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="context">The parse tree.</param>
|
|
||||||
/// <return>The visitor result.</return>
|
|
||||||
public virtual Result VisitS([NotNull] TParser.SContext context) { return VisitChildren(context); }
|
|
||||||
/// <summary>
|
|
||||||
/// Visit a parse tree produced by <see cref="TParser.t"/>.
|
|
||||||
/// <para>
|
|
||||||
/// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
|
|
||||||
/// on <paramref name="context"/>.
|
|
||||||
/// </para>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="context">The parse tree.</param>
|
|
||||||
/// <return>The visitor result.</return>
|
|
||||||
public virtual Result VisitT([NotNull] TParser.TContext context) { return VisitChildren(context); }
|
|
||||||
/// <summary>
|
|
||||||
/// Visit a parse tree produced by <see cref="TParser.e"/>.
|
|
||||||
/// <para>
|
|
||||||
/// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
|
|
||||||
/// on <paramref name="context"/>.
|
|
||||||
/// </para>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="context">The parse tree.</param>
|
|
||||||
/// <return>The visitor result.</return>
|
|
||||||
public virtual Result VisitE([NotNull] TParser.EContext context) { return VisitChildren(context); }
|
|
||||||
}
|
|
|
@ -1,92 +0,0 @@
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by a tool.
|
|
||||||
// ANTLR Version: 4.4.1-dev
|
|
||||||
//
|
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
|
||||||
// the code is regenerated.
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// Generated from /users/ericvergnaud/Development/antlr4/antlr/antlr4-csharp/runtime/CSharp/Antlr4.Test.mono/T.g4 by ANTLR 4.4.1-dev
|
|
||||||
|
|
||||||
// Unreachable code detected
|
|
||||||
#pragma warning disable 0162
|
|
||||||
// The variable '...' is assigned but its value is never used
|
|
||||||
#pragma warning disable 0219
|
|
||||||
// Missing XML comment for publicly visible type or member '...'
|
|
||||||
#pragma warning disable 1591
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using Antlr4.Runtime;
|
|
||||||
using Antlr4.Runtime.Atn;
|
|
||||||
using Antlr4.Runtime.Misc;
|
|
||||||
using DFA = Antlr4.Runtime.Dfa.DFA;
|
|
||||||
|
|
||||||
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.4.1-dev")]
|
|
||||||
[System.CLSCompliant(false)]
|
|
||||||
public partial class TLexer : Lexer {
|
|
||||||
public const int
|
|
||||||
T__0=1, ID=2, INT=3, WS=4;
|
|
||||||
public static string[] modeNames = {
|
|
||||||
"DEFAULT_MODE"
|
|
||||||
};
|
|
||||||
|
|
||||||
public static readonly string[] ruleNames = {
|
|
||||||
"T__0", "ID", "INT", "WS"
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
bool pred(bool v) {
|
|
||||||
Console.WriteLine("eval="+v.ToString().ToLower());
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public TLexer(ICharStream input)
|
|
||||||
: base(input)
|
|
||||||
{
|
|
||||||
Interpreter = new LexerATNSimulator(this,_ATN);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static readonly string[] _LiteralNames = {
|
|
||||||
null, "'!'"
|
|
||||||
};
|
|
||||||
private static readonly string[] _SymbolicNames = {
|
|
||||||
null, null, "ID", "INT", "WS"
|
|
||||||
};
|
|
||||||
public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames);
|
|
||||||
|
|
||||||
[NotNull]
|
|
||||||
public override IVocabulary Vocabulary
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return DefaultVocabulary;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string GrammarFileName { get { return "T.g4"; } }
|
|
||||||
|
|
||||||
public override string[] RuleNames { get { return ruleNames; } }
|
|
||||||
|
|
||||||
public override string[] ModeNames { get { return modeNames; } }
|
|
||||||
|
|
||||||
public override string SerializedAtn { get { return _serializedATN; } }
|
|
||||||
|
|
||||||
public static readonly string _serializedATN =
|
|
||||||
"\x3\x430\xD6D1\x8206\xAD2D\x4417\xAEF1\x8D80\xAADD\x2\x6\x1B\b\x1\x4\x2"+
|
|
||||||
"\t\x2\x4\x3\t\x3\x4\x4\t\x4\x4\x5\t\x5\x3\x2\x3\x2\x3\x3\x6\x3\xF\n\x3"+
|
|
||||||
"\r\x3\xE\x3\x10\x3\x4\x6\x4\x14\n\x4\r\x4\xE\x4\x15\x3\x5\x3\x5\x3\x5"+
|
|
||||||
"\x3\x5\x2\x2\x6\x3\x3\x5\x4\a\x5\t\x6\x3\x2\x3\x4\x2\f\f\"\"\x1C\x2\x3"+
|
|
||||||
"\x3\x2\x2\x2\x2\x5\x3\x2\x2\x2\x2\a\x3\x2\x2\x2\x2\t\x3\x2\x2\x2\x3\v"+
|
|
||||||
"\x3\x2\x2\x2\x5\xE\x3\x2\x2\x2\a\x13\x3\x2\x2\x2\t\x17\x3\x2\x2\x2\v\f"+
|
|
||||||
"\a#\x2\x2\f\x4\x3\x2\x2\x2\r\xF\x4\x63|\x2\xE\r\x3\x2\x2\x2\xF\x10\x3"+
|
|
||||||
"\x2\x2\x2\x10\xE\x3\x2\x2\x2\x10\x11\x3\x2\x2\x2\x11\x6\x3\x2\x2\x2\x12"+
|
|
||||||
"\x14\x4\x32;\x2\x13\x12\x3\x2\x2\x2\x14\x15\x3\x2\x2\x2\x15\x13\x3\x2"+
|
|
||||||
"\x2\x2\x15\x16\x3\x2\x2\x2\x16\b\x3\x2\x2\x2\x17\x18\t\x2\x2\x2\x18\x19"+
|
|
||||||
"\x3\x2\x2\x2\x19\x1A\b\x5\x2\x2\x1A\n\x3\x2\x2\x2\x5\x2\x10\x15\x3\b\x2"+
|
|
||||||
"\x2";
|
|
||||||
public static readonly ATN _ATN =
|
|
||||||
new ATNDeserializer().Deserialize(_serializedATN.ToCharArray());
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
T__0=1
|
|
||||||
ID=2
|
|
||||||
INT=3
|
|
||||||
WS=4
|
|
||||||
'!'=1
|
|
|
@ -1,61 +0,0 @@
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by a tool.
|
|
||||||
// ANTLR Version: 4.4.1-dev
|
|
||||||
//
|
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
|
||||||
// the code is regenerated.
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// Generated from /users/ericvergnaud/Development/antlr4/antlr/antlr4-csharp/runtime/CSharp/Antlr4.Test.mono/T.g4 by ANTLR 4.4.1-dev
|
|
||||||
|
|
||||||
// Unreachable code detected
|
|
||||||
#pragma warning disable 0162
|
|
||||||
// The variable '...' is assigned but its value is never used
|
|
||||||
#pragma warning disable 0219
|
|
||||||
// Missing XML comment for publicly visible type or member '...'
|
|
||||||
#pragma warning disable 1591
|
|
||||||
|
|
||||||
using Antlr4.Runtime.Misc;
|
|
||||||
using IParseTreeListener = Antlr4.Runtime.Tree.IParseTreeListener;
|
|
||||||
using IToken = Antlr4.Runtime.IToken;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// This interface defines a complete listener for a parse tree produced by
|
|
||||||
/// <see cref="TParser"/>.
|
|
||||||
/// </summary>
|
|
||||||
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.4.1-dev")]
|
|
||||||
[System.CLSCompliant(false)]
|
|
||||||
public interface ITListener : IParseTreeListener {
|
|
||||||
/// <summary>
|
|
||||||
/// Enter a parse tree produced by <see cref="TParser.s"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="context">The parse tree.</param>
|
|
||||||
void EnterS([NotNull] TParser.SContext context);
|
|
||||||
/// <summary>
|
|
||||||
/// Exit a parse tree produced by <see cref="TParser.s"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="context">The parse tree.</param>
|
|
||||||
void ExitS([NotNull] TParser.SContext context);
|
|
||||||
/// <summary>
|
|
||||||
/// Enter a parse tree produced by <see cref="TParser.t"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="context">The parse tree.</param>
|
|
||||||
void EnterT([NotNull] TParser.TContext context);
|
|
||||||
/// <summary>
|
|
||||||
/// Exit a parse tree produced by <see cref="TParser.t"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="context">The parse tree.</param>
|
|
||||||
void ExitT([NotNull] TParser.TContext context);
|
|
||||||
/// <summary>
|
|
||||||
/// Enter a parse tree produced by <see cref="TParser.e"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="context">The parse tree.</param>
|
|
||||||
void EnterE([NotNull] TParser.EContext context);
|
|
||||||
/// <summary>
|
|
||||||
/// Exit a parse tree produced by <see cref="TParser.e"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="context">The parse tree.</param>
|
|
||||||
void ExitE([NotNull] TParser.EContext context);
|
|
||||||
}
|
|
|
@ -1,257 +0,0 @@
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by a tool.
|
|
||||||
// ANTLR Version: 4.4.1-dev
|
|
||||||
//
|
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
|
||||||
// the code is regenerated.
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// Generated from /users/ericvergnaud/Development/antlr4/antlr/antlr4-csharp/runtime/CSharp/Antlr4.Test.mono/T.g4 by ANTLR 4.4.1-dev
|
|
||||||
|
|
||||||
// Unreachable code detected
|
|
||||||
#pragma warning disable 0162
|
|
||||||
// The variable '...' is assigned but its value is never used
|
|
||||||
#pragma warning disable 0219
|
|
||||||
// Missing XML comment for publicly visible type or member '...'
|
|
||||||
#pragma warning disable 1591
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Text;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Antlr4.Runtime;
|
|
||||||
using Antlr4.Runtime.Atn;
|
|
||||||
using Antlr4.Runtime.Misc;
|
|
||||||
using Antlr4.Runtime.Tree;
|
|
||||||
using DFA = Antlr4.Runtime.Dfa.DFA;
|
|
||||||
|
|
||||||
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.4.1-dev")]
|
|
||||||
[System.CLSCompliant(false)]
|
|
||||||
public partial class TParser : Parser {
|
|
||||||
public const int
|
|
||||||
T__0=1, ID=2, INT=3, WS=4;
|
|
||||||
public const int
|
|
||||||
RULE_s = 0, RULE_t = 1, RULE_e = 2;
|
|
||||||
public static readonly string[] ruleNames = {
|
|
||||||
"s", "t", "e"
|
|
||||||
};
|
|
||||||
|
|
||||||
private static readonly string[] _LiteralNames = {
|
|
||||||
null, "'!'"
|
|
||||||
};
|
|
||||||
private static readonly string[] _SymbolicNames = {
|
|
||||||
null, null, "ID", "INT", "WS"
|
|
||||||
};
|
|
||||||
public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames);
|
|
||||||
|
|
||||||
[NotNull]
|
|
||||||
public override IVocabulary Vocabulary
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return DefaultVocabulary;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string GrammarFileName { get { return "T.g4"; } }
|
|
||||||
|
|
||||||
public override string[] RuleNames { get { return ruleNames; } }
|
|
||||||
|
|
||||||
public override string SerializedAtn { get { return _serializedATN; } }
|
|
||||||
|
|
||||||
|
|
||||||
bool pred(bool v) {
|
|
||||||
Console.WriteLine("eval="+v.ToString().ToLower());
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TParser(ITokenStream input)
|
|
||||||
: base(input)
|
|
||||||
{
|
|
||||||
Interpreter = new ParserATNSimulator(this,_ATN);
|
|
||||||
}
|
|
||||||
public partial class SContext : ParserRuleContext {
|
|
||||||
public EContext e() {
|
|
||||||
return GetRuleContext<EContext>(0);
|
|
||||||
}
|
|
||||||
public SContext(ParserRuleContext parent, int invokingState)
|
|
||||||
: base(parent, invokingState)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
public override int RuleIndex { get { return RULE_s; } }
|
|
||||||
public override void EnterRule(IParseTreeListener listener) {
|
|
||||||
ITListener typedListener = listener as ITListener;
|
|
||||||
if (typedListener != null) typedListener.EnterS(this);
|
|
||||||
}
|
|
||||||
public override void ExitRule(IParseTreeListener listener) {
|
|
||||||
ITListener typedListener = listener as ITListener;
|
|
||||||
if (typedListener != null) typedListener.ExitS(this);
|
|
||||||
}
|
|
||||||
public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
|
|
||||||
ITVisitor<TResult> typedVisitor = visitor as ITVisitor<TResult>;
|
|
||||||
if (typedVisitor != null) return typedVisitor.VisitS(this);
|
|
||||||
else return visitor.VisitChildren(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[RuleVersion(0)]
|
|
||||||
public SContext s() {
|
|
||||||
SContext _localctx = new SContext(Context, State);
|
|
||||||
EnterRule(_localctx, 0, RULE_s);
|
|
||||||
try {
|
|
||||||
EnterOuterAlt(_localctx, 1);
|
|
||||||
{
|
|
||||||
State = 6; e();
|
|
||||||
State = 7;
|
|
||||||
if (!(this.pred(true))) throw new FailedPredicateException(this, "this.pred(true)");
|
|
||||||
Console.WriteLine("parse");
|
|
||||||
State = 9; Match(T__0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (RecognitionException re) {
|
|
||||||
_localctx.exception = re;
|
|
||||||
ErrorHandler.ReportError(this, re);
|
|
||||||
ErrorHandler.Recover(this, re);
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
ExitRule();
|
|
||||||
}
|
|
||||||
return _localctx;
|
|
||||||
}
|
|
||||||
|
|
||||||
public partial class TContext : ParserRuleContext {
|
|
||||||
public EContext e() {
|
|
||||||
return GetRuleContext<EContext>(0);
|
|
||||||
}
|
|
||||||
public ITerminalNode ID() { return GetToken(TParser.ID, 0); }
|
|
||||||
public TContext(ParserRuleContext parent, int invokingState)
|
|
||||||
: base(parent, invokingState)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
public override int RuleIndex { get { return RULE_t; } }
|
|
||||||
public override void EnterRule(IParseTreeListener listener) {
|
|
||||||
ITListener typedListener = listener as ITListener;
|
|
||||||
if (typedListener != null) typedListener.EnterT(this);
|
|
||||||
}
|
|
||||||
public override void ExitRule(IParseTreeListener listener) {
|
|
||||||
ITListener typedListener = listener as ITListener;
|
|
||||||
if (typedListener != null) typedListener.ExitT(this);
|
|
||||||
}
|
|
||||||
public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
|
|
||||||
ITVisitor<TResult> typedVisitor = visitor as ITVisitor<TResult>;
|
|
||||||
if (typedVisitor != null) return typedVisitor.VisitT(this);
|
|
||||||
else return visitor.VisitChildren(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[RuleVersion(0)]
|
|
||||||
public TContext t() {
|
|
||||||
TContext _localctx = new TContext(Context, State);
|
|
||||||
EnterRule(_localctx, 2, RULE_t);
|
|
||||||
try {
|
|
||||||
EnterOuterAlt(_localctx, 1);
|
|
||||||
{
|
|
||||||
State = 11; e();
|
|
||||||
State = 12;
|
|
||||||
if (!(this.pred(false))) throw new FailedPredicateException(this, "this.pred(false)");
|
|
||||||
State = 13; Match(ID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (RecognitionException re) {
|
|
||||||
_localctx.exception = re;
|
|
||||||
ErrorHandler.ReportError(this, re);
|
|
||||||
ErrorHandler.Recover(this, re);
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
ExitRule();
|
|
||||||
}
|
|
||||||
return _localctx;
|
|
||||||
}
|
|
||||||
|
|
||||||
public partial class EContext : ParserRuleContext {
|
|
||||||
public ITerminalNode ID() { return GetToken(TParser.ID, 0); }
|
|
||||||
public EContext(ParserRuleContext parent, int invokingState)
|
|
||||||
: base(parent, invokingState)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
public override int RuleIndex { get { return RULE_e; } }
|
|
||||||
public override void EnterRule(IParseTreeListener listener) {
|
|
||||||
ITListener typedListener = listener as ITListener;
|
|
||||||
if (typedListener != null) typedListener.EnterE(this);
|
|
||||||
}
|
|
||||||
public override void ExitRule(IParseTreeListener listener) {
|
|
||||||
ITListener typedListener = listener as ITListener;
|
|
||||||
if (typedListener != null) typedListener.ExitE(this);
|
|
||||||
}
|
|
||||||
public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
|
|
||||||
ITVisitor<TResult> typedVisitor = visitor as ITVisitor<TResult>;
|
|
||||||
if (typedVisitor != null) return typedVisitor.VisitE(this);
|
|
||||||
else return visitor.VisitChildren(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[RuleVersion(0)]
|
|
||||||
public EContext e() {
|
|
||||||
EContext _localctx = new EContext(Context, State);
|
|
||||||
EnterRule(_localctx, 4, RULE_e);
|
|
||||||
try {
|
|
||||||
State = 17;
|
|
||||||
switch ( Interpreter.AdaptivePredict(TokenStream,0,Context) ) {
|
|
||||||
case 1:
|
|
||||||
EnterOuterAlt(_localctx, 1);
|
|
||||||
{
|
|
||||||
State = 15; Match(ID);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
EnterOuterAlt(_localctx, 2);
|
|
||||||
{
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (RecognitionException re) {
|
|
||||||
_localctx.exception = re;
|
|
||||||
ErrorHandler.ReportError(this, re);
|
|
||||||
ErrorHandler.Recover(this, re);
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
ExitRule();
|
|
||||||
}
|
|
||||||
return _localctx;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool Sempred(RuleContext _localctx, int ruleIndex, int predIndex) {
|
|
||||||
switch (ruleIndex) {
|
|
||||||
case 0: return s_sempred((SContext)_localctx, predIndex);
|
|
||||||
case 1: return t_sempred((TContext)_localctx, predIndex);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
private bool s_sempred(SContext _localctx, int predIndex) {
|
|
||||||
switch (predIndex) {
|
|
||||||
case 0: return this.pred(true);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
private bool t_sempred(TContext _localctx, int predIndex) {
|
|
||||||
switch (predIndex) {
|
|
||||||
case 1: return this.pred(false);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static readonly string _serializedATN =
|
|
||||||
"\x3\x430\xD6D1\x8206\xAD2D\x4417\xAEF1\x8D80\xAADD\x3\x6\x16\x4\x2\t\x2"+
|
|
||||||
"\x4\x3\t\x3\x4\x4\t\x4\x3\x2\x3\x2\x3\x2\x3\x2\x3\x2\x3\x3\x3\x3\x3\x3"+
|
|
||||||
"\x3\x3\x3\x4\x3\x4\x5\x4\x14\n\x4\x3\x4\x2\x2\x5\x2\x4\x6\x2\x2\x13\x2"+
|
|
||||||
"\b\x3\x2\x2\x2\x4\r\x3\x2\x2\x2\x6\x13\x3\x2\x2\x2\b\t\x5\x6\x4\x2\t\n"+
|
|
||||||
"\x6\x2\x2\x2\n\v\b\x2\x1\x2\v\f\a\x3\x2\x2\f\x3\x3\x2\x2\x2\r\xE\x5\x6"+
|
|
||||||
"\x4\x2\xE\xF\x6\x3\x3\x2\xF\x10\a\x4\x2\x2\x10\x5\x3\x2\x2\x2\x11\x14"+
|
|
||||||
"\a\x4\x2\x2\x12\x14\x3\x2\x2\x2\x13\x11\x3\x2\x2\x2\x13\x12\x3\x2\x2\x2"+
|
|
||||||
"\x14\a\x3\x2\x2\x2\x3\x13";
|
|
||||||
public static readonly ATN _ATN =
|
|
||||||
new ATNDeserializer().Deserialize(_serializedATN.ToCharArray());
|
|
||||||
}
|
|
|
@ -1,50 +0,0 @@
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by a tool.
|
|
||||||
// ANTLR Version: 4.4.1-dev
|
|
||||||
//
|
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
|
||||||
// the code is regenerated.
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// Generated from /users/ericvergnaud/Development/antlr4/antlr/antlr4-csharp/runtime/CSharp/Antlr4.Test.mono/T.g4 by ANTLR 4.4.1-dev
|
|
||||||
|
|
||||||
// Unreachable code detected
|
|
||||||
#pragma warning disable 0162
|
|
||||||
// The variable '...' is assigned but its value is never used
|
|
||||||
#pragma warning disable 0219
|
|
||||||
// Missing XML comment for publicly visible type or member '...'
|
|
||||||
#pragma warning disable 1591
|
|
||||||
|
|
||||||
using Antlr4.Runtime.Misc;
|
|
||||||
using Antlr4.Runtime.Tree;
|
|
||||||
using IToken = Antlr4.Runtime.IToken;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// This interface defines a complete generic visitor for a parse tree produced
|
|
||||||
/// by <see cref="TParser"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <typeparam name="Result">The return type of the visit operation.</typeparam>
|
|
||||||
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.4.1-dev")]
|
|
||||||
[System.CLSCompliant(false)]
|
|
||||||
public interface ITVisitor<Result> : IParseTreeVisitor<Result> {
|
|
||||||
/// <summary>
|
|
||||||
/// Visit a parse tree produced by <see cref="TParser.s"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="context">The parse tree.</param>
|
|
||||||
/// <return>The visitor result.</return>
|
|
||||||
Result VisitS([NotNull] TParser.SContext context);
|
|
||||||
/// <summary>
|
|
||||||
/// Visit a parse tree produced by <see cref="TParser.t"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="context">The parse tree.</param>
|
|
||||||
/// <return>The visitor result.</return>
|
|
||||||
Result VisitT([NotNull] TParser.TContext context);
|
|
||||||
/// <summary>
|
|
||||||
/// Visit a parse tree produced by <see cref="TParser.e"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="context">The parse tree.</param>
|
|
||||||
/// <return>The visitor result.</return>
|
|
||||||
Result VisitE([NotNull] TParser.EContext context);
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
using System;
|
|
||||||
using Antlr4.Runtime;
|
|
||||||
using Antlr4.Runtime.Tree;
|
|
||||||
|
|
||||||
public class Test {
|
|
||||||
public static void Main(string[] args) {
|
|
||||||
ICharStream input = new AntlrFileStream("../../input");
|
|
||||||
TLexer lex = new TLexer(input);
|
|
||||||
CommonTokenStream tokens = new CommonTokenStream(lex);
|
|
||||||
TParser parser = new TParser(tokens);
|
|
||||||
parser.AddErrorListener(new DiagnosticErrorListener());
|
|
||||||
|
|
||||||
parser.BuildParseTree = true;
|
|
||||||
ParserRuleContext tree = parser.s();
|
|
||||||
ParseTreeWalker.Default.Walk(new TreeShapeListener(), tree);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class TreeShapeListener : IParseTreeListener {
|
|
||||||
public void VisitTerminal(ITerminalNode node) { }
|
|
||||||
public void VisitErrorNode(IErrorNode node) { }
|
|
||||||
public void ExitEveryRule(ParserRuleContext ctx) { }
|
|
||||||
|
|
||||||
public void EnterEveryRule(ParserRuleContext ctx) {
|
|
||||||
for (int i = 0; i < ctx.ChildCount; i++) {
|
|
||||||
IParseTree parent = ctx.GetChild(i).Parent;
|
|
||||||
if (!(parent is IRuleNode) || ((IRuleNode)parent).RuleContext != ctx) {
|
|
||||||
throw new Exception("Invalid parse tree shape detected.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
a!
|
|
|
@ -1,20 +0,0 @@
|
||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
|
||||||
# Visual Studio 2008
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Antlr4.Runtime.net35-cf", "Antlr4.Runtime\Antlr4.Runtime.net35-cf.csproj", "{C5F9C476-200F-4440-9524-C5C3F9BE16D7}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Any CPU = Debug|Any CPU
|
|
||||||
Release|Any CPU = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{C5F9C476-200F-4440-9524-C5C3F9BE16D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{C5F9C476-200F-4440-9524-C5C3F9BE16D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{C5F9C476-200F-4440-9524-C5C3F9BE16D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{C5F9C476-200F-4440-9524-C5C3F9BE16D7}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
|
@ -1,145 +0,0 @@
|
||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
# Visual Studio 2013
|
|
||||||
VisualStudioVersion = 12.0.30110.0
|
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Antlr4.Runtime.net45", "Antlr4.Runtime\Antlr4.Runtime.net45.csproj", "{E1D192DE-5347-48C4-A9F4-A8CBA2AF3869}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{47C0086D-577C-43DA-ADC7-544F27656E45}"
|
|
||||||
ProjectSection(SolutionItems) = preProject
|
|
||||||
..\..\CreatingTargets.md = ..\..\CreatingTargets.md
|
|
||||||
..\..\tool\resources\org\antlr\v4\tool\templates\codegen\CSharp\CSharp.stg = ..\..\tool\resources\org\antlr\v4\tool\templates\codegen\CSharp\CSharp.stg
|
|
||||||
..\..\tool\src\org\antlr\v4\codegen\CSharpTarget.java = ..\..\tool\src\org\antlr\v4\codegen\CSharpTarget.java
|
|
||||||
..\..\tool\pom.xml = ..\..\tool\pom.xml
|
|
||||||
..\..\Readme.md = ..\..\Readme.md
|
|
||||||
..\..\reference\sharpen-all-options.txt = ..\..\reference\sharpen-all-options.txt
|
|
||||||
..\..\reference\sharpen.md = ..\..\reference\sharpen.md
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Antlr4.Runtime.Test.net45", "Antlr4.Runtime.Test\Antlr4.Runtime.Test.net45.csproj", "{9D8C43DF-71F9-4CC9-83AD-A39FAEBCECA0}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Antlr4BuildTasks.net40", "Antlr4BuildTasks\Antlr4BuildTasks.net40.csproj", "{F63DFE80-AE1F-47A6-A31A-E39DA4C837BA}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Antlr4.Runtime.net40-client", "Antlr4.Runtime\Antlr4.Runtime.net40-client.csproj", "{423978DF-85A4-409E-A16C-453683FE3969}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Antlr4.Runtime.net35-client", "Antlr4.Runtime\Antlr4.Runtime.net35-client.csproj", "{E186FDA3-1411-47EE-94C7-9F3745F0474B}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Antlr4.Runtime.net30", "Antlr4.Runtime\Antlr4.Runtime.net30.csproj", "{EBBDCC35-43CC-416C-860B-9FC115F1EB42}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Antlr4.Runtime.net20", "Antlr4.Runtime\Antlr4.Runtime.net20.csproj", "{E1A46D9D-66CB-46E8-93B0-7FC87299ABEF}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Antlr4.Runtime.Test.net40-client", "Antlr4.Runtime.Test\Antlr4.Runtime.Test.net40-client.csproj", "{706D364A-CD4E-4720-B94C-0DB82AF7B433}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Antlr4.Runtime.Test.net35-client", "Antlr4.Runtime.Test\Antlr4.Runtime.Test.net35-client.csproj", "{C4A38390-8AA3-45AE-9A70-C392146B37D0}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Antlr4.Runtime.Test.net30", "Antlr4.Runtime.Test\Antlr4.Runtime.Test.net30.csproj", "{8A2F2331-A4A5-4C7F-8D5D-DEECEF54AEA7}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Antlr4.Runtime.Test.net20", "Antlr4.Runtime.Test\Antlr4.Runtime.Test.net20.csproj", "{0A4681C4-1248-4ACD-B59F-D6CC17CC2B4C}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Antlr4.Runtime.portable-net40", "Antlr4.Runtime\Antlr4.Runtime.portable-net40.csproj", "{06C182C5-095C-4D43-9C33-C87E305C6BC2}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Antlr4.Runtime.Test.portable-net40", "Antlr4.Runtime.Test\Antlr4.Runtime.Test.portable-net40.csproj", "{97C32E42-51B2-4A29-B005-769B63CFEFCA}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Antlr4BuildTasks.net35", "Antlr4BuildTasks\Antlr4BuildTasks.net35.csproj", "{0D3D20E9-3341-4449-80E7-76A4534F0E55}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{4CE79A54-058D-4940-875E-7F6AA9922A7D}"
|
|
||||||
ProjectSection(SolutionItems) = preProject
|
|
||||||
..\..\build\Antlr4.nuspec = ..\..\build\Antlr4.nuspec
|
|
||||||
..\..\build\Antlr4.Runtime.nuspec = ..\..\build\Antlr4.Runtime.nuspec
|
|
||||||
..\..\build\Antlr4.VS2008.nuspec = ..\..\build\Antlr4.VS2008.nuspec
|
|
||||||
..\..\build\build.ps1 = ..\..\build\build.ps1
|
|
||||||
..\..\build\check-key.ps1 = ..\..\build\check-key.ps1
|
|
||||||
build\KeyReporting.targets = build\KeyReporting.targets
|
|
||||||
..\..\build\keys.ps1 = ..\..\build\keys.ps1
|
|
||||||
..\..\build\push.ps1 = ..\..\build\push.ps1
|
|
||||||
..\..\build\version.ps1 = ..\..\build\version.ps1
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Antlr4.Runtime.portable-net45", "Antlr4.Runtime\Antlr4.Runtime.portable-net45.csproj", "{12269283-EE92-4FAA-B849-53CD24F341FA}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Antlr4.Runtime.Test.portable-net45", "Antlr4.Runtime.Test\Antlr4.Runtime.Test.portable-net45.csproj", "{5844076E-3C92-4122-BB7A-0D745C3F5334}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Antlr4.Runtime.netcore45", "Antlr4.Runtime\Antlr4.Runtime.netcore45.csproj", "{F3145DCA-EA26-4482-80D6-5232A79E2A3A}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Any CPU = Debug|Any CPU
|
|
||||||
Release|Any CPU = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{E1D192DE-5347-48C4-A9F4-A8CBA2AF3869}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{E1D192DE-5347-48C4-A9F4-A8CBA2AF3869}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{E1D192DE-5347-48C4-A9F4-A8CBA2AF3869}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{E1D192DE-5347-48C4-A9F4-A8CBA2AF3869}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{9D8C43DF-71F9-4CC9-83AD-A39FAEBCECA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{9D8C43DF-71F9-4CC9-83AD-A39FAEBCECA0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{9D8C43DF-71F9-4CC9-83AD-A39FAEBCECA0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{9D8C43DF-71F9-4CC9-83AD-A39FAEBCECA0}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{F63DFE80-AE1F-47A6-A31A-E39DA4C837BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{F63DFE80-AE1F-47A6-A31A-E39DA4C837BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{F63DFE80-AE1F-47A6-A31A-E39DA4C837BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{F63DFE80-AE1F-47A6-A31A-E39DA4C837BA}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{423978DF-85A4-409E-A16C-453683FE3969}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{423978DF-85A4-409E-A16C-453683FE3969}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{423978DF-85A4-409E-A16C-453683FE3969}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{423978DF-85A4-409E-A16C-453683FE3969}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{E186FDA3-1411-47EE-94C7-9F3745F0474B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{E186FDA3-1411-47EE-94C7-9F3745F0474B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{E186FDA3-1411-47EE-94C7-9F3745F0474B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{E186FDA3-1411-47EE-94C7-9F3745F0474B}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{EBBDCC35-43CC-416C-860B-9FC115F1EB42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{EBBDCC35-43CC-416C-860B-9FC115F1EB42}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{EBBDCC35-43CC-416C-860B-9FC115F1EB42}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{EBBDCC35-43CC-416C-860B-9FC115F1EB42}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{E1A46D9D-66CB-46E8-93B0-7FC87299ABEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{E1A46D9D-66CB-46E8-93B0-7FC87299ABEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{E1A46D9D-66CB-46E8-93B0-7FC87299ABEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{E1A46D9D-66CB-46E8-93B0-7FC87299ABEF}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{706D364A-CD4E-4720-B94C-0DB82AF7B433}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{706D364A-CD4E-4720-B94C-0DB82AF7B433}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{706D364A-CD4E-4720-B94C-0DB82AF7B433}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{706D364A-CD4E-4720-B94C-0DB82AF7B433}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{C4A38390-8AA3-45AE-9A70-C392146B37D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{C4A38390-8AA3-45AE-9A70-C392146B37D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{C4A38390-8AA3-45AE-9A70-C392146B37D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{C4A38390-8AA3-45AE-9A70-C392146B37D0}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{8A2F2331-A4A5-4C7F-8D5D-DEECEF54AEA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{8A2F2331-A4A5-4C7F-8D5D-DEECEF54AEA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{8A2F2331-A4A5-4C7F-8D5D-DEECEF54AEA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{8A2F2331-A4A5-4C7F-8D5D-DEECEF54AEA7}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{0A4681C4-1248-4ACD-B59F-D6CC17CC2B4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{0A4681C4-1248-4ACD-B59F-D6CC17CC2B4C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{0A4681C4-1248-4ACD-B59F-D6CC17CC2B4C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{0A4681C4-1248-4ACD-B59F-D6CC17CC2B4C}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{06C182C5-095C-4D43-9C33-C87E305C6BC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{06C182C5-095C-4D43-9C33-C87E305C6BC2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{06C182C5-095C-4D43-9C33-C87E305C6BC2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{06C182C5-095C-4D43-9C33-C87E305C6BC2}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{97C32E42-51B2-4A29-B005-769B63CFEFCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{97C32E42-51B2-4A29-B005-769B63CFEFCA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{97C32E42-51B2-4A29-B005-769B63CFEFCA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{97C32E42-51B2-4A29-B005-769B63CFEFCA}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{0D3D20E9-3341-4449-80E7-76A4534F0E55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{0D3D20E9-3341-4449-80E7-76A4534F0E55}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{0D3D20E9-3341-4449-80E7-76A4534F0E55}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{0D3D20E9-3341-4449-80E7-76A4534F0E55}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{12269283-EE92-4FAA-B849-53CD24F341FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{12269283-EE92-4FAA-B849-53CD24F341FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{12269283-EE92-4FAA-B849-53CD24F341FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{12269283-EE92-4FAA-B849-53CD24F341FA}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{5844076E-3C92-4122-BB7A-0D745C3F5334}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{5844076E-3C92-4122-BB7A-0D745C3F5334}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{5844076E-3C92-4122-BB7A-0D745C3F5334}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{5844076E-3C92-4122-BB7A-0D745C3F5334}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{F3145DCA-EA26-4482-80D6-5232A79E2A3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{F3145DCA-EA26-4482-80D6-5232A79E2A3A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{F3145DCA-EA26-4482-80D6-5232A79E2A3A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{F3145DCA-EA26-4482-80D6-5232A79E2A3A}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(NestedProjects) = preSolution
|
|
||||||
{4CE79A54-058D-4940-875E-7F6AA9922A7D} = {47C0086D-577C-43DA-ADC7-544F27656E45}
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio 2013
|
||||||
|
VisualStudioVersion = 12.0.31101.0
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{47C0086D-577C-43DA-ADC7-544F27656E45}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Antlr4.Runtime.vs2013", "Antlr4.Runtime\Antlr4.Runtime.vs2013.csproj", "{E1A46D9D-66CB-46E8-93B0-7FC87299ABEF}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{E1A46D9D-66CB-46E8-93B0-7FC87299ABEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{E1A46D9D-66CB-46E8-93B0-7FC87299ABEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{E1A46D9D-66CB-46E8-93B0-7FC87299ABEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{E1A46D9D-66CB-46E8-93B0-7FC87299ABEF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
|
@ -1,9 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<!-- Folder containing Antlr4BuildTasks.net35.dll -->
|
|
||||||
<Antlr4BuildTaskPath>.</Antlr4BuildTaskPath>
|
|
||||||
<!-- Path to the ANTLR tool itself -->
|
|
||||||
<Antlr4ToolPath>..\tools\antlr4-csharp-4.4.1-SNAPSHOT-complete.jar</Antlr4ToolPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
|
|
@ -1,188 +0,0 @@
|
||||||
<!--
|
|
||||||
[The "BSD licence"]
|
|
||||||
Copyright (c) 2013 Sam Harwell
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions
|
|
||||||
are met:
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer.
|
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer in the
|
|
||||||
documentation and/or other materials provided with the distribution.
|
|
||||||
3. The name of the author may not be used to endorse or promote products
|
|
||||||
derived from this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
||||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
||||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
||||||
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
||||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
||||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
||||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
-->
|
|
||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<BuildSystem>MSBuild</BuildSystem>
|
|
||||||
<TaskVersion>4.0.0.0</TaskVersion>
|
|
||||||
<TaskKeyToken>eb42632606e9261f</TaskKeyToken>
|
|
||||||
<Antlr4BuildTaskAssemblyName Condition="'$(Antlr4BuildTaskAssemblyName)'==''">Antlr4BuildTasks.net35, Version=$(TaskVersion), Culture=neutral, PublicKeyToken=$(TaskKeyToken)</Antlr4BuildTaskAssemblyName>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<LoadTimeSensitiveTargets>
|
|
||||||
$(LoadTimeSensitiveTargets);
|
|
||||||
Antlr4Compile;
|
|
||||||
Antlr4CompileAddFilesGenerated;
|
|
||||||
</LoadTimeSensitiveTargets>
|
|
||||||
<LoadTimeSensitiveProperties>
|
|
||||||
$(LoadTimeSensitiveProperties);
|
|
||||||
Antlr4CompileDependsOn;
|
|
||||||
Antlr4CompileAddFilesGeneratedDependsOn;
|
|
||||||
</LoadTimeSensitiveProperties>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<Antlr4BuildTaskLocation Condition="'$(Antlr4BuildTaskPath)'==''">$(MSBuildBinPath)</Antlr4BuildTaskLocation>
|
|
||||||
<Antlr4BuildTaskLocation Condition="'$(Antlr4BuildTaskPath)'!=''">$(Antlr4BuildTaskPath)</Antlr4BuildTaskLocation>
|
|
||||||
<Antlr4ToolLocation Condition="'$(Antlr4ToolPath)'==''">$(MSBuildBinPath)\Antlr4\antlr4-csharp-4.4.1-SNAPSHOT-complete.jar</Antlr4ToolLocation>
|
|
||||||
<Antlr4ToolLocation Condition="'$(Antlr4ToolPath)'!=''">$(Antlr4ToolPath)</Antlr4ToolLocation>
|
|
||||||
|
|
||||||
<Antlr4JavaVendor Condition="'$(Antlr4JavaVendor)'==''">JavaSoft</Antlr4JavaVendor>
|
|
||||||
<Antlr4JavaInstallation Condition="'$(Antlr4JavaInstallation)'==''">Java Runtime Environment</Antlr4JavaInstallation>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<Antlr4GenCodeFileNames Condition="'$(Antlr4GenCodeFileNames)'==''">$(MSBuildProjectFile).Antlr4GeneratedCodeFileListAbsolute.txt</Antlr4GenCodeFileNames>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<UsingTask Condition="'$(Antlr4BuildTaskPath)'==''" TaskName="Antlr4.Build.Tasks.Antlr4ClassGenerationTask" AssemblyName="$(Antlr4BuildTaskAssemblyName)" />
|
|
||||||
<UsingTask Condition="'$(Antlr4BuildTaskPath)'!=''" TaskName="Antlr4.Build.Tasks.Antlr4ClassGenerationTask" AssemblyFile="$(Antlr4BuildTaskPath)\Antlr4BuildTasks.net35.dll" />
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<PrepareResourcesDependsOn>
|
|
||||||
Antlr4Compile;
|
|
||||||
Antlr4CompileAddFilesGenerated;
|
|
||||||
$(PrepareResourcesDependsOn)
|
|
||||||
</PrepareResourcesDependsOn>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<Antlr4CompileDependsOn>
|
|
||||||
Antlr4CompileReadGeneratedFileList
|
|
||||||
</Antlr4CompileDependsOn>
|
|
||||||
<Antlr4CompileAddFilesGeneratedDependsOn>
|
|
||||||
Antlr4Compile
|
|
||||||
</Antlr4CompileAddFilesGeneratedDependsOn>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup Condition="'$(BuildingInsideVisualStudio)'=='true'">
|
|
||||||
<AvailableItemName Include="Antlr4" />
|
|
||||||
<AvailableItemName Include="Antlr4Tokens" />
|
|
||||||
<AvailableItemName Include="Antlr4AbstractGrammar" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemDefinitionGroup>
|
|
||||||
<Antlr4>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<CustomToolNamespace>$(RootNamespace)</CustomToolNamespace>
|
|
||||||
<TargetLanguage>CSharp</TargetLanguage>
|
|
||||||
<Listener>true</Listener>
|
|
||||||
<Visitor>true</Visitor>
|
|
||||||
<Abstract>false</Abstract>
|
|
||||||
<ForceAtn>false</ForceAtn>
|
|
||||||
</Antlr4>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
|
|
||||||
<Target Name="Antlr4CompileReadGeneratedFileList">
|
|
||||||
<ReadLinesFromFile File="$(IntermediateOutputPath)$(Antlr4GenCodeFileNames)">
|
|
||||||
<Output TaskParameter="Lines" ItemName="Antlr4OutputCodeFilesList"/>
|
|
||||||
</ReadLinesFromFile>
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<!-- Add grammar compilation to the CoreCompileDependsOn so that the IDE inproc compilers (particularly VB)
|
|
||||||
can "see" the generated source files. -->
|
|
||||||
<CoreCompileDependsOn Condition="'$(BuildingInsideVisualStudio)' == 'true' ">
|
|
||||||
Antlr4DesignTimeGrammarCompilation;
|
|
||||||
$(CoreCompileDependsOn)
|
|
||||||
</CoreCompileDependsOn>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<Target Name="Antlr4DesignTimeGrammarCompilation">
|
|
||||||
<!-- Only if we are not actually performing a compile i.e. we are in design mode -->
|
|
||||||
<CallTarget Condition="'$(BuildingProject)' != 'true'"
|
|
||||||
Targets="Antlr4Compile" />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<Target Name="Antlr4Compile"
|
|
||||||
DependsOnTargets="$(Antlr4CompileDependsOn)"
|
|
||||||
Condition="'@(Antlr4)' != ''"
|
|
||||||
Inputs="@(Antlr4);@(Antlr4Tokens);@(Antlr4AbstractGrammar)"
|
|
||||||
Outputs="@(Antlr4OutputCodeFilesList);
|
|
||||||
$(IntermediateOutputPath)$(Antlr4GenCodeFileNames);">
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Antlr4GeneratedCodeFiles Remove="@(Antlr4GeneratedCodeFiles)" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<_IntellisenseOnlyCompile>false</_IntellisenseOnlyCompile>
|
|
||||||
<_IntellisenseOnlyCompile Condition="'$(BuildingProject)' != 'true'">true</_IntellisenseOnlyCompile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Antlr4ClassGenerationTask
|
|
||||||
ToolPath="$(Antlr4ToolLocation)"
|
|
||||||
JavaVendor="$(Antlr4JavaVendor)"
|
|
||||||
JavaInstallation="$(Antlr4JavaInstallation)"
|
|
||||||
JavaExecutable="$(Antlr4JavaExecutable)"
|
|
||||||
BuildTaskPath="$(Antlr4BuildTaskLocation)"
|
|
||||||
OutputPath="$(IntermediateOutputPath)"
|
|
||||||
TargetLanguage="%(Antlr4.TargetLanguage)"
|
|
||||||
TargetFrameworkVersion="$(TargetFrameworkVersion)"
|
|
||||||
TargetNamespace="%(Antlr4.CustomToolNamespace)"
|
|
||||||
SourceCodeFiles="@(Antlr4 -> '%(FullPath)')"
|
|
||||||
ContinueOnError="$(_IntellisenseOnlyCompile)"
|
|
||||||
TokensFiles="@(Antlr4Tokens)"
|
|
||||||
AbstractGrammarFiles="@(Antlr4AbstractGrammar)"
|
|
||||||
LanguageSourceExtensions="$(DefaultLanguageSourceExtension)"
|
|
||||||
GenerateListener="%(Antlr4.Listener)"
|
|
||||||
GenerateVisitor="%(Antlr4.Visitor)"
|
|
||||||
ForceAtn="%(Antlr4.ForceAtn)"
|
|
||||||
AbstractGrammar="%(Antlr4.Abstract)">
|
|
||||||
|
|
||||||
<Output ItemName="Compile" TaskParameter="GeneratedCodeFiles" Condition="'$(_IntellisenseOnlyCompile)' == 'true'" />
|
|
||||||
<Output ItemName="Antlr4GeneratedCodeFiles" TaskParameter="GeneratedCodeFiles" />
|
|
||||||
</Antlr4ClassGenerationTask>
|
|
||||||
|
|
||||||
<WriteLinesToFile
|
|
||||||
Condition="'$(_IntellisenseOnlyCompile)' != 'true'"
|
|
||||||
File="$(IntermediateOutputPath)$(Antlr4GenCodeFileNames)"
|
|
||||||
Lines="@(Antlr4GeneratedCodeFiles)"
|
|
||||||
Overwrite="true"/>
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<Target Name="Antlr4CompileAddFilesGenerated"
|
|
||||||
DependsOnTargets="$(Antlr4CompileAddFilesGeneratedDependsOn)"
|
|
||||||
Condition="'@(Antlr4)' != ''">
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Antlr4GeneratedCodeFiles Condition="'@(Antlr4GeneratedCodeFiles)' == ''" Include="@(Antlr4OutputCodeFilesList)" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<FileWrites Include="@(Antlr4GeneratedCodeFiles);
|
|
||||||
$(IntermediateOutputPath)$(Antlr4GenCodeFileNames);" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="@(Antlr4GeneratedCodeFiles)" />
|
|
||||||
<!-- The WinFX "GenerateTemporaryTargetAssembly" target requires generated code files be added here. -->
|
|
||||||
<_GeneratedCodeFiles Include="@(Antlr4GeneratedCodeFiles)" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Target>
|
|
||||||
</Project>
|
|
|
@ -1,9 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<!-- Folder containing Antlr4BuildTasks.net40.dll -->
|
|
||||||
<Antlr4BuildTaskPath>.</Antlr4BuildTaskPath>
|
|
||||||
<!-- Path to the ANTLR tool itself -->
|
|
||||||
<Antlr4ToolPath>..\tools\antlr4-csharp-4.4.1-SNAPSHOT-complete.jar</Antlr4ToolPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
|
|
@ -1,182 +0,0 @@
|
||||||
<!--
|
|
||||||
[The "BSD licence"]
|
|
||||||
Copyright (c) 2013 Sam Harwell
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions
|
|
||||||
are met:
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer.
|
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer in the
|
|
||||||
documentation and/or other materials provided with the distribution.
|
|
||||||
3. The name of the author may not be used to endorse or promote products
|
|
||||||
derived from this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
||||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
||||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
||||||
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
||||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
||||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
||||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
-->
|
|
||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<BuildSystem>MSBuild</BuildSystem>
|
|
||||||
<TaskVersion>4.0.0.0</TaskVersion>
|
|
||||||
<TaskKeyToken>eb42632606e9261f</TaskKeyToken>
|
|
||||||
<Antlr4BuildTaskAssemblyName Condition="'$(Antlr4BuildTaskAssemblyName)'==''">Antlr4BuildTasks.net40, Version=$(TaskVersion), Culture=neutral, PublicKeyToken=$(TaskKeyToken)</Antlr4BuildTaskAssemblyName>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<LoadTimeSensitiveTargets>
|
|
||||||
$(LoadTimeSensitiveTargets);
|
|
||||||
Antlr4Compile;
|
|
||||||
</LoadTimeSensitiveTargets>
|
|
||||||
<LoadTimeSensitiveProperties>
|
|
||||||
$(LoadTimeSensitiveProperties);
|
|
||||||
Antlr4CompileDependsOn;
|
|
||||||
</LoadTimeSensitiveProperties>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<Antlr4BuildTaskLocation Condition="'$(Antlr4BuildTaskPath)'==''">$(MSBuildBinPath)</Antlr4BuildTaskLocation>
|
|
||||||
<Antlr4BuildTaskLocation Condition="'$(Antlr4BuildTaskPath)'!=''">$(Antlr4BuildTaskPath)</Antlr4BuildTaskLocation>
|
|
||||||
<Antlr4ToolLocation Condition="'$(Antlr4ToolPath)'==''">$(MSBuildBinPath)\Antlr4\antlr4-csharp-4.4.1-SNAPSHOT-complete.jar</Antlr4ToolLocation>
|
|
||||||
<Antlr4ToolLocation Condition="'$(Antlr4ToolPath)'!=''">$(Antlr4ToolPath)</Antlr4ToolLocation>
|
|
||||||
|
|
||||||
<Antlr4JavaVendor Condition="'$(Antlr4JavaVendor)'==''">JavaSoft</Antlr4JavaVendor>
|
|
||||||
<Antlr4JavaInstallation Condition="'$(Antlr4JavaInstallation)'==''">Java Runtime Environment</Antlr4JavaInstallation>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<Antlr4GenCodeFileNames Condition="'$(Antlr4GenCodeFileNames)'==''">$(MSBuildProjectFile).Antlr4GeneratedCodeFileListAbsolute.txt</Antlr4GenCodeFileNames>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<UsingTask Condition="'$(Antlr4BuildTaskPath)'==''" TaskName="Antlr4.Build.Tasks.Antlr4ClassGenerationTask" AssemblyName="$(Antlr4BuildTaskAssemblyName)" />
|
|
||||||
<UsingTask Condition="'$(Antlr4BuildTaskPath)'!=''" TaskName="Antlr4.Build.Tasks.Antlr4ClassGenerationTask" AssemblyFile="$(Antlr4BuildTaskPath)\Antlr4BuildTasks.net40.dll" />
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<PrepareResourcesDependsOn>
|
|
||||||
Antlr4Compile;
|
|
||||||
Antlr4CompileAddFilesGenerated;
|
|
||||||
$(PrepareResourcesDependsOn)
|
|
||||||
</PrepareResourcesDependsOn>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<Antlr4CompileDependsOn>
|
|
||||||
Antlr4CompileReadGeneratedFileList
|
|
||||||
</Antlr4CompileDependsOn>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup Condition="'$(BuildingInsideVisualStudio)'=='true'">
|
|
||||||
<AvailableItemName Include="Antlr4" />
|
|
||||||
<AvailableItemName Include="Antlr4Tokens" />
|
|
||||||
<AvailableItemName Include="Antlr4AbstractGrammar" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemDefinitionGroup>
|
|
||||||
<Antlr4>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<CustomToolNamespace>$(RootNamespace)</CustomToolNamespace>
|
|
||||||
<TargetLanguage>CSharp</TargetLanguage>
|
|
||||||
<Listener>true</Listener>
|
|
||||||
<Visitor>true</Visitor>
|
|
||||||
<Abstract>false</Abstract>
|
|
||||||
<ForceAtn>false</ForceAtn>
|
|
||||||
</Antlr4>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
|
|
||||||
<Target Name="Antlr4CompileReadGeneratedFileList">
|
|
||||||
<ReadLinesFromFile File="$(IntermediateOutputPath)$(Antlr4GenCodeFileNames)">
|
|
||||||
<Output TaskParameter="Lines" ItemName="Antlr4OutputCodeFilesList"/>
|
|
||||||
</ReadLinesFromFile>
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<!-- Add grammar compilation to the CoreCompileDependsOn so that the IDE inproc compilers (particularly VB)
|
|
||||||
can "see" the generated source files. -->
|
|
||||||
<CoreCompileDependsOn Condition="'$(BuildingInsideVisualStudio)' == 'true' ">
|
|
||||||
Antlr4DesignTimeGrammarCompilation;
|
|
||||||
$(CoreCompileDependsOn)
|
|
||||||
</CoreCompileDependsOn>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<Target Name="Antlr4DesignTimeGrammarCompilation">
|
|
||||||
<!-- Only if we are not actually performing a compile i.e. we are in design mode -->
|
|
||||||
<CallTarget Condition="'$(BuildingProject)' != 'true'"
|
|
||||||
Targets="Antlr4Compile" />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<Target Name="Antlr4Compile"
|
|
||||||
DependsOnTargets="$(Antlr4CompileDependsOn)"
|
|
||||||
Condition="'@(Antlr4)' != ''"
|
|
||||||
Inputs="@(Antlr4);@(Antlr4Tokens);@(Antlr4AbstractGrammar)"
|
|
||||||
Outputs="@(Antlr4OutputCodeFilesList);
|
|
||||||
$(IntermediateOutputPath)$(Antlr4GenCodeFileNames);">
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Antlr4GeneratedCodeFiles Remove="@(Antlr4GeneratedCodeFiles)" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<_IntellisenseOnlyCompile>false</_IntellisenseOnlyCompile>
|
|
||||||
<_IntellisenseOnlyCompile Condition="'$(BuildingProject)' != 'true'">true</_IntellisenseOnlyCompile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Antlr4ClassGenerationTask
|
|
||||||
ToolPath="$(Antlr4ToolLocation)"
|
|
||||||
JavaVendor="$(Antlr4JavaVendor)"
|
|
||||||
JavaInstallation="$(Antlr4JavaInstallation)"
|
|
||||||
JavaExecutable="$(Antlr4JavaExecutable)"
|
|
||||||
BuildTaskPath="$(Antlr4BuildTaskLocation)"
|
|
||||||
OutputPath="$(IntermediateOutputPath)"
|
|
||||||
TargetLanguage="%(Antlr4.TargetLanguage)"
|
|
||||||
TargetFrameworkVersion="$(TargetFrameworkVersion)"
|
|
||||||
TargetNamespace="%(Antlr4.CustomToolNamespace)"
|
|
||||||
SourceCodeFiles="@(Antlr4 -> '%(FullPath)')"
|
|
||||||
ContinueOnError="$(_IntellisenseOnlyCompile)"
|
|
||||||
TokensFiles="@(Antlr4Tokens)"
|
|
||||||
AbstractGrammarFiles="@(Antlr4AbstractGrammar)"
|
|
||||||
LanguageSourceExtensions="$(DefaultLanguageSourceExtension)"
|
|
||||||
GenerateListener="%(Antlr4.Listener)"
|
|
||||||
GenerateVisitor="%(Antlr4.Visitor)"
|
|
||||||
ForceAtn="%(Antlr4.ForceAtn)"
|
|
||||||
AbstractGrammar="%(Antlr4.Abstract)">
|
|
||||||
|
|
||||||
<Output ItemName="Antlr4GeneratedCodeFiles" TaskParameter="GeneratedCodeFiles" />
|
|
||||||
</Antlr4ClassGenerationTask>
|
|
||||||
|
|
||||||
<WriteLinesToFile
|
|
||||||
Condition="'$(_IntellisenseOnlyCompile)' != 'true'"
|
|
||||||
File="$(IntermediateOutputPath)$(Antlr4GenCodeFileNames)"
|
|
||||||
Lines="@(Antlr4GeneratedCodeFiles)"
|
|
||||||
Overwrite="true"/>
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<Target Name="Antlr4CompileAddFilesGenerated"
|
|
||||||
AfterTargets="Antlr4Compile"
|
|
||||||
Condition="'@(Antlr4)' != ''">
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Antlr4GeneratedCodeFiles Condition="'@(Antlr4GeneratedCodeFiles)' == ''" Include="@(Antlr4OutputCodeFilesList)" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<FileWrites Include="@(Antlr4GeneratedCodeFiles);
|
|
||||||
$(IntermediateOutputPath)$(Antlr4GenCodeFileNames);" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="@(Antlr4GeneratedCodeFiles)" />
|
|
||||||
<!-- The WinFX "GenerateTemporaryTargetAssembly" target requires generated code files be added here. -->
|
|
||||||
<_GeneratedCodeFiles Include="@(Antlr4GeneratedCodeFiles)" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Target>
|
|
||||||
</Project>
|
|
|
@ -1,83 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{0D3D20E9-3341-4449-80E7-76A4534F0E55}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>Antlr4.Build.Tasks</RootNamespace>
|
|
||||||
<AssemblyName>Antlr4BuildTasks.net35</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<BaseIntermediateOutputPath>obj\net35\</BaseIntermediateOutputPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\net35\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE;NET35;NET35PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<CodeAnalysisRuleSet>ExtendedDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\net35\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE;NET35;NET35PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<SignAssembly>true</SignAssembly>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<AssemblyOriginatorKeyFile>..\..\..\..\..\..\keys\antlr\Key.snk</AssemblyOriginatorKeyFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.Build.Framework" />
|
|
||||||
<Reference Include="Microsoft.Build.Tasks.v3.5" />
|
|
||||||
<Reference Include="Microsoft.Build.Utilities.v3.5" />
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Core" />
|
|
||||||
<Reference Include="System.Xml.Linq" />
|
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="Antlr4ClassGenerationTask.cs" />
|
|
||||||
<Compile Include="Antlr4ClassGenerationTaskInternal.cs" />
|
|
||||||
<Compile Include="BuildMessage.cs" />
|
|
||||||
<Compile Include="GlobalSuppressions.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="Antlr4.net35.props">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="Antlr4.net35.targets">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</None>
|
|
||||||
<None Include="..\..\..\..\..\..\keys\antlr\Key.snk">
|
|
||||||
<Link>Key.snk</Link>
|
|
||||||
</None>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<CodeAnalysisDictionary Include="..\build\CustomDictionary.xml">
|
|
||||||
<Link>CustomDictionary.xml</Link>
|
|
||||||
</CodeAnalysisDictionary>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
|
@ -1,84 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{F63DFE80-AE1F-47A6-A31A-E39DA4C837BA}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>Antlr4.Build.Tasks</RootNamespace>
|
|
||||||
<AssemblyName>Antlr4BuildTasks.net40</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<BaseIntermediateOutputPath>obj\net40\</BaseIntermediateOutputPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\net40\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE;NET40;NET40PLUS;NET35PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<CodeAnalysisRuleSet>ExtendedDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\net40\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE;NET40;NET40PLUS;NET35PLUS</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<SignAssembly>true</SignAssembly>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<AssemblyOriginatorKeyFile>..\..\..\..\..\..\keys\antlr\Key.snk</AssemblyOriginatorKeyFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.Build.Framework" />
|
|
||||||
<Reference Include="Microsoft.Build.Tasks.v4.0" />
|
|
||||||
<Reference Include="Microsoft.Build.Utilities.v4.0" />
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Core" />
|
|
||||||
<Reference Include="System.Xml.Linq" />
|
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
|
||||||
<Reference Include="Microsoft.CSharp" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="Antlr4ClassGenerationTask.cs" />
|
|
||||||
<Compile Include="Antlr4ClassGenerationTaskInternal.cs" />
|
|
||||||
<Compile Include="BuildMessage.cs" />
|
|
||||||
<Compile Include="GlobalSuppressions.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="Antlr4.net40.props">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="Antlr4.net40.targets">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</None>
|
|
||||||
<None Include="..\..\..\..\..\..\keys\antlr\Key.snk">
|
|
||||||
<Link>Key.snk</Link>
|
|
||||||
</None>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<CodeAnalysisDictionary Include="..\build\CustomDictionary.xml">
|
|
||||||
<Link>CustomDictionary.xml</Link>
|
|
||||||
</CodeAnalysisDictionary>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
|
@ -1,367 +0,0 @@
|
||||||
/*
|
|
||||||
* [The "BSD licence"]
|
|
||||||
* Copyright (c) 2013 Sam Harwell
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
||||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
||||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Antlr4.Build.Tasks
|
|
||||||
{
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Security;
|
|
||||||
using System.Security.Policy;
|
|
||||||
using System.Threading;
|
|
||||||
using Microsoft.Build.Framework;
|
|
||||||
using Microsoft.Build.Utilities;
|
|
||||||
using Directory = System.IO.Directory;
|
|
||||||
using File = System.IO.File;
|
|
||||||
using FileAttributes = System.IO.FileAttributes;
|
|
||||||
using Path = System.IO.Path;
|
|
||||||
|
|
||||||
public class Antlr4ClassGenerationTask
|
|
||||||
: Task
|
|
||||||
{
|
|
||||||
private static AppDomain _sharedAppDomain;
|
|
||||||
|
|
||||||
private const string DefaultGeneratedSourceExtension = "g4";
|
|
||||||
private List<ITaskItem> _generatedCodeFiles = new List<ITaskItem>();
|
|
||||||
|
|
||||||
public Antlr4ClassGenerationTask()
|
|
||||||
{
|
|
||||||
this.GeneratedSourceExtension = DefaultGeneratedSourceExtension;
|
|
||||||
}
|
|
||||||
|
|
||||||
[Required]
|
|
||||||
public string ToolPath
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
[Required]
|
|
||||||
public string OutputPath
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string TargetLanguage
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string TargetFrameworkVersion
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string BuildTaskPath
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ITaskItem[] SourceCodeFiles
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ITaskItem[] TokensFiles
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ITaskItem[] AbstractGrammarFiles
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string GeneratedSourceExtension
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string TargetNamespace
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string[] LanguageSourceExtensions
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool GenerateListener
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool GenerateVisitor
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool ForceAtn
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool AbstractGrammar
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
[Required]
|
|
||||||
public string JavaVendor
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
[Required]
|
|
||||||
public string JavaInstallation
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string JavaExecutable
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
[Output]
|
|
||||||
public ITaskItem[] GeneratedCodeFiles
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this._generatedCodeFiles.ToArray();
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this._generatedCodeFiles = new List<ITaskItem>(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
|
|
||||||
public AppDomain GetAntlrTaskAppDomain()
|
|
||||||
{
|
|
||||||
if (_sharedAppDomain != null)
|
|
||||||
return _sharedAppDomain;
|
|
||||||
|
|
||||||
AppDomainSetup info = new AppDomainSetup
|
|
||||||
{
|
|
||||||
ApplicationBase = BuildTaskPath,
|
|
||||||
LoaderOptimization = LoaderOptimization.MultiDomainHost,
|
|
||||||
ShadowCopyFiles = "true"
|
|
||||||
};
|
|
||||||
|
|
||||||
string friendlyName = "AntlrClassGenerationDomain_" + Guid.NewGuid();
|
|
||||||
_sharedAppDomain = AppDomain.CreateDomain(friendlyName, AppDomain.CurrentDomain.Evidence, info, new NamedPermissionSet("FullTrust"), new StrongName[0]);
|
|
||||||
return _sharedAppDomain;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool Execute()
|
|
||||||
{
|
|
||||||
AppDomain domain = null;
|
|
||||||
bool success;
|
|
||||||
|
|
||||||
if (!Path.IsPathRooted(ToolPath))
|
|
||||||
ToolPath = Path.Combine(Path.GetDirectoryName(BuildEngine.ProjectFileOfTaskNode), ToolPath);
|
|
||||||
|
|
||||||
if (!Path.IsPathRooted(BuildTaskPath))
|
|
||||||
BuildTaskPath = Path.Combine(Path.GetDirectoryName(BuildEngine.ProjectFileOfTaskNode), BuildTaskPath);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
domain = GetAntlrTaskAppDomain();
|
|
||||||
AntlrClassGenerationTaskInternal wrapper = CreateBuildTaskWrapper(domain);
|
|
||||||
success = wrapper.Execute();
|
|
||||||
|
|
||||||
if (success)
|
|
||||||
{
|
|
||||||
_generatedCodeFiles.AddRange(wrapper.GeneratedCodeFiles.Select(file => (ITaskItem)new TaskItem(file)));
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (BuildMessage message in wrapper.BuildMessages)
|
|
||||||
{
|
|
||||||
ProcessBuildMessage(message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception exception)
|
|
||||||
{
|
|
||||||
if (IsFatalException(exception))
|
|
||||||
throw;
|
|
||||||
|
|
||||||
ProcessExceptionAsBuildMessage(exception);
|
|
||||||
success = false;
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
if (domain != null && domain != _sharedAppDomain)
|
|
||||||
AppDomain.Unload(domain);
|
|
||||||
}
|
|
||||||
|
|
||||||
return success;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ProcessExceptionAsBuildMessage(Exception exception)
|
|
||||||
{
|
|
||||||
ProcessBuildMessage(new BuildMessage(exception.Message));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ProcessBuildMessage(BuildMessage message)
|
|
||||||
{
|
|
||||||
string logMessage;
|
|
||||||
string errorCode;
|
|
||||||
errorCode = Log.ExtractMessageCode(message.Message, out logMessage);
|
|
||||||
if (string.IsNullOrEmpty(errorCode))
|
|
||||||
{
|
|
||||||
errorCode = "AC1000";
|
|
||||||
logMessage = "Unknown build error: " + message.Message;
|
|
||||||
}
|
|
||||||
|
|
||||||
string subcategory = null;
|
|
||||||
string helpKeyword = null;
|
|
||||||
|
|
||||||
switch (message.Severity)
|
|
||||||
{
|
|
||||||
case TraceLevel.Error:
|
|
||||||
this.Log.LogError(subcategory, errorCode, helpKeyword, message.FileName, message.LineNumber, message.ColumnNumber, 0, 0, logMessage);
|
|
||||||
break;
|
|
||||||
case TraceLevel.Warning:
|
|
||||||
this.Log.LogWarning(subcategory, errorCode, helpKeyword, message.FileName, message.LineNumber, message.ColumnNumber, 0, 0, logMessage);
|
|
||||||
break;
|
|
||||||
case TraceLevel.Info:
|
|
||||||
this.Log.LogMessage(MessageImportance.Normal, logMessage);
|
|
||||||
break;
|
|
||||||
case TraceLevel.Verbose:
|
|
||||||
this.Log.LogMessage(MessageImportance.Low, logMessage);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private AntlrClassGenerationTaskInternal CreateBuildTaskWrapper(AppDomain domain)
|
|
||||||
{
|
|
||||||
AntlrClassGenerationTaskInternal wrapper = (AntlrClassGenerationTaskInternal)domain.CreateInstanceAndUnwrap(Assembly.GetExecutingAssembly().FullName, typeof(AntlrClassGenerationTaskInternal).FullName);
|
|
||||||
|
|
||||||
IList<string> sourceCodeFiles = null;
|
|
||||||
if (this.SourceCodeFiles != null)
|
|
||||||
{
|
|
||||||
sourceCodeFiles = new List<string>(SourceCodeFiles.Length);
|
|
||||||
foreach (ITaskItem taskItem in SourceCodeFiles)
|
|
||||||
sourceCodeFiles.Add(taskItem.ItemSpec);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.TokensFiles != null && this.TokensFiles.Length > 0)
|
|
||||||
{
|
|
||||||
Directory.CreateDirectory(OutputPath);
|
|
||||||
|
|
||||||
HashSet<string> copied = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
|
||||||
foreach (ITaskItem taskItem in TokensFiles)
|
|
||||||
{
|
|
||||||
string fileName = taskItem.ItemSpec;
|
|
||||||
if (!File.Exists(fileName))
|
|
||||||
{
|
|
||||||
Log.LogError("The tokens file '{0}' does not exist.", fileName);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
string vocabName = Path.GetFileNameWithoutExtension(fileName);
|
|
||||||
if (!copied.Add(vocabName))
|
|
||||||
{
|
|
||||||
Log.LogWarning("The tokens file '{0}' conflicts with another tokens file in the same project.", fileName);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
string target = Path.Combine(OutputPath, Path.GetFileName(fileName));
|
|
||||||
if (!Path.GetExtension(target).Equals(".tokens", StringComparison.OrdinalIgnoreCase))
|
|
||||||
{
|
|
||||||
Log.LogError("The destination for the tokens file '{0}' did not have the correct extension '.tokens'.", target);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
File.Copy(fileName, target, true);
|
|
||||||
File.SetAttributes(target, File.GetAttributes(target) & ~FileAttributes.ReadOnly);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
wrapper.ToolPath = ToolPath;
|
|
||||||
wrapper.SourceCodeFiles = sourceCodeFiles;
|
|
||||||
wrapper.TargetLanguage = TargetLanguage;
|
|
||||||
wrapper.TargetFrameworkVersion = TargetFrameworkVersion;
|
|
||||||
wrapper.OutputPath = OutputPath;
|
|
||||||
wrapper.LanguageSourceExtensions = LanguageSourceExtensions;
|
|
||||||
wrapper.TargetNamespace = TargetNamespace;
|
|
||||||
wrapper.GenerateListener = GenerateListener;
|
|
||||||
wrapper.GenerateVisitor = GenerateVisitor;
|
|
||||||
wrapper.ForceAtn = ForceAtn;
|
|
||||||
wrapper.AbstractGrammar = AbstractGrammar;
|
|
||||||
wrapper.JavaVendor = JavaVendor;
|
|
||||||
wrapper.JavaInstallation = JavaInstallation;
|
|
||||||
wrapper.JavaExecutable = JavaExecutable;
|
|
||||||
return wrapper;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static bool IsFatalException(Exception exception)
|
|
||||||
{
|
|
||||||
while (exception != null)
|
|
||||||
{
|
|
||||||
if ((exception is OutOfMemoryException)
|
|
||||||
|| (exception is InsufficientMemoryException)
|
|
||||||
|| (exception is ThreadAbortException))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(exception is TypeInitializationException) && !(exception is TargetInvocationException))
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
exception = exception.InnerException;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,428 +0,0 @@
|
||||||
/*
|
|
||||||
* [The "BSD licence"]
|
|
||||||
* Copyright (c) 2013 Sam Harwell
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
||||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
||||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Antlr4.Build.Tasks
|
|
||||||
{
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using RegistryHive = Microsoft.Win32.RegistryHive;
|
|
||||||
using RegistryKey = Microsoft.Win32.RegistryKey;
|
|
||||||
#if NET40PLUS
|
|
||||||
using RegistryView = Microsoft.Win32.RegistryView;
|
|
||||||
#else
|
|
||||||
using Registry = Microsoft.Win32.Registry;
|
|
||||||
#endif
|
|
||||||
using StringBuilder = System.Text.StringBuilder;
|
|
||||||
|
|
||||||
internal class AntlrClassGenerationTaskInternal : MarshalByRefObject
|
|
||||||
{
|
|
||||||
private List<string> _generatedCodeFiles = new List<string>();
|
|
||||||
private IList<string> _sourceCodeFiles = new List<string>();
|
|
||||||
private List<BuildMessage> _buildMessages = new List<BuildMessage>();
|
|
||||||
|
|
||||||
public IList<string> GeneratedCodeFiles
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this._generatedCodeFiles;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string ToolPath
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string TargetLanguage
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string TargetFrameworkVersion
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string OutputPath
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string TargetNamespace
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string[] LanguageSourceExtensions
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool GenerateListener
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool GenerateVisitor
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool ForceAtn
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool AbstractGrammar
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string JavaVendor
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string JavaInstallation
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string JavaExecutable
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IList<string> SourceCodeFiles
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this._sourceCodeFiles;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this._sourceCodeFiles = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public IList<BuildMessage> BuildMessages
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _buildMessages;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#if NET40PLUS
|
|
||||||
private string JavaHome
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
string javaHome;
|
|
||||||
if (TryGetJavaHome(RegistryView.Default, JavaVendor, JavaInstallation, out javaHome))
|
|
||||||
return javaHome;
|
|
||||||
|
|
||||||
if (TryGetJavaHome(RegistryView.Registry64, JavaVendor, JavaInstallation, out javaHome))
|
|
||||||
return javaHome;
|
|
||||||
|
|
||||||
if (TryGetJavaHome(RegistryView.Registry32, JavaVendor, JavaInstallation, out javaHome))
|
|
||||||
return javaHome;
|
|
||||||
|
|
||||||
throw new NotSupportedException("Could not locate a Java installation.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static bool TryGetJavaHome(RegistryView registryView, string vendor, string installation, out string javaHome)
|
|
||||||
{
|
|
||||||
javaHome = null;
|
|
||||||
|
|
||||||
string javaKeyName = "SOFTWARE\\" + vendor + "\\" + installation;
|
|
||||||
using (var baseKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, registryView))
|
|
||||||
{
|
|
||||||
using (RegistryKey javaKey = baseKey.OpenSubKey(javaKeyName))
|
|
||||||
{
|
|
||||||
if (javaKey == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
object currentVersion = javaKey.GetValue("CurrentVersion");
|
|
||||||
if (currentVersion == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
using (var homeKey = javaKey.OpenSubKey(currentVersion.ToString()))
|
|
||||||
{
|
|
||||||
if (homeKey == null || homeKey.GetValue("JavaHome") == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
javaHome = homeKey.GetValue("JavaHome").ToString();
|
|
||||||
return !string.IsNullOrEmpty(javaHome);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
private string JavaHome
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
string javaHome;
|
|
||||||
if (TryGetJavaHome(Registry.LocalMachine, JavaVendor, JavaInstallation, out javaHome))
|
|
||||||
return javaHome;
|
|
||||||
|
|
||||||
throw new NotSupportedException("Could not locate a Java installation.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static bool TryGetJavaHome(RegistryKey baseKey, string vendor, string installation, out string javaHome)
|
|
||||||
{
|
|
||||||
javaHome = null;
|
|
||||||
|
|
||||||
string javaKeyName = "SOFTWARE\\" + vendor + "\\" + installation;
|
|
||||||
using (RegistryKey javaKey = baseKey.OpenSubKey(javaKeyName))
|
|
||||||
{
|
|
||||||
if (javaKey == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
object currentVersion = javaKey.GetValue("CurrentVersion");
|
|
||||||
if (currentVersion == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
using (var homeKey = javaKey.OpenSubKey(currentVersion.ToString()))
|
|
||||||
{
|
|
||||||
if (homeKey == null || homeKey.GetValue("JavaHome") == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
javaHome = homeKey.GetValue("JavaHome").ToString();
|
|
||||||
return !string.IsNullOrEmpty(javaHome);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public bool Execute()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
string java;
|
|
||||||
if (!string.IsNullOrEmpty(JavaExecutable))
|
|
||||||
{
|
|
||||||
java = JavaExecutable;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
string javaHome = JavaHome;
|
|
||||||
java = Path.Combine(Path.Combine(javaHome, "bin"), "java.exe");
|
|
||||||
}
|
|
||||||
|
|
||||||
List<string> arguments = new List<string>();
|
|
||||||
arguments.Add("-cp");
|
|
||||||
arguments.Add(ToolPath);
|
|
||||||
arguments.Add("org.antlr.v4.CSharpTool");
|
|
||||||
|
|
||||||
arguments.Add("-o");
|
|
||||||
arguments.Add(OutputPath);
|
|
||||||
|
|
||||||
if (GenerateListener)
|
|
||||||
arguments.Add("-listener");
|
|
||||||
else
|
|
||||||
arguments.Add("-no-listener");
|
|
||||||
|
|
||||||
if (GenerateVisitor)
|
|
||||||
arguments.Add("-visitor");
|
|
||||||
else
|
|
||||||
arguments.Add("-no-visitor");
|
|
||||||
|
|
||||||
if (ForceAtn)
|
|
||||||
arguments.Add("-Xforce-atn");
|
|
||||||
|
|
||||||
if (AbstractGrammar)
|
|
||||||
arguments.Add("-Dabstract=true");
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(TargetLanguage))
|
|
||||||
{
|
|
||||||
string framework = TargetFrameworkVersion;
|
|
||||||
if (string.IsNullOrEmpty(framework))
|
|
||||||
framework = "v2.0";
|
|
||||||
if (framework.StartsWith("v4.5."))
|
|
||||||
framework = "v4.5";
|
|
||||||
|
|
||||||
string language;
|
|
||||||
if (TargetLanguage.Equals("CSharp", StringComparison.OrdinalIgnoreCase))
|
|
||||||
language = TargetLanguage + '_' + framework.Replace('.', '_');
|
|
||||||
else
|
|
||||||
language = TargetLanguage;
|
|
||||||
|
|
||||||
arguments.Add("-Dlanguage=" + language);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(TargetNamespace))
|
|
||||||
{
|
|
||||||
arguments.Add("-package");
|
|
||||||
arguments.Add(TargetNamespace);
|
|
||||||
}
|
|
||||||
|
|
||||||
arguments.AddRange(SourceCodeFiles);
|
|
||||||
|
|
||||||
ProcessStartInfo startInfo = new ProcessStartInfo(java, JoinArguments(arguments))
|
|
||||||
{
|
|
||||||
UseShellExecute = false,
|
|
||||||
CreateNoWindow = true,
|
|
||||||
RedirectStandardInput = true,
|
|
||||||
RedirectStandardOutput = true,
|
|
||||||
RedirectStandardError = true,
|
|
||||||
};
|
|
||||||
|
|
||||||
this.BuildMessages.Add(new BuildMessage(TraceLevel.Info, "Executing command: \"" + startInfo.FileName + "\" " + startInfo.Arguments, "", 0, 0));
|
|
||||||
|
|
||||||
Process process = new Process();
|
|
||||||
process.StartInfo = startInfo;
|
|
||||||
process.ErrorDataReceived += HandleErrorDataReceived;
|
|
||||||
process.OutputDataReceived += HandleOutputDataReceived;
|
|
||||||
process.Start();
|
|
||||||
process.BeginErrorReadLine();
|
|
||||||
process.BeginOutputReadLine();
|
|
||||||
process.StandardInput.Close();
|
|
||||||
process.WaitForExit();
|
|
||||||
|
|
||||||
return process.ExitCode == 0;
|
|
||||||
//using (LoggingTraceListener traceListener = new LoggingTraceListener(_buildMessages))
|
|
||||||
//{
|
|
||||||
// SetTraceListener(traceListener);
|
|
||||||
// ProcessArgs(args.ToArray());
|
|
||||||
// process();
|
|
||||||
//}
|
|
||||||
|
|
||||||
//_generatedCodeFiles.AddRange(GetGeneratedFiles().Where(file => LanguageSourceExtensions.Contains(Path.GetExtension(file), StringComparer.OrdinalIgnoreCase)));
|
|
||||||
|
|
||||||
//int errorCount = GetNumErrors();
|
|
||||||
//return errorCount == 0;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
if (e is TargetInvocationException && e.InnerException != null)
|
|
||||||
e = e.InnerException;
|
|
||||||
|
|
||||||
_buildMessages.Add(new BuildMessage(e.Message));
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string JoinArguments(IEnumerable<string> arguments)
|
|
||||||
{
|
|
||||||
if (arguments == null)
|
|
||||||
throw new ArgumentNullException("arguments");
|
|
||||||
|
|
||||||
StringBuilder builder = new StringBuilder();
|
|
||||||
foreach (string argument in arguments)
|
|
||||||
{
|
|
||||||
if (builder.Length > 0)
|
|
||||||
builder.Append(' ');
|
|
||||||
|
|
||||||
if (argument.IndexOfAny(new[] { '"', ' ' }) < 0)
|
|
||||||
{
|
|
||||||
builder.Append(argument);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// escape a backslash appearing before a quote
|
|
||||||
string arg = argument.Replace("\\\"", "\\\\\"");
|
|
||||||
// escape double quotes
|
|
||||||
arg = arg.Replace("\"", "\\\"");
|
|
||||||
|
|
||||||
// wrap the argument in outer quotes
|
|
||||||
builder.Append('"').Append(arg).Append('"');
|
|
||||||
}
|
|
||||||
|
|
||||||
return builder.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static readonly Regex GeneratedFileMessageFormat = new Regex(@"^Generating file '(?<OUTPUT>.*?)' for grammar '(?<GRAMMAR>.*?)'$", RegexOptions.Compiled);
|
|
||||||
|
|
||||||
private void HandleErrorDataReceived(object sender, DataReceivedEventArgs e)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(e.Data))
|
|
||||||
return;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
_buildMessages.Add(new BuildMessage(e.Data));
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
if (Antlr4ClassGenerationTask.IsFatalException(ex))
|
|
||||||
throw;
|
|
||||||
|
|
||||||
_buildMessages.Add(new BuildMessage(ex.Message));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void HandleOutputDataReceived(object sender, DataReceivedEventArgs e)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(e.Data))
|
|
||||||
return;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Match match = GeneratedFileMessageFormat.Match(e.Data);
|
|
||||||
if (!match.Success)
|
|
||||||
{
|
|
||||||
_buildMessages.Add(new BuildMessage(e.Data));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
string fileName = match.Groups["OUTPUT"].Value;
|
|
||||||
if (LanguageSourceExtensions.Contains(Path.GetExtension(fileName), StringComparer.OrdinalIgnoreCase))
|
|
||||||
GeneratedCodeFiles.Add(match.Groups["OUTPUT"].Value);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
if (Antlr4ClassGenerationTask.IsFatalException(ex))
|
|
||||||
throw;
|
|
||||||
|
|
||||||
_buildMessages.Add(new BuildMessage(ex.Message));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,120 +0,0 @@
|
||||||
/*
|
|
||||||
* [The "BSD licence"]
|
|
||||||
* Copyright (c) 2013 Sam Harwell
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
||||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
||||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Antlr4.Build.Tasks
|
|
||||||
{
|
|
||||||
using System;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
|
|
||||||
[Serializable]
|
|
||||||
internal struct BuildMessage
|
|
||||||
{
|
|
||||||
private static readonly Regex BuildMessageFormat = new Regex(@"^\s*(?<SEVERITY>[a-z]+)\((?<CODE>[0-9]+)\):\s*((?<FILE>.*):(?<LINE>[0-9]+):(?<COLUMN>[0-9]+):)?\s*(?:syntax error:\s*)?(?<MESSAGE>.*)$", RegexOptions.Compiled);
|
|
||||||
|
|
||||||
public BuildMessage(string message)
|
|
||||||
: this(TraceLevel.Error, message, null, 0, 0)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Match match = BuildMessageFormat.Match(message);
|
|
||||||
if (match.Success)
|
|
||||||
{
|
|
||||||
FileName = match.Groups["FILE"].Length > 0 ? match.Groups["FILE"].Value : "";
|
|
||||||
LineNumber = match.Groups["LINE"].Length > 0 ? int.Parse(match.Groups["LINE"].Value) : 0;
|
|
||||||
ColumnNumber = match.Groups["COLUMN"].Length > 0 ? int.Parse(match.Groups["COLUMN"].Value) + 1 : 0;
|
|
||||||
|
|
||||||
switch (match.Groups["SEVERITY"].Value)
|
|
||||||
{
|
|
||||||
case "warning":
|
|
||||||
Severity = TraceLevel.Warning;
|
|
||||||
break;
|
|
||||||
case "error":
|
|
||||||
Severity = TraceLevel.Error;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Severity = TraceLevel.Info;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
int code = int.Parse(match.Groups["CODE"].Value);
|
|
||||||
Message = string.Format("AC{0:0000}: {1}", code, match.Groups["MESSAGE"].Value);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Message = message;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
if (Antlr4ClassGenerationTask.IsFatalException(ex))
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public BuildMessage(TraceLevel severity, string message, string fileName, int lineNumber, int columnNumber)
|
|
||||||
: this()
|
|
||||||
{
|
|
||||||
Severity = severity;
|
|
||||||
Message = message;
|
|
||||||
FileName = fileName;
|
|
||||||
LineNumber = lineNumber;
|
|
||||||
ColumnNumber = columnNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TraceLevel Severity
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Message
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string FileName
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int LineNumber
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int ColumnNumber
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Binary file not shown.
|
@ -1,75 +0,0 @@
|
||||||
/*
|
|
||||||
* [The "BSD license"]
|
|
||||||
* Copyright (c) 2013 Terence Parr
|
|
||||||
* Copyright (c) 2013 Sam Harwell
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
||||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
||||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
|
||||||
// set of attributes. Change these attribute values to modify the information
|
|
||||||
// associated with an assembly.
|
|
||||||
#if NET40
|
|
||||||
[assembly: AssemblyTitle("Antlr4BuildTasks.net40")]
|
|
||||||
[assembly: AssemblyProduct("Antlr4BuildTasks.net40")]
|
|
||||||
#elif NET35
|
|
||||||
[assembly: AssemblyTitle("Antlr4BuildTasks.net35")]
|
|
||||||
[assembly: AssemblyProduct("Antlr4BuildTasks.net35")]
|
|
||||||
#else
|
|
||||||
#error Unknown assembly.
|
|
||||||
#endif
|
|
||||||
[assembly: AssemblyDescription("")]
|
|
||||||
[assembly: AssemblyConfiguration("")]
|
|
||||||
[assembly: AssemblyCompany("Tunnel Vision Laboratories, LLC")]
|
|
||||||
[assembly: AssemblyCopyright("Copyright © Sam Harwell 2014")]
|
|
||||||
[assembly: AssemblyTrademark("")]
|
|
||||||
[assembly: AssemblyCulture("")]
|
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
|
||||||
// to COM components. If you need to access a type in this assembly from
|
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
|
||||||
[assembly: ComVisible(false)]
|
|
||||||
[assembly: CLSCompliant(false)]
|
|
||||||
|
|
||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|
||||||
[assembly: Guid("e79060d9-d211-4367-925a-5541943d3857")]
|
|
||||||
|
|
||||||
// Version information for an assembly consists of the following four values:
|
|
||||||
//
|
|
||||||
// Major Version
|
|
||||||
// Minor Version
|
|
||||||
// Build Number
|
|
||||||
// Revision
|
|
||||||
//
|
|
||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
|
||||||
// by using the '*' as shown below:
|
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
|
||||||
[assembly: AssemblyVersion("4.4.0.0")]
|
|
||||||
[assembly: AssemblyFileVersion("4.4.1.0")]
|
|
||||||
[assembly: AssemblyInformationalVersion("4.4.1-dev")]
|
|
|
@ -1,57 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
|
||||||
<xs:element name="Dictionary">
|
|
||||||
<xs:complexType>
|
|
||||||
<xs:sequence>
|
|
||||||
<xs:element name="Words" minOccurs="0">
|
|
||||||
<xs:complexType>
|
|
||||||
<xs:sequence>
|
|
||||||
<xs:element name="Unrecognized" minOccurs="0">
|
|
||||||
<xs:complexType>
|
|
||||||
<xs:sequence>
|
|
||||||
<xs:element maxOccurs="unbounded" name="Word" type="xs:string" />
|
|
||||||
</xs:sequence>
|
|
||||||
</xs:complexType>
|
|
||||||
</xs:element>
|
|
||||||
<xs:element name="Recognized" minOccurs="0">
|
|
||||||
<xs:complexType>
|
|
||||||
<xs:sequence>
|
|
||||||
<xs:element maxOccurs="unbounded" name="Word" type="xs:string" />
|
|
||||||
</xs:sequence>
|
|
||||||
</xs:complexType>
|
|
||||||
</xs:element>
|
|
||||||
<xs:element name="Deprecated" minOccurs="0">
|
|
||||||
<xs:complexType>
|
|
||||||
<xs:sequence>
|
|
||||||
<xs:element name="Term" maxOccurs="unbounded">
|
|
||||||
<xs:complexType>
|
|
||||||
<xs:simpleContent>
|
|
||||||
<xs:extension base="xs:string">
|
|
||||||
<xs:attribute name="PreferredAlternate" type="xs:string" use="required" />
|
|
||||||
</xs:extension>
|
|
||||||
</xs:simpleContent>
|
|
||||||
</xs:complexType>
|
|
||||||
</xs:element>
|
|
||||||
</xs:sequence>
|
|
||||||
</xs:complexType>
|
|
||||||
</xs:element>
|
|
||||||
</xs:sequence>
|
|
||||||
</xs:complexType>
|
|
||||||
</xs:element>
|
|
||||||
<xs:element name="Acronyms" minOccurs="0">
|
|
||||||
<xs:complexType>
|
|
||||||
<xs:sequence>
|
|
||||||
<xs:element name="CasingExceptions">
|
|
||||||
<xs:complexType>
|
|
||||||
<xs:sequence>
|
|
||||||
<xs:element name="Acronym" type="xs:string" maxOccurs="unbounded" />
|
|
||||||
</xs:sequence>
|
|
||||||
</xs:complexType>
|
|
||||||
</xs:element>
|
|
||||||
</xs:sequence>
|
|
||||||
</xs:complexType>
|
|
||||||
</xs:element>
|
|
||||||
</xs:sequence>
|
|
||||||
</xs:complexType>
|
|
||||||
</xs:element>
|
|
||||||
</xs:schema>
|
|
|
@ -1,9 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<Dictionary>
|
|
||||||
<Words>
|
|
||||||
<Recognized>
|
|
||||||
<Word>Antlr</Word>
|
|
||||||
<Word>Atn</Word>
|
|
||||||
</Recognized>
|
|
||||||
</Words>
|
|
||||||
</Dictionary>
|
|
|
@ -1,18 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
Copyright (c) Rackspace, US Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
|
|
||||||
-->
|
|
||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
|
|
||||||
<Target Name="EnsureAssemblySigningKeyPresent"
|
|
||||||
Condition="('$(SignAssembly)' == 'true') And ('$(AssemblyOriginatorKeyFile)' != '')"
|
|
||||||
BeforeTargets="CoreCompile">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>This project references a strong name key that is missing on this computer. Run 'sn -k {0}' to generate the file.</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists($([System.IO.Path]::Combine('$(MSBuildProjectDirectory)', '$(AssemblyOriginatorKeyFile)')))"
|
|
||||||
Text="$([System.String]::Format('$(ErrorText)', '$([System.IO.Path]::GetFullPath('$([System.IO.Path]::Combine('$(MSBuildProjectDirectory)', '$(AssemblyOriginatorKeyFile)'))'))'))" />
|
|
||||||
|
|
||||||
</Target>
|
|
||||||
</Project>
|
|
|
@ -30,20 +30,15 @@
|
||||||
<Reference Include="System"/>
|
<Reference Include="System"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="TBaseListener.cs"/>
|
|
||||||
<Compile Include="TBaseVisitor.cs"/>
|
|
||||||
<Compile Include="AssemblyInfo.cs"/>
|
<Compile Include="AssemblyInfo.cs"/>
|
||||||
<Compile Include="TListener.cs"/>
|
|
||||||
<Compile Include="Test.cs"/>
|
<Compile Include="Test.cs"/>
|
||||||
<Compile Include="TVisitor.cs"/>
|
<Compile Include="L.cs"/>
|
||||||
<Compile Include="TParser.cs"/>
|
|
||||||
<Compile Include="TLexer.cs"/>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets"/>
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets"/>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="\users\ericvergnaud\Development\antlr4\antlr\antlr4-csharp\runtime\CSharp\Antlr4.Runtime\Antlr4.Runtime.mono.csproj">
|
<ProjectReference Include="Antlr4.Runtime.vs2013.csproj">
|
||||||
<Project>{E1A46D9D-66CB-46E8-93B0-7FC87299ABEF}</Project>
|
<Project>{E1A46D9D-66CB-46E8-93B0-7FC87299ABEF}</Project>
|
||||||
<Name>Antlr4.Runtime.mono</Name>
|
<Name>Antlr4.Runtime.vs2013</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
|
@ -421,13 +421,18 @@ public abstract class BaseTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String locateMSBuild() {
|
private String locateMSBuild() {
|
||||||
return locateTool("xbuild");
|
if(isWindows())
|
||||||
|
return "\"C:\\Program Files (x86)\\MSBuild\\12.0\\Bin\\MSBuild.exe\"";
|
||||||
|
else
|
||||||
|
return locateTool("xbuild");
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isWindows() {
|
||||||
|
return System.getProperty("os.name").toLowerCase().contains("windows");
|
||||||
}
|
}
|
||||||
|
|
||||||
private String locateExec() {
|
private String locateExec() {
|
||||||
return locateTool("mono");
|
return new File(tmpdir, "bin/Release/Test.exe").getAbsolutePath();
|
||||||
// new File(tmpdir, "bin/Release/Test.exe").getAbsolutePath(),
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String locateTool(String tool) {
|
private String locateTool(String tool) {
|
||||||
|
@ -451,17 +456,19 @@ public abstract class BaseTest {
|
||||||
output.close();
|
output.close();
|
||||||
input.close();
|
input.close();
|
||||||
// update project
|
// update project
|
||||||
input = Thread.currentThread().getContextClassLoader().getResourceAsStream(pack + "Antlr4.Test.mono.csproj");
|
String projectName = isWindows() ? "Antlr4.Test.vs2013.csproj" : "Antlr4.Test.mono.csproj";
|
||||||
|
input = Thread.currentThread().getContextClassLoader().getResourceAsStream(pack + projectName);
|
||||||
Document prjXml = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(input);
|
Document prjXml = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(input);
|
||||||
// update runtime project reference
|
// update runtime project reference
|
||||||
String runtimePath = System.getProperty("antlr-csharp-runtime-project");
|
String runtimePath = System.getProperty("antlr-csharp-runtime-project");
|
||||||
|
String runtimeName = isWindows() ? "Antlr4.Runtime.vs2013.csproj" : "Antlr4.Runtime.mono.csproj";
|
||||||
if(runtimePath==null)
|
if(runtimePath==null)
|
||||||
runtimePath = "../../antlr4-csharp/runtime/CSharp/Antlr4.Runtime/Antlr4.Runtime.mono.csproj";
|
runtimePath = "../../antlr4-csharp/runtime/CSharp/Antlr4.Runtime/" + runtimeName;
|
||||||
File projFile = new File(runtimePath);
|
File projFile = new File(runtimePath);
|
||||||
if(!projFile.exists())
|
if(!projFile.exists())
|
||||||
throw new RuntimeException("C# runtime project file not found at:" + projFile.getAbsolutePath());
|
throw new RuntimeException("C# runtime project file not found at:" + projFile.getAbsolutePath());
|
||||||
runtimePath = projFile.getAbsolutePath();
|
runtimePath = projFile.getAbsolutePath();
|
||||||
XPathExpression exp = XPathFactory.newInstance().newXPath().compile("/Project/ItemGroup/ProjectReference[@Include='Antlr4.Runtime.mono.csproj']");
|
XPathExpression exp = XPathFactory.newInstance().newXPath().compile("/Project/ItemGroup/ProjectReference[@Include='" + runtimeName + "']");
|
||||||
Element node = (Element)exp.evaluate(prjXml, XPathConstants.NODE);
|
Element node = (Element)exp.evaluate(prjXml, XPathConstants.NODE);
|
||||||
node.setAttribute("Include", runtimePath.replace("/", "\\"));
|
node.setAttribute("Include", runtimePath.replace("/", "\\"));
|
||||||
// update project file list
|
// update project file list
|
||||||
|
@ -494,11 +501,9 @@ public abstract class BaseTest {
|
||||||
public String execTest() {
|
public String execTest() {
|
||||||
try {
|
try {
|
||||||
String exec = locateExec();
|
String exec = locateExec();
|
||||||
String[] args = new String[] {
|
String[] args = isWindows() ?
|
||||||
exec,
|
new String[] { exec, new File(tmpdir, "input").getAbsolutePath() } :
|
||||||
new File(tmpdir, "bin/Release/Test.exe").getAbsolutePath(),
|
new String[] { "mono", exec, new File(tmpdir, "input").getAbsolutePath() };
|
||||||
new File(tmpdir, "input").getAbsolutePath()
|
|
||||||
};
|
|
||||||
ProcessBuilder pb = new ProcessBuilder(args);
|
ProcessBuilder pb = new ProcessBuilder(args);
|
||||||
pb.directory(new File(tmpdir));
|
pb.directory(new File(tmpdir));
|
||||||
Process p = pb.start();
|
Process p = pb.start();
|
||||||
|
|
Loading…
Reference in New Issue