port from perforce

This commit is contained in:
2026-04-18 22:31:51 +02:00
commit 8d0ab5b7cc
8409 changed files with 3972376 additions and 0 deletions

22
hgplus/ShaderMinifier/.gitattributes vendored Normal file
View File

@@ -0,0 +1,22 @@
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

163
hgplus/ShaderMinifier/.gitignore vendored Normal file
View File

@@ -0,0 +1,163 @@
#################
## Eclipse
#################
*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# PDT-specific
.buildpath
#################
## Visual Studio
#################
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Rr]elease/
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.vspscc
.builds
*.dotCover
## TODO: If you have NuGet Package Restore enabled, uncomment this
#packages/
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
# Visual Studio profiler
*.psess
*.vsp
# ReSharper is a .NET coding add-in
_ReSharper*
# Installshield output folder
[Ee]xpress
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish
# Others
[Bb]in
[Oo]bj
sql
TestResults
*.Cache
ClientBin
stylecop.*
~$*
*.dbmdl
Generated_Code #added for RIA/Silverlight projects
# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
############
## Windows
############
# Windows image file caches
Thumbs.db
# Folder config file
Desktop.ini
#############
## Python
#############
*.py[co]
# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
#Translations
*.mo
#Mr Developer
.mr.developer.cfg
# Mac crap
.DS_Store

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="2.0.0.0" newVersion="4.4.0.0" />
<bindingRedirect oldVersion="2.3.5.0" newVersion="4.4.0.0" />
<bindingRedirect oldVersion="4.0.0.0" newVersion="4.4.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -0,0 +1,56 @@
Shader Minifier
===============
Shader Minifier is a tool that minifies and obfuscates shader code (GLSL
and HLSL). It's mainly target at demosceners, for writing 4k and 64k
intros.
This is the initial source release. The code compiles
with F# 2.0 and Visual Studio 2010, and has not been tested with other
versions.
The code is a bit messy, and mostly undocumented. Sorry about that. I
wanted to release it anyway by popular demand. I'll try to clean it, but
feel free to contact me if you have any question.
Slightly outdated user manual:
http://www.ctrl-alt-test.fr/?page_id=7
Some technical details
----------------------
If I remember correctly, I patched FParsec.dll as it didn't work properly
on Mono because of a bug in Mono (https://bugzilla.novell.com/show_bug.cgi?id=474154).
Because of a bug in F#, I'm targeting .NET 3.5 instead of .NET 4.0. The
bug happens when using at the same time F# powerpack and the --standalone flag.
Those bugs make the release process is a bit messy. I haven't checked
recently, so some of the bugs might have been fixed. For reference, I'll
give the exact command-lines I use (paths have to be updated).
For Windows, I compile with --standalone, targeting .NET 3.5:
"c:\Program Files (x86)\Microsoft F#\v4.0\fsc.exe" -o shader_minifier.exe --debug:pdbonly --noframework --define:TRACE --optimize+ -r:D:\Laurent\cat\glsl_minifier\FParsec.dll -r:D:\Laurent\cat\glsl_minifier\FParsecCS.dll -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\2.0\Runtime\v2.0\FSharp.Core.dll" -r:D:\Laurent\cat\glsl_minifier\bin\Release\FSharp.PowerPack.dll -r:C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" -r:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll --target:exe --warn:3 --warnaserror:76 --LCID:1033 --utf8output --fullpaths --flaterrors --standalone ast.fs printer.fs cGen.fs renamer.fs rewriter.fs parse.fs main.fs
For Linux, I use a newer version of FParsec that I patched manually (some
functions in FParsec have changed, which means I need a different parse.fs
source file too). This newer FParsec version requires .NET 4.0, which is
why I cannot use --standalone and have to ship the dll files separately.
rem "c:\Program Files (x86)\Microsoft F#\v4.0\fsc.exe" -o shader_minifier.exe --debug:pdbonly --noframework --define:TRACE --optimize+ -r:D:\Laurent\cat\glsl_minifier\FParsec.new.dll -r:D:\Laurent\cat\glsl_minifier\FParsecCS.new.dll -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\2.0\Runtime\v4.0\FSharp.Core.dll" -r:D:\Laurent\cat\glsl_minifier\bin\Release\FSharp.PowerPack.dll -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" --target:exe --warn:3 --warnaserror:76 --vserrors --LCID:1033 --utf8output --fullpaths --flaterrors "C:\Users\laurent\AppData\Local\Temp\.NETFramework,Version=v4.0.AssemblyAttributes.fs" ast.fs printer.fs cGen.fs renamer.fs rewriter.fs parse.new.fs main.fs
It would be nice to have a simpler way to release stuff.
Laurent Le Brun, aka LLB from Ctrl-Alt-Test.
http://laurent.le-brun.eu
http://ctrl-alt-test.fr

View File

@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{059c6af3-1877-4698-be34-bf7eb55d060a}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>glsl_minifier</RootNamespace>
<AssemblyName>shader_minifier</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<Name>Shader Minifier</Name>
<TargetFrameworkProfile />
<TargetFSharpCoreVersion>4.3.0.0</TargetFSharpCoreVersion>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<Tailcalls>false</Tailcalls>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<StartArguments>--hlsl -v -o E:\alcatraz\aquarium\src\intro\framework\codegen\intro_hlsl.h E:\alcatraz\aquarium\src\intro\framework\codegen\merged.hlsl --no-renaming</StartArguments>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<StartArguments>--smoothstep ../../test.in</StartArguments>
<OtherFlags>--standalone</OtherFlags>
</PropertyGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '11.0'">
<PropertyGroup>
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</Otherwise>
</Choose>
<Import Project="$(FSharpTargetsPath)" Condition="Exists('$(FSharpTargetsPath)')" />
<ItemGroup>
<Compile Include="src\ast.fs" />
<Compile Include="src\printer.fs" />
<Compile Include="src\cGen.fs" />
<Compile Include="src\renamer.fs" />
<Compile Include="src\rewriter.fs" />
<Compile Include="src\parse.fs" />
<Compile Include="src\main.fs" />
<None Include="App.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<Content Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Reference Include="FParsec">
<HintPath>packages\FParsec-Big-Data-Edition.1.0.3\lib\net40-client\FParsec.dll</HintPath>
</Reference>
<Reference Include="FParsecCS">
<HintPath>packages\FParsec-Big-Data-Edition.1.0.3\lib\net40-client\FParsecCS.dll</HintPath>
</Reference>
<Reference Include="FSharp.Core">
<HintPath>packages\FSharp.Core.4.0.0.1\lib\net40\FSharp.Core.dll</HintPath>
</Reference>
<Reference Include="FSharp.PowerPack">
<HintPath>packages\FSPowerPack.Core.Community.2.0.0.0\lib\Net40\FSharp.PowerPack.dll</HintPath>
</Reference>
<Reference Include="FSharp.PowerPack.Linq">
<HintPath>packages\FSPowerPack.Linq.Community.2.0.0.0\lib\Net40\FSharp.PowerPack.Linq.dll</HintPath>
</Reference>
<Reference Include="FSharp.PowerPack.Metadata">
<HintPath>packages\FSPowerPack.Metadata.Community.2.0.0.0\lib\Net40\FSharp.PowerPack.Metadata.dll</HintPath>
</Reference>
<Reference Include="FSharp.PowerPack.Parallel.Seq">
<HintPath>packages\FSPowerPack.Parallel.Seq.Community.2.0.0.0\lib\Net40\FSharp.PowerPack.Parallel.Seq.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
</ItemGroup>
<!-- 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>

View File

@@ -0,0 +1,22 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Shader Minifier", "Shader Minifier.fsproj", "{059C6AF3-1877-4698-BE34-BF7EB55D060A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{059C6AF3-1877-4698-BE34-BF7EB55D060A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{059C6AF3-1877-4698-BE34-BF7EB55D060A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{059C6AF3-1877-4698-BE34-BF7EB55D060A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{059C6AF3-1877-4698-BE34-BF7EB55D060A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,16 @@
* Get a proper test suite. Seriously.
* Update to F# 3.0 (not tried, maybe it already works).
* Update to FParsec 1.0. This requires a couple of easy changes in
parse.fs.
* Simplify the release process. Ideally, we should get a single .exe file
that works both on Microsoft .NET and on Mono.
* Some antivirus (eg. Avast) don't like Shader Minifier. No idea why.
* Performance. I suspect that using StringBuffer in the printer would
drastically improve performance.
* All the bug reports I've received. I should do some triaging.

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FParsec-Big-Data-Edition" version="1.0.3" targetFramework="net40" />
<package id="FSharp.Core" version="4.0.0.1" targetFramework="net40" />
<package id="FSPowerPack.Community" version="3.0.0.0" targetFramework="net40" />
<package id="FSPowerPack.Core.Community" version="2.0.0.0" targetFramework="net40" />
<package id="FSPowerPack.Linq.Community" version="2.0.0.0" targetFramework="net40" />
<package id="FSPowerPack.Metadata.Community" version="2.0.0.0" targetFramework="net40" />
<package id="FSPowerPack.Parallel.Seq.Community" version="2.0.0.0" targetFramework="net40" />
</packages>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>FParsec-Big-Data-Edition</id>
<version>1.0.1</version>
<title>FParsec (Big Data Edition)</title>
<authors>Stephan Tolksdorf</authors>
<owners>Stephan Tolksdorf</owners>
<licenseUrl>http://www.quanttec.com/fparsec/license.html</licenseUrl>
<projectUrl>http://www.quanttec.com/fparsec/</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>FParsec is a parser combinator library for F#.
You can find comprehensive documentation for FParsec at http://www.quanttec.com/fparsec. The documentation includes a feature list, a tutorial, a users guide and an API reference.
This package uses a configuration of FParsec that supports very large input streams and is optimized for maximum performance in longer running processes. See www.quanttec.com/fparsec/download-and-installation.html for more information.</description>
<releaseNotes>See http://www.quanttec.com/fparsec/about/changelog.html</releaseNotes>
<copyright>Copyright © 2013 Stephan Tolksdorf</copyright>
<language />
<tags>parser combinator f# fsharp c# csharp</tags>
</metadata>
</package>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,277 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>FParsecCS</name>
</assembly>
<members>
<member name="M:FParsec.Buffer.PositiveDistance(System.Char*,System.Char*)">
<summary>Calculates: end - begin. <br />
Precondition: 2^31 > end - begin >= 0.</summary>
</member>
<member name="M:FParsec.Buffer.PositiveDistance64(System.Char*,System.Char*)">
<summary>Calculates: end - begin. <br />
Precondition: end - begin >= 0.</summary>
</member>
<member name="M:FParsec.Buffer.Copy(System.Byte*,System.Byte*,System.Int32)">
<summary>Copies size bytes from src to dst. Correctly handles overlapped memory blocks.</summary>
</member>
<member name="T:FParsec.CharStreamIndexToken">
<summary>An opaque representation of a CharStream index.</summary>
</member>
<member name="P:FParsec.CharStreamIndexToken.Block">
<summary>Returns -1 if the IndexToken was zero-initialized.</summary>
</member>
<member name="T:FParsec.CharStream">
<summary>Provides readaccess to a sequence of UTF16 chars.</summary>
</member>
<member name="F:FParsec.CharStream.Ptr">
<summary>Points to the current char in Buffer,
or is null if the end of the stream has been reached.</summary>
</member>
<member name="F:FParsec.CharStream.PtrBegin">
<summary>Equals Ptr == null ? null : BufferBegin.</summary>
</member>
<member name="F:FParsec.CharStream.PtrEnd">
<summary>Equals Ptr == null ? null : BufferEnd.</summary>
</member>
<member name="F:FParsec.CharStream.BufferBegin">
<summary>Begin of the used part of the char buffer. Is constant. Is null if the CharStream is empty.</summary>
</member>
<member name="F:FParsec.CharStream.BufferEnd">
<summary>End of the used part of the char buffer. Varies for a multi-block stream. Is null if the CharStream is empty.</summary>
</member>
<member name="F:FParsec.CharStream.Block">
<summary>The block currently loaded in the buffer.</summary>
</member>
<member name="F:FParsec.CharStream.StateTag">
<summary>Any CharStream method or property setter increments this value when it changes the CharStream state.
Backtracking to an old state also restores the old value of the StateTag.</summary>
</member>
<member name="F:FParsec.CharStream.BufferString">
<summary>The string holding the char buffer, or null if the buffer is not part of a .NET string.</summary>
</member>
<member name="F:FParsec.CharStream.BufferStringPointer">
<summary>A pointer to the beginning of BufferString, or null if BufferString is null.</summary>
</member>
<member name="F:FParsec.CharStream.BufferHandle">
<summary>Holds the GCHandle for CharStreams directly constructed from strings or char arrays.</summary>
</member>
<member name="F:FParsec.CharStream.StringBuffer">
<summary>Holds the StringBuffer for CharStreams constructed from a binary stream.</summary>
</member>
<member name="F:FParsec.CharStream.DoNotRoundUpBlockSizeToSimplifyTesting">
<summary>we modify this flag via reflection in the unit test</summary>
</member>
<member name="M:FParsec.CharStream.Seek(System.Int64)">
<summary>Returns an iterator pointing to the given index in the stream,
or to the end of the stream if the indexed position lies beyond the last char in the stream.</summary>
<exception cref="T:System.ArgumentOutOfRangeException">The index is negative or less than the BeginIndex.</exception>
<exception cref="T:System.NotSupportedException">Accessing the char with the given index requires seeking in the underlying byte stream, but the byte stream does not support seeking or the Encoding's Decoder is not serializable.</exception>
<exception cref="T:System.IO.IOException">An I/O error occured.</exception>
<exception cref="T:System.ArgumentException">The input stream contains invalid bytes and the encoding was constructed with the throwOnInvalidBytes option.</exception>
<exception cref="T:System.Text.DecoderFallbackException">The input stream contains invalid bytes for which the decoder fallback threw this exception.</exception>
<exception cref="T:System.OutOfMemoryException">Can not allocate enough memory for the internal data structure.</exception>
<exception cref="T:System.ObjectDisposedException">Method is called after the stream was disposed.</exception>
</member>
<member name="P:FParsec.CharStream.IndexOfFirstChar">
<summary>The index of the first char in the stream.</summary>
</member>
<member name="P:FParsec.CharStream.Line">
<summary>The line number for the next char. (The line count starts with 1.)</summary>
</member>
<member name="P:FParsec.CharStream.LineBegin">
<summary>The stream index of the first char of the line that also contains the next char.</summary>
</member>
<member name="P:FParsec.CharStream.Column">
<summary>The UTF16 column number of the next char, i.e. Index LineBegin + 1.</summary>
</member>
<member name="P:FParsec.CharStream.Encoding">
<summary>The Encoding that is used for decoding the underlying byte stream, or
System.Text.UnicodeEncoding in case the stream was directly constructed
from a string or char buffer.</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.ByteIndex">
<summary>the byte stream index of the first char in the block after the OverhangCharsAtBlockBegin</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.ByteBufferIndex">
<summary>the value of the CharStream's ByteBufferIndex before the block is read</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.NumberOfBytesInOverlap">
<summary>the number of bytes in the stream from ByteIndex to the first char after the OverhangCharsAfterOverlap</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.LastCharInOverlap">
<summary>the last char in the overlap with the previous block (used for integrity checking)</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.OverhangCharsAtBlockBegin">
<summary>chars at the block begin that were already read together with chars of the last block before the overlap</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.OverhangCharsAfterOverlap">
<summary>chars after the overlap with the previous block that were already read together with the overlap chars</summary>
</member>
<member name="T:FParsec.CharStream.MultiBlockData">
<summary>Contains the data and methods needed in case the input byte stream
is large enough to span multiple blocks of the CharStream.</summary>
</member>
<member name="F:FParsec.CharStream.MultiBlockData.LastBlock">
<summary>The index of the last block of the stream, or Int32.MaxValue if the end of stream has not yet been detected.</summary>
</member>
<member name="F:FParsec.CharStream.MultiBlockData.RegexSpaceThreshold">
<summary>BufferBegin + BlockSize - minRegexSpace</summary>
</member>
<member name="M:FParsec.CharStream.MultiBlockData.FillByteBuffer">
<summary>Refills the ByteBuffer if no unused byte is remaining.
Returns the number of unused bytes in the (refilled) ByteBuffer.</summary>
</member>
<member name="M:FParsec.CharStream.MultiBlockData.ClearAndRefillByteBuffer(System.Int32)">
<summary>Refills the ByteBuffer starting at the given index. If the underlying byte
stream contains enough bytes, the ByteBuffer is filled up to the ByteBuffer.Length.
Returns the number of bytes available for consumption in the refilled ByteBuffer.</summary>
</member>
<member name="M:FParsec.CharStream.MultiBlockData.ReadCharsFromStream(System.Char*,System.Int32,System.String@)">
<summary>Reads up to the given maximum number of chars into the given buffer.
If more than the maximum number of chars have to be read from the stream in order to
fill the buffer (due to the way the Decoder API works), the overhang chars are
returned through the output parameter.
Returns a pointer to one char after the last char read.</summary>
</member>
<member name="M:FParsec.CharStream.MultiBlockData.ReadBlock(System.Int32)">
<summary> Reads a block of chars (which must be different from the current block)
into the BufferString. If the current CharStream block is block - 1, this method
seeks the CharStream to the first char after the overlap of the two blocks.
Otherwise it seeks the CharStream to the first char in the block. It returns the
CharStream.Ptr value at the new position (which can be null).</summary>
</member>
<member name="P:FParsec.CharStream.MultiBlockData.ByteIndex">
<summary>The byte stream index of the first unused byte in the ByteBuffer.</summary>
</member>
<member name="T:FParsec.CharStream`1">
<summary>Provides readaccess to a sequence of UTF16 chars.</summary>
</member>
<member name="T:FParsec.Cloning.CloneImage">
<summary>Contains the serialized state of on object.</summary>
</member>
<member name="M:FParsec.Cloning.CloneImage.CreateClone">
<summary>Deserializes the object state into a new object.</summary>
</member>
<member name="M:FParsec.Cloning.Cloner.Create(System.Type)">
<summary>Returns a cloner for the given <em>run-time</em> type.</summary>
<param name="type">The run-time type of the objects to clone. The type must be serializable.</param>
</member>
<member name="M:FParsec.Cloning.Cloner.Clone(System.Object)">
<summary>Copies the given object using the serialization API.</summary>
<param name="instance">The object to clone. instance.GetType() must equal the Type the Cloner was created for.</param>
</member>
<member name="M:FParsec.Cloning.Cloner.CaptureImage(System.Object)">
<summary>Returns an image of the given object instance.</summary>
<param name="instance">The object to capture an image of.</param>
</member>
<member name="M:FParsec.Cloning.Cloner.GetSerializedFields(System.Type,System.Boolean@)">
<summary>Returns the public and non-public fields of the type (and its base types),
except fields with the NonSerialized attribute. In the returned array fields from
derived types come before fields from base types.</summary>
</member>
<member name="M:FParsec.Cloning.Cloner.FindStronglyConnectedComponents(FParsec.Cloning.Cloner.State[])">
<summary>Fills the Strongly StronglyConnectedComponent fields of the
states passed in the array. Returns an array mapping each state to an
integer component identifier.
</summary>
<param name="states">The object states to traverse. The object with array index
0 is ignored. All other objects are assumed to be reachable from the object
with array index 1.</param>
</member>
<member name="M:FParsec.Cloning.Cloner.ComputeTopologicalOrder(FParsec.Cloning.Cloner.State[])">
<summary>Returns an array with the topologically sorted indices of the states.
In the returned array the indices of states belonging to the same strongly
connected component are adjacent (but the order within a strongly connected
component is undefined).
</summary>
<param name="states">The object states to traverse. The object with array index
0 is ignored. All other objects are assumed to be reachable from the object
with array index 1.</param>
</member>
<member name="F:FParsec.Cloning.Cloner.State.EventHandlers">
<summary>May be null.</summary>
</member>
<member name="F:FParsec.Cloning.Cloner.State.ObjectIndices">
<summary>Indices of nested objects in the object graph. May be null.</summary>
</member>
<member name="F:FParsec.Cloning.Cloner.State.StronglyConnectedComponent">
<summary>May be null.</summary>
</member>
<member name="M:FParsec.FastGenericEqualityERComparer`1.Equals(`0,`0)">
<summary>For reference types it's faster to call Instance.Equals directly
(due to limitations of the inliner of the .NET JIT.)</summary>
</member>
<member name="T:FParsec.FastGenericEqualityERComparer.ArrayStructuralEqualityERComparer`1">
<summary>Forwards all work to F#'s GenericEqualityERComparer.</summary>
</member>
<member name="M:FParsec.IdentifierValidator.ValidateAndNormalize(System.String,System.Int32@)">
<summary>Returns the normalized string, or null in case an invalid identifier
character is found. If an invalid character is found, the string index of the
invalid character is assigned to the out parameter, otherwise -1.</summary>
</member>
<member name="F:FParsec.OperatorPrecedenceParser`3.OpsArrayLength">
<summary>The length of LhsOps and RhsOps. Must be a power of 2.</summary>
</member>
<member name="F:FParsec.OperatorPrecedenceParser`3.ErrorOp">
<summary>ParsePrefixOp returns this value to signal that it backtracked and we should try to parse a term.</summary>
</member>
<member name="F:FParsec.OperatorPrecedenceParser`3.ZeroPrecedenceOperatorData">
<summary>Can not be readonly because it is passed as as a ref (for performance reasons), but it is never mutated.</summary>
</member>
<member name="M:FParsec.OperatorPrecedenceParser`3.ParsePrefixOp(FParsec.OperatorPrecedenceParser{`0,`1,`2}.OperatorData@,FParsec.Operator{`0,`1,`2},FParsec.Reply{`0}@,FParsec.CharStream{`2})">
<summary>Parses the following prefix operators, plus the expression the operators apply to.</summary>
</member>
<member name="M:FParsec.OperatorPrecedenceParser`3.ParseExpressionContinue(FParsec.OperatorPrecedenceParser{`0,`1,`2}.OperatorData@,FParsec.Operator{`0,`1,`2},FParsec.Reply{`0}@,FParsec.CharStream{`2})">
<summary>Parses (higher-precedence) infix and postfix operators after the first term, together with the argument expressions.</summary>
</member>
<member name="T:FParsec.StringBuffer">
<summary>A substring of a pinned string on the large object heap.
StringBuffers are cached in a pool and hence need to be properly disposed.</summary>
</member>
<member name="F:FParsec.StringBuffer.Allocated">
<summary>Sum of the lengths of all currently allocated StringBuffers</summary>
</member>
<member name="F:FParsec.StringBuffer.PoolSegment.Last">
<summary>the last allocated segment</summary>
</member>
<member name="P:FParsec.StringBuffer.PoolSegment.Size">
<summary>String.Length - x, where x > 0</summary>
</member>
<member name="M:FParsec.Text.DetectPreamble(System.Byte[],System.Int32,System.Text.Encoding@,System.Boolean)">
<summary>Detects the presence of an encoding preamble in the first count bytes of the byte buffer.
If detectEncoding is false, this function only searches for the preamble of the given default encoding,
otherwise also for any of the standard unicode byte order marks (UTF-8, UTF-16 LE/BE, UTF-32 LE/BE).
If an encoding different from the given default encoding is detected, the new encoding
is assigned to the encoding reference.
Returns the number of bytes in the detected preamble, or 0 if no preamble is detected.
</summary>
</member>
<member name="M:FParsec.Text.ReadAllRemainingCharsFromStream(System.Char*,System.Int32,System.Byte[],System.Int32,System.Int32,System.IO.Stream,System.Int64,System.Text.Decoder,System.Boolean)">
<summary>Reads all remaining chars into the given buffer. If the remaining stream
content holds more than the given maximum number of chars, an exception will be thrown.</summary>
</member>
<member name="M:FParsec.Text.FoldCase(System.String)">
<summary>Returns a case-folded copy of the string argument. All chars are mapped
using the (non-Turkic) 1-to-1 case folding mappings (v. 6.0) for Unicode code
points in the Basic Multilingual Plane, i.e. code points below 0x10000.
If the argument is null, null is returned.</summary>
</member>
<member name="M:FParsec.Text.NormalizeNewlines(System.String)">
<summary>Returns the given string with all occurrences of "\r\n" and "\r" replaced
by "\n". If the argument is null, null is returned.</summary>
</member>
<member name="M:FParsec.Text.CountTextElements(System.String)">
<summary>A faster implementation of System.Globalization.StringInfo(str).LengthInTextElements.</summary>
</member>
<member name="M:FParsec.Text.IsWhitespace(System.Char)">
<summary>A faster implementation of System.Char.IsWhiteSpace.</summary>
</member>
<member name="T:FParsec.UnmanagedMemoryPool">
<summary>
Allocates and keeps references to chunks of unmanaged memory that we
intend to keep around for the lifetime of the AppDomain.
</summary>
</member>
</members>
</doc>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,277 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>FParsecCS</name>
</assembly>
<members>
<member name="M:FParsec.Buffer.PositiveDistance(System.Char*,System.Char*)">
<summary>Calculates: end - begin. <br />
Precondition: 2^31 > end - begin >= 0.</summary>
</member>
<member name="M:FParsec.Buffer.PositiveDistance64(System.Char*,System.Char*)">
<summary>Calculates: end - begin. <br />
Precondition: end - begin >= 0.</summary>
</member>
<member name="M:FParsec.Buffer.Copy(System.Byte*,System.Byte*,System.Int32)">
<summary>Copies size bytes from src to dst. Correctly handles overlapped memory blocks.</summary>
</member>
<member name="T:FParsec.CharStreamIndexToken">
<summary>An opaque representation of a CharStream index.</summary>
</member>
<member name="P:FParsec.CharStreamIndexToken.Block">
<summary>Returns -1 if the IndexToken was zero-initialized.</summary>
</member>
<member name="T:FParsec.CharStream">
<summary>Provides readaccess to a sequence of UTF16 chars.</summary>
</member>
<member name="F:FParsec.CharStream.Ptr">
<summary>Points to the current char in Buffer,
or is null if the end of the stream has been reached.</summary>
</member>
<member name="F:FParsec.CharStream.PtrBegin">
<summary>Equals Ptr == null ? null : BufferBegin.</summary>
</member>
<member name="F:FParsec.CharStream.PtrEnd">
<summary>Equals Ptr == null ? null : BufferEnd.</summary>
</member>
<member name="F:FParsec.CharStream.BufferBegin">
<summary>Begin of the used part of the char buffer. Is constant. Is null if the CharStream is empty.</summary>
</member>
<member name="F:FParsec.CharStream.BufferEnd">
<summary>End of the used part of the char buffer. Varies for a multi-block stream. Is null if the CharStream is empty.</summary>
</member>
<member name="F:FParsec.CharStream.Block">
<summary>The block currently loaded in the buffer.</summary>
</member>
<member name="F:FParsec.CharStream.StateTag">
<summary>Any CharStream method or property setter increments this value when it changes the CharStream state.
Backtracking to an old state also restores the old value of the StateTag.</summary>
</member>
<member name="F:FParsec.CharStream.BufferString">
<summary>The string holding the char buffer, or null if the buffer is not part of a .NET string.</summary>
</member>
<member name="F:FParsec.CharStream.BufferStringPointer">
<summary>A pointer to the beginning of BufferString, or null if BufferString is null.</summary>
</member>
<member name="F:FParsec.CharStream.BufferHandle">
<summary>Holds the GCHandle for CharStreams directly constructed from strings or char arrays.</summary>
</member>
<member name="F:FParsec.CharStream.StringBuffer">
<summary>Holds the StringBuffer for CharStreams constructed from a binary stream.</summary>
</member>
<member name="F:FParsec.CharStream.DoNotRoundUpBlockSizeToSimplifyTesting">
<summary>we modify this flag via reflection in the unit test</summary>
</member>
<member name="M:FParsec.CharStream.Seek(System.Int64)">
<summary>Returns an iterator pointing to the given index in the stream,
or to the end of the stream if the indexed position lies beyond the last char in the stream.</summary>
<exception cref="T:System.ArgumentOutOfRangeException">The index is negative or less than the BeginIndex.</exception>
<exception cref="T:System.NotSupportedException">Accessing the char with the given index requires seeking in the underlying byte stream, but the byte stream does not support seeking or the Encoding's Decoder is not serializable.</exception>
<exception cref="T:System.IO.IOException">An I/O error occured.</exception>
<exception cref="T:System.ArgumentException">The input stream contains invalid bytes and the encoding was constructed with the throwOnInvalidBytes option.</exception>
<exception cref="T:System.Text.DecoderFallbackException">The input stream contains invalid bytes for which the decoder fallback threw this exception.</exception>
<exception cref="T:System.OutOfMemoryException">Can not allocate enough memory for the internal data structure.</exception>
<exception cref="T:System.ObjectDisposedException">Method is called after the stream was disposed.</exception>
</member>
<member name="P:FParsec.CharStream.IndexOfFirstChar">
<summary>The index of the first char in the stream.</summary>
</member>
<member name="P:FParsec.CharStream.Line">
<summary>The line number for the next char. (The line count starts with 1.)</summary>
</member>
<member name="P:FParsec.CharStream.LineBegin">
<summary>The stream index of the first char of the line that also contains the next char.</summary>
</member>
<member name="P:FParsec.CharStream.Column">
<summary>The UTF16 column number of the next char, i.e. Index LineBegin + 1.</summary>
</member>
<member name="P:FParsec.CharStream.Encoding">
<summary>The Encoding that is used for decoding the underlying byte stream, or
System.Text.UnicodeEncoding in case the stream was directly constructed
from a string or char buffer.</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.ByteIndex">
<summary>the byte stream index of the first char in the block after the OverhangCharsAtBlockBegin</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.ByteBufferIndex">
<summary>the value of the CharStream's ByteBufferIndex before the block is read</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.NumberOfBytesInOverlap">
<summary>the number of bytes in the stream from ByteIndex to the first char after the OverhangCharsAfterOverlap</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.LastCharInOverlap">
<summary>the last char in the overlap with the previous block (used for integrity checking)</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.OverhangCharsAtBlockBegin">
<summary>chars at the block begin that were already read together with chars of the last block before the overlap</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.OverhangCharsAfterOverlap">
<summary>chars after the overlap with the previous block that were already read together with the overlap chars</summary>
</member>
<member name="T:FParsec.CharStream.MultiBlockData">
<summary>Contains the data and methods needed in case the input byte stream
is large enough to span multiple blocks of the CharStream.</summary>
</member>
<member name="F:FParsec.CharStream.MultiBlockData.LastBlock">
<summary>The index of the last block of the stream, or Int32.MaxValue if the end of stream has not yet been detected.</summary>
</member>
<member name="F:FParsec.CharStream.MultiBlockData.RegexSpaceThreshold">
<summary>BufferBegin + BlockSize - minRegexSpace</summary>
</member>
<member name="M:FParsec.CharStream.MultiBlockData.FillByteBuffer">
<summary>Refills the ByteBuffer if no unused byte is remaining.
Returns the number of unused bytes in the (refilled) ByteBuffer.</summary>
</member>
<member name="M:FParsec.CharStream.MultiBlockData.ClearAndRefillByteBuffer(System.Int32)">
<summary>Refills the ByteBuffer starting at the given index. If the underlying byte
stream contains enough bytes, the ByteBuffer is filled up to the ByteBuffer.Length.
Returns the number of bytes available for consumption in the refilled ByteBuffer.</summary>
</member>
<member name="M:FParsec.CharStream.MultiBlockData.ReadCharsFromStream(System.Char*,System.Int32,System.String@)">
<summary>Reads up to the given maximum number of chars into the given buffer.
If more than the maximum number of chars have to be read from the stream in order to
fill the buffer (due to the way the Decoder API works), the overhang chars are
returned through the output parameter.
Returns a pointer to one char after the last char read.</summary>
</member>
<member name="M:FParsec.CharStream.MultiBlockData.ReadBlock(System.Int32)">
<summary> Reads a block of chars (which must be different from the current block)
into the BufferString. If the current CharStream block is block - 1, this method
seeks the CharStream to the first char after the overlap of the two blocks.
Otherwise it seeks the CharStream to the first char in the block. It returns the
CharStream.Ptr value at the new position (which can be null).</summary>
</member>
<member name="P:FParsec.CharStream.MultiBlockData.ByteIndex">
<summary>The byte stream index of the first unused byte in the ByteBuffer.</summary>
</member>
<member name="T:FParsec.CharStream`1">
<summary>Provides readaccess to a sequence of UTF16 chars.</summary>
</member>
<member name="T:FParsec.Cloning.CloneImage">
<summary>Contains the serialized state of on object.</summary>
</member>
<member name="M:FParsec.Cloning.CloneImage.CreateClone">
<summary>Deserializes the object state into a new object.</summary>
</member>
<member name="M:FParsec.Cloning.Cloner.Create(System.Type)">
<summary>Returns a cloner for the given <em>run-time</em> type.</summary>
<param name="type">The run-time type of the objects to clone. The type must be serializable.</param>
</member>
<member name="M:FParsec.Cloning.Cloner.Clone(System.Object)">
<summary>Copies the given object using the serialization API.</summary>
<param name="instance">The object to clone. instance.GetType() must equal the Type the Cloner was created for.</param>
</member>
<member name="M:FParsec.Cloning.Cloner.CaptureImage(System.Object)">
<summary>Returns an image of the given object instance.</summary>
<param name="instance">The object to capture an image of.</param>
</member>
<member name="M:FParsec.Cloning.Cloner.GetSerializedFields(System.Type,System.Boolean@)">
<summary>Returns the public and non-public fields of the type (and its base types),
except fields with the NonSerialized attribute. In the returned array fields from
derived types come before fields from base types.</summary>
</member>
<member name="M:FParsec.Cloning.Cloner.FindStronglyConnectedComponents(FParsec.Cloning.Cloner.State[])">
<summary>Fills the Strongly StronglyConnectedComponent fields of the
states passed in the array. Returns an array mapping each state to an
integer component identifier.
</summary>
<param name="states">The object states to traverse. The object with array index
0 is ignored. All other objects are assumed to be reachable from the object
with array index 1.</param>
</member>
<member name="M:FParsec.Cloning.Cloner.ComputeTopologicalOrder(FParsec.Cloning.Cloner.State[])">
<summary>Returns an array with the topologically sorted indices of the states.
In the returned array the indices of states belonging to the same strongly
connected component are adjacent (but the order within a strongly connected
component is undefined).
</summary>
<param name="states">The object states to traverse. The object with array index
0 is ignored. All other objects are assumed to be reachable from the object
with array index 1.</param>
</member>
<member name="F:FParsec.Cloning.Cloner.State.EventHandlers">
<summary>May be null.</summary>
</member>
<member name="F:FParsec.Cloning.Cloner.State.ObjectIndices">
<summary>Indices of nested objects in the object graph. May be null.</summary>
</member>
<member name="F:FParsec.Cloning.Cloner.State.StronglyConnectedComponent">
<summary>May be null.</summary>
</member>
<member name="M:FParsec.FastGenericEqualityERComparer`1.Equals(`0,`0)">
<summary>For reference types it's faster to call Instance.Equals directly
(due to limitations of the inliner of the .NET JIT.)</summary>
</member>
<member name="T:FParsec.FastGenericEqualityERComparer.ArrayStructuralEqualityERComparer`1">
<summary>Forwards all work to F#'s GenericEqualityERComparer.</summary>
</member>
<member name="M:FParsec.IdentifierValidator.ValidateAndNormalize(System.String,System.Int32@)">
<summary>Returns the normalized string, or null in case an invalid identifier
character is found. If an invalid character is found, the string index of the
invalid character is assigned to the out parameter, otherwise -1.</summary>
</member>
<member name="F:FParsec.OperatorPrecedenceParser`3.OpsArrayLength">
<summary>The length of LhsOps and RhsOps. Must be a power of 2.</summary>
</member>
<member name="F:FParsec.OperatorPrecedenceParser`3.ErrorOp">
<summary>ParsePrefixOp returns this value to signal that it backtracked and we should try to parse a term.</summary>
</member>
<member name="F:FParsec.OperatorPrecedenceParser`3.ZeroPrecedenceOperatorData">
<summary>Can not be readonly because it is passed as as a ref (for performance reasons), but it is never mutated.</summary>
</member>
<member name="M:FParsec.OperatorPrecedenceParser`3.ParsePrefixOp(FParsec.OperatorPrecedenceParser{`0,`1,`2}.OperatorData@,FParsec.Operator{`0,`1,`2},FParsec.Reply{`0}@,FParsec.CharStream{`2})">
<summary>Parses the following prefix operators, plus the expression the operators apply to.</summary>
</member>
<member name="M:FParsec.OperatorPrecedenceParser`3.ParseExpressionContinue(FParsec.OperatorPrecedenceParser{`0,`1,`2}.OperatorData@,FParsec.Operator{`0,`1,`2},FParsec.Reply{`0}@,FParsec.CharStream{`2})">
<summary>Parses (higher-precedence) infix and postfix operators after the first term, together with the argument expressions.</summary>
</member>
<member name="T:FParsec.StringBuffer">
<summary>A substring of a pinned string on the large object heap.
StringBuffers are cached in a pool and hence need to be properly disposed.</summary>
</member>
<member name="F:FParsec.StringBuffer.Allocated">
<summary>Sum of the lengths of all currently allocated StringBuffers</summary>
</member>
<member name="F:FParsec.StringBuffer.PoolSegment.Last">
<summary>the last allocated segment</summary>
</member>
<member name="P:FParsec.StringBuffer.PoolSegment.Size">
<summary>String.Length - x, where x > 0</summary>
</member>
<member name="M:FParsec.Text.DetectPreamble(System.Byte[],System.Int32,System.Text.Encoding@,System.Boolean)">
<summary>Detects the presence of an encoding preamble in the first count bytes of the byte buffer.
If detectEncoding is false, this function only searches for the preamble of the given default encoding,
otherwise also for any of the standard unicode byte order marks (UTF-8, UTF-16 LE/BE, UTF-32 LE/BE).
If an encoding different from the given default encoding is detected, the new encoding
is assigned to the encoding reference.
Returns the number of bytes in the detected preamble, or 0 if no preamble is detected.
</summary>
</member>
<member name="M:FParsec.Text.ReadAllRemainingCharsFromStream(System.Char*,System.Int32,System.Byte[],System.Int32,System.Int32,System.IO.Stream,System.Int64,System.Text.Decoder,System.Boolean)">
<summary>Reads all remaining chars into the given buffer. If the remaining stream
content holds more than the given maximum number of chars, an exception will be thrown.</summary>
</member>
<member name="M:FParsec.Text.FoldCase(System.String)">
<summary>Returns a case-folded copy of the string argument. All chars are mapped
using the (non-Turkic) 1-to-1 case folding mappings (v. 6.0) for Unicode code
points in the Basic Multilingual Plane, i.e. code points below 0x10000.
If the argument is null, null is returned.</summary>
</member>
<member name="M:FParsec.Text.NormalizeNewlines(System.String)">
<summary>Returns the given string with all occurrences of "\r\n" and "\r" replaced
by "\n". If the argument is null, null is returned.</summary>
</member>
<member name="M:FParsec.Text.CountTextElements(System.String)">
<summary>A faster implementation of System.Globalization.StringInfo(str).LengthInTextElements.</summary>
</member>
<member name="M:FParsec.Text.IsWhitespace(System.Char)">
<summary>A faster implementation of System.Char.IsWhiteSpace.</summary>
</member>
<member name="T:FParsec.UnmanagedMemoryPool">
<summary>
Allocates and keeps references to chunks of unmanaged memory that we
intend to keep around for the lifetime of the AppDomain.
</summary>
</member>
</members>
</doc>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,277 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>FParsecCS</name>
</assembly>
<members>
<member name="M:FParsec.Buffer.PositiveDistance(System.Char*,System.Char*)">
<summary>Calculates: end - begin. <br />
Precondition: 2^31 > end - begin >= 0.</summary>
</member>
<member name="M:FParsec.Buffer.PositiveDistance64(System.Char*,System.Char*)">
<summary>Calculates: end - begin. <br />
Precondition: end - begin >= 0.</summary>
</member>
<member name="M:FParsec.Buffer.Copy(System.Byte*,System.Byte*,System.Int32)">
<summary>Copies size bytes from src to dst. Correctly handles overlapped memory blocks.</summary>
</member>
<member name="T:FParsec.CharStreamIndexToken">
<summary>An opaque representation of a CharStream index.</summary>
</member>
<member name="P:FParsec.CharStreamIndexToken.Block">
<summary>Returns -1 if the IndexToken was zero-initialized.</summary>
</member>
<member name="T:FParsec.CharStream">
<summary>Provides readaccess to a sequence of UTF16 chars.</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.ByteIndex">
<summary>the byte stream index of the first char in the block after the OverhangCharsAtBlockBegin</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.ByteBufferIndex">
<summary>the value of the CharStream's ByteBufferIndex before the block is read</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.NumberOfBytesInOverlap">
<summary>the number of bytes in the stream from ByteIndex to the first char after the OverhangCharsAfterOverlap</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.LastCharInOverlap">
<summary>the last char in the overlap with the previous block (used for integrity checking)</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.OverhangCharsAtBlockBegin">
<summary>chars at the block begin that were already read together with chars of the last block before the overlap</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.OverhangCharsAfterOverlap">
<summary>chars after the overlap with the previous block that were already read together with the overlap chars</summary>
</member>
<member name="F:FParsec.CharStream.Ptr">
<summary>Points to the current char in Buffer,
or is null if the end of the stream has been reached.</summary>
</member>
<member name="F:FParsec.CharStream.PtrBegin">
<summary>Equals Ptr == null ? null : BufferBegin.</summary>
</member>
<member name="F:FParsec.CharStream.PtrEnd">
<summary>Equals Ptr == null ? null : BufferEnd.</summary>
</member>
<member name="F:FParsec.CharStream.BufferBegin">
<summary>Begin of the used part of the char buffer. Is constant. Is null if the CharStream is empty.</summary>
</member>
<member name="F:FParsec.CharStream.BufferEnd">
<summary>End of the used part of the char buffer. Varies for a multi-block stream. Is null if the CharStream is empty.</summary>
</member>
<member name="F:FParsec.CharStream.Block">
<summary>The block currently loaded in the buffer.</summary>
</member>
<member name="F:FParsec.CharStream.StateTag">
<summary>Any CharStream method or property setter increments this value when it changes the CharStream state.
Backtracking to an old state also restores the old value of the StateTag.</summary>
</member>
<member name="P:FParsec.CharStream.IndexOfFirstChar">
<summary>The index of the first char in the stream.</summary>
</member>
<member name="P:FParsec.CharStream.Line">
<summary>The line number for the next char. (The line count starts with 1.)</summary>
</member>
<member name="P:FParsec.CharStream.LineBegin">
<summary>The stream index of the first char of the line that also contains the next char.</summary>
</member>
<member name="P:FParsec.CharStream.Column">
<summary>The UTF16 column number of the next char, i.e. Index LineBegin + 1.</summary>
</member>
<member name="P:FParsec.CharStream.Encoding">
<summary>The Encoding that is used for decoding the underlying byte stream, or
System.Text.UnicodeEncoding in case the stream was directly constructed
from a string or char buffer.</summary>
</member>
<member name="F:FParsec.CharStream.BufferString">
<summary>The string holding the char buffer, or null if the buffer is not part of a .NET string.</summary>
</member>
<member name="F:FParsec.CharStream.BufferStringPointer">
<summary>A pointer to the beginning of BufferString, or null if BufferString is null.</summary>
</member>
<member name="F:FParsec.CharStream.BufferHandle">
<summary>Holds the GCHandle for CharStreams directly constructed from strings or char arrays.</summary>
</member>
<member name="F:FParsec.CharStream.StringBuffer">
<summary>Holds the StringBuffer for CharStreams constructed from a binary stream.</summary>
</member>
<member name="T:FParsec.CharStream.MultiBlockData">
<summary>Contains the data and methods needed in case the input byte stream
is large enough to span multiple blocks of the CharStream.</summary>
</member>
<member name="F:FParsec.CharStream.MultiBlockData.LastBlock">
<summary>The index of the last block of the stream, or Int32.MaxValue if the end of stream has not yet been detected.</summary>
</member>
<member name="F:FParsec.CharStream.MultiBlockData.RegexSpaceThreshold">
<summary>BufferBegin + BlockSize - minRegexSpace</summary>
</member>
<member name="P:FParsec.CharStream.MultiBlockData.ByteIndex">
<summary>The byte stream index of the first unused byte in the ByteBuffer.</summary>
</member>
<member name="M:FParsec.CharStream.MultiBlockData.FillByteBuffer">
<summary>Refills the ByteBuffer if no unused byte is remaining.
Returns the number of unused bytes in the (refilled) ByteBuffer.</summary>
</member>
<member name="M:FParsec.CharStream.MultiBlockData.ClearAndRefillByteBuffer(System.Int32)">
<summary>Refills the ByteBuffer starting at the given index. If the underlying byte
stream contains enough bytes, the ByteBuffer is filled up to the ByteBuffer.Length.
Returns the number of bytes available for consumption in the refilled ByteBuffer.</summary>
</member>
<member name="M:FParsec.CharStream.MultiBlockData.ReadCharsFromStream(System.Char*,System.Int32,System.String@)">
<summary>Reads up to the given maximum number of chars into the given buffer.
If more than the maximum number of chars have to be read from the stream in order to
fill the buffer (due to the way the Decoder API works), the overhang chars are
returned through the output parameter.
Returns a pointer to one char after the last char read.</summary>
</member>
<member name="M:FParsec.CharStream.MultiBlockData.ReadBlock(System.Int32)">
<summary> Reads a block of chars (which must be different from the current block)
into the BufferString. If the current CharStream block is block - 1, this method
seeks the CharStream to the first char after the overlap of the two blocks.
Otherwise it seeks the CharStream to the first char in the block. It returns the
CharStream.Ptr value at the new position (which can be null).</summary>
</member>
<member name="F:FParsec.CharStream.DoNotRoundUpBlockSizeToSimplifyTesting">
<summary>we modify this flag via reflection in the unit test</summary>
</member>
<member name="M:FParsec.CharStream.Seek(System.Int64)">
<summary>Returns an iterator pointing to the given index in the stream,
or to the end of the stream if the indexed position lies beyond the last char in the stream.</summary>
<exception cref="T:System.ArgumentOutOfRangeException">The index is negative or less than the BeginIndex.</exception>
<exception cref="T:System.NotSupportedException">Accessing the char with the given index requires seeking in the underlying byte stream, but the byte stream does not support seeking or the Encoding's Decoder is not serializable.</exception>
<exception cref="T:System.IO.IOException">An I/O error occured.</exception>
<exception cref="T:System.ArgumentException">The input stream contains invalid bytes and the encoding was constructed with the throwOnInvalidBytes option.</exception>
<exception cref="T:System.Text.DecoderFallbackException">The input stream contains invalid bytes for which the decoder fallback threw this exception.</exception>
<exception cref="T:System.OutOfMemoryException">Can not allocate enough memory for the internal data structure.</exception>
<exception cref="T:System.ObjectDisposedException">Method is called after the stream was disposed.</exception>
</member>
<member name="T:FParsec.CharStream`1">
<summary>Provides readaccess to a sequence of UTF16 chars.</summary>
</member>
<member name="T:FParsec.Cloning.CloneImage">
<summary>Contains the serialized state of on object.</summary>
</member>
<member name="M:FParsec.Cloning.CloneImage.CreateClone">
<summary>Deserializes the object state into a new object.</summary>
</member>
<member name="M:FParsec.Cloning.Cloner.Create(System.Type)">
<summary>Returns a cloner for the given <em>run-time</em> type.</summary>
<param name="type">The run-time type of the objects to clone. The type must be serializable.</param>
</member>
<member name="M:FParsec.Cloning.Cloner.Clone(System.Object)">
<summary>Copies the given object using the serialization API.</summary>
<param name="instance">The object to clone. instance.GetType() must equal the Type the Cloner was created for.</param>
</member>
<member name="M:FParsec.Cloning.Cloner.CaptureImage(System.Object)">
<summary>Returns an image of the given object instance.</summary>
<param name="instance">The object to capture an image of.</param>
</member>
<member name="F:FParsec.Cloning.Cloner.State.EventHandlers">
<summary>May be null.</summary>
</member>
<member name="F:FParsec.Cloning.Cloner.State.ObjectIndices">
<summary>Indices of nested objects in the object graph. May be null.</summary>
</member>
<member name="F:FParsec.Cloning.Cloner.State.StronglyConnectedComponent">
<summary>May be null.</summary>
</member>
<member name="M:FParsec.Cloning.Cloner.GetSerializedFields(System.Type,System.Boolean@)">
<summary>Returns the public and non-public fields of the type (and its base types),
except fields with the NonSerialized attribute. In the returned array fields from
derived types come before fields from base types.</summary>
</member>
<member name="M:FParsec.Cloning.Cloner.FindStronglyConnectedComponents(FParsec.Cloning.Cloner.State[])">
<summary>Fills the Strongly StronglyConnectedComponent fields of the
states passed in the array. Returns an array mapping each state to an
integer component identifier.
</summary>
<param name="states">The object states to traverse. The object with array index
0 is ignored. All other objects are assumed to be reachable from the object
with array index 1.</param>
</member>
<member name="M:FParsec.Cloning.Cloner.ComputeTopologicalOrder(FParsec.Cloning.Cloner.State[])">
<summary>Returns an array with the topologically sorted indices of the states.
In the returned array the indices of states belonging to the same strongly
connected component are adjacent (but the order within a strongly connected
component is undefined).
</summary>
<param name="states">The object states to traverse. The object with array index
0 is ignored. All other objects are assumed to be reachable from the object
with array index 1.</param>
</member>
<member name="M:FParsec.FastGenericEqualityERComparer`1.Equals(`0,`0)">
<summary>For reference types it's faster to call Instance.Equals directly
(due to limitations of the inliner of the .NET JIT.)</summary>
</member>
<member name="T:FParsec.FastGenericEqualityERComparer.ArrayStructuralEqualityERComparer`1">
<summary>Forwards all work to F#'s GenericEqualityERComparer.</summary>
</member>
<member name="M:FParsec.IdentifierValidator.ValidateAndNormalize(System.String,System.Int32@)">
<summary>Returns the normalized string, or null in case an invalid identifier
character is found. If an invalid character is found, the string index of the
invalid character is assigned to the out parameter, otherwise -1.</summary>
</member>
<member name="F:FParsec.OperatorPrecedenceParser`3.OpsArrayLength">
<summary>The length of LhsOps and RhsOps. Must be a power of 2.</summary>
</member>
<member name="F:FParsec.OperatorPrecedenceParser`3.ErrorOp">
<summary>ParsePrefixOp returns this value to signal that it backtracked and we should try to parse a term.</summary>
</member>
<member name="F:FParsec.OperatorPrecedenceParser`3.ZeroPrecedenceOperatorData">
<summary>Can not be readonly because it is passed as as a ref (for performance reasons), but it is never mutated.</summary>
</member>
<member name="M:FParsec.OperatorPrecedenceParser`3.ParsePrefixOp(FParsec.OperatorPrecedenceParser{`0,`1,`2}.OperatorData@,FParsec.Operator{`0,`1,`2},FParsec.Reply{`0}@,FParsec.CharStream{`2})">
<summary>Parses the following prefix operators, plus the expression the operators apply to.</summary>
</member>
<member name="M:FParsec.OperatorPrecedenceParser`3.ParseExpressionContinue(FParsec.OperatorPrecedenceParser{`0,`1,`2}.OperatorData@,FParsec.Operator{`0,`1,`2},FParsec.Reply{`0}@,FParsec.CharStream{`2})">
<summary>Parses (higher-precedence) infix and postfix operators after the first term, together with the argument expressions.</summary>
</member>
<member name="T:FParsec.StringBuffer">
<summary>A substring of a pinned string on the large object heap.
StringBuffers are cached in a pool and hence need to be properly disposed.</summary>
</member>
<member name="F:FParsec.StringBuffer.PoolSegment.Last">
<summary>the last allocated segment</summary>
</member>
<member name="P:FParsec.StringBuffer.PoolSegment.Size">
<summary>String.Length - x, where x > 0</summary>
</member>
<member name="F:FParsec.StringBuffer.Allocated">
<summary>Sum of the lengths of all currently allocated StringBuffers</summary>
</member>
<member name="M:FParsec.Text.DetectPreamble(System.Byte[],System.Int32,System.Text.Encoding@,System.Boolean)">
<summary>Detects the presence of an encoding preamble in the first count bytes of the byte buffer.
If detectEncoding is false, this function only searches for the preamble of the given default encoding,
otherwise also for any of the standard unicode byte order marks (UTF-8, UTF-16 LE/BE, UTF-32 LE/BE).
If an encoding different from the given default encoding is detected, the new encoding
is assigned to the encoding reference.
Returns the number of bytes in the detected preamble, or 0 if no preamble is detected.
</summary>
</member>
<member name="M:FParsec.Text.ReadAllRemainingCharsFromStream(System.Char*,System.Int32,System.Byte[],System.Int32,System.Int32,System.IO.Stream,System.Int64,System.Text.Decoder,System.Boolean)">
<summary>Reads all remaining chars into the given buffer. If the remaining stream
content holds more than the given maximum number of chars, an exception will be thrown.</summary>
</member>
<member name="M:FParsec.Text.FoldCase(System.String)">
<summary>Returns a case-folded copy of the string argument. All chars are mapped
using the (non-Turkic) 1-to-1 case folding mappings (v. 6.0) for Unicode code
points in the Basic Multilingual Plane, i.e. code points below 0x10000.
If the argument is null, null is returned.</summary>
</member>
<member name="M:FParsec.Text.NormalizeNewlines(System.String)">
<summary>Returns the given string with all occurrences of "\r\n" and "\r" replaced
by "\n". If the argument is null, null is returned.</summary>
</member>
<member name="M:FParsec.Text.CountTextElements(System.String)">
<summary>A faster implementation of System.Globalization.StringInfo(str).LengthInTextElements.</summary>
</member>
<member name="M:FParsec.Text.IsWhitespace(System.Char)">
<summary>A faster implementation of System.Char.IsWhiteSpace.</summary>
</member>
<member name="T:FParsec.UnmanagedMemoryPool">
<summary>
Allocates and keeps references to chunks of unmanaged memory that we
intend to keep around for the lifetime of the AppDomain.
</summary>
</member>
</members>
</doc>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,277 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>FParsecCS</name>
</assembly>
<members>
<member name="M:FParsec.Buffer.PositiveDistance(System.Char*,System.Char*)">
<summary>Calculates: end - begin. <br />
Precondition: 2^31 > end - begin >= 0.</summary>
</member>
<member name="M:FParsec.Buffer.PositiveDistance64(System.Char*,System.Char*)">
<summary>Calculates: end - begin. <br />
Precondition: end - begin >= 0.</summary>
</member>
<member name="M:FParsec.Buffer.Copy(System.Byte*,System.Byte*,System.Int32)">
<summary>Copies size bytes from src to dst. Correctly handles overlapped memory blocks.</summary>
</member>
<member name="T:FParsec.CharStreamIndexToken">
<summary>An opaque representation of a CharStream index.</summary>
</member>
<member name="P:FParsec.CharStreamIndexToken.Block">
<summary>Returns -1 if the IndexToken was zero-initialized.</summary>
</member>
<member name="T:FParsec.CharStream">
<summary>Provides readaccess to a sequence of UTF16 chars.</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.ByteIndex">
<summary>the byte stream index of the first char in the block after the OverhangCharsAtBlockBegin</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.ByteBufferIndex">
<summary>the value of the CharStream's ByteBufferIndex before the block is read</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.NumberOfBytesInOverlap">
<summary>the number of bytes in the stream from ByteIndex to the first char after the OverhangCharsAfterOverlap</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.LastCharInOverlap">
<summary>the last char in the overlap with the previous block (used for integrity checking)</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.OverhangCharsAtBlockBegin">
<summary>chars at the block begin that were already read together with chars of the last block before the overlap</summary>
</member>
<member name="F:FParsec.CharStream.BlockInfo.OverhangCharsAfterOverlap">
<summary>chars after the overlap with the previous block that were already read together with the overlap chars</summary>
</member>
<member name="F:FParsec.CharStream.Ptr">
<summary>Points to the current char in Buffer,
or is null if the end of the stream has been reached.</summary>
</member>
<member name="F:FParsec.CharStream.PtrBegin">
<summary>Equals Ptr == null ? null : BufferBegin.</summary>
</member>
<member name="F:FParsec.CharStream.PtrEnd">
<summary>Equals Ptr == null ? null : BufferEnd.</summary>
</member>
<member name="F:FParsec.CharStream.BufferBegin">
<summary>Begin of the used part of the char buffer. Is constant. Is null if the CharStream is empty.</summary>
</member>
<member name="F:FParsec.CharStream.BufferEnd">
<summary>End of the used part of the char buffer. Varies for a multi-block stream. Is null if the CharStream is empty.</summary>
</member>
<member name="F:FParsec.CharStream.Block">
<summary>The block currently loaded in the buffer.</summary>
</member>
<member name="F:FParsec.CharStream.StateTag">
<summary>Any CharStream method or property setter increments this value when it changes the CharStream state.
Backtracking to an old state also restores the old value of the StateTag.</summary>
</member>
<member name="P:FParsec.CharStream.IndexOfFirstChar">
<summary>The index of the first char in the stream.</summary>
</member>
<member name="P:FParsec.CharStream.Line">
<summary>The line number for the next char. (The line count starts with 1.)</summary>
</member>
<member name="P:FParsec.CharStream.LineBegin">
<summary>The stream index of the first char of the line that also contains the next char.</summary>
</member>
<member name="P:FParsec.CharStream.Column">
<summary>The UTF16 column number of the next char, i.e. Index LineBegin + 1.</summary>
</member>
<member name="P:FParsec.CharStream.Encoding">
<summary>The Encoding that is used for decoding the underlying byte stream, or
System.Text.UnicodeEncoding in case the stream was directly constructed
from a string or char buffer.</summary>
</member>
<member name="F:FParsec.CharStream.BufferString">
<summary>The string holding the char buffer, or null if the buffer is not part of a .NET string.</summary>
</member>
<member name="F:FParsec.CharStream.BufferStringPointer">
<summary>A pointer to the beginning of BufferString, or null if BufferString is null.</summary>
</member>
<member name="F:FParsec.CharStream.BufferHandle">
<summary>Holds the GCHandle for CharStreams directly constructed from strings or char arrays.</summary>
</member>
<member name="F:FParsec.CharStream.StringBuffer">
<summary>Holds the StringBuffer for CharStreams constructed from a binary stream.</summary>
</member>
<member name="T:FParsec.CharStream.MultiBlockData">
<summary>Contains the data and methods needed in case the input byte stream
is large enough to span multiple blocks of the CharStream.</summary>
</member>
<member name="F:FParsec.CharStream.MultiBlockData.LastBlock">
<summary>The index of the last block of the stream, or Int32.MaxValue if the end of stream has not yet been detected.</summary>
</member>
<member name="F:FParsec.CharStream.MultiBlockData.RegexSpaceThreshold">
<summary>BufferBegin + BlockSize - minRegexSpace</summary>
</member>
<member name="P:FParsec.CharStream.MultiBlockData.ByteIndex">
<summary>The byte stream index of the first unused byte in the ByteBuffer.</summary>
</member>
<member name="M:FParsec.CharStream.MultiBlockData.FillByteBuffer">
<summary>Refills the ByteBuffer if no unused byte is remaining.
Returns the number of unused bytes in the (refilled) ByteBuffer.</summary>
</member>
<member name="M:FParsec.CharStream.MultiBlockData.ClearAndRefillByteBuffer(System.Int32)">
<summary>Refills the ByteBuffer starting at the given index. If the underlying byte
stream contains enough bytes, the ByteBuffer is filled up to the ByteBuffer.Length.
Returns the number of bytes available for consumption in the refilled ByteBuffer.</summary>
</member>
<member name="M:FParsec.CharStream.MultiBlockData.ReadCharsFromStream(System.Char*,System.Int32,System.String@)">
<summary>Reads up to the given maximum number of chars into the given buffer.
If more than the maximum number of chars have to be read from the stream in order to
fill the buffer (due to the way the Decoder API works), the overhang chars are
returned through the output parameter.
Returns a pointer to one char after the last char read.</summary>
</member>
<member name="M:FParsec.CharStream.MultiBlockData.ReadBlock(System.Int32)">
<summary> Reads a block of chars (which must be different from the current block)
into the BufferString. If the current CharStream block is block - 1, this method
seeks the CharStream to the first char after the overlap of the two blocks.
Otherwise it seeks the CharStream to the first char in the block. It returns the
CharStream.Ptr value at the new position (which can be null).</summary>
</member>
<member name="F:FParsec.CharStream.DoNotRoundUpBlockSizeToSimplifyTesting">
<summary>we modify this flag via reflection in the unit test</summary>
</member>
<member name="M:FParsec.CharStream.Seek(System.Int64)">
<summary>Returns an iterator pointing to the given index in the stream,
or to the end of the stream if the indexed position lies beyond the last char in the stream.</summary>
<exception cref="T:System.ArgumentOutOfRangeException">The index is negative or less than the BeginIndex.</exception>
<exception cref="T:System.NotSupportedException">Accessing the char with the given index requires seeking in the underlying byte stream, but the byte stream does not support seeking or the Encoding's Decoder is not serializable.</exception>
<exception cref="T:System.IO.IOException">An I/O error occured.</exception>
<exception cref="T:System.ArgumentException">The input stream contains invalid bytes and the encoding was constructed with the throwOnInvalidBytes option.</exception>
<exception cref="T:System.Text.DecoderFallbackException">The input stream contains invalid bytes for which the decoder fallback threw this exception.</exception>
<exception cref="T:System.OutOfMemoryException">Can not allocate enough memory for the internal data structure.</exception>
<exception cref="T:System.ObjectDisposedException">Method is called after the stream was disposed.</exception>
</member>
<member name="T:FParsec.CharStream`1">
<summary>Provides readaccess to a sequence of UTF16 chars.</summary>
</member>
<member name="T:FParsec.Cloning.CloneImage">
<summary>Contains the serialized state of on object.</summary>
</member>
<member name="M:FParsec.Cloning.CloneImage.CreateClone">
<summary>Deserializes the object state into a new object.</summary>
</member>
<member name="M:FParsec.Cloning.Cloner.Create(System.Type)">
<summary>Returns a cloner for the given <em>run-time</em> type.</summary>
<param name="type">The run-time type of the objects to clone. The type must be serializable.</param>
</member>
<member name="M:FParsec.Cloning.Cloner.Clone(System.Object)">
<summary>Copies the given object using the serialization API.</summary>
<param name="instance">The object to clone. instance.GetType() must equal the Type the Cloner was created for.</param>
</member>
<member name="M:FParsec.Cloning.Cloner.CaptureImage(System.Object)">
<summary>Returns an image of the given object instance.</summary>
<param name="instance">The object to capture an image of.</param>
</member>
<member name="F:FParsec.Cloning.Cloner.State.EventHandlers">
<summary>May be null.</summary>
</member>
<member name="F:FParsec.Cloning.Cloner.State.ObjectIndices">
<summary>Indices of nested objects in the object graph. May be null.</summary>
</member>
<member name="F:FParsec.Cloning.Cloner.State.StronglyConnectedComponent">
<summary>May be null.</summary>
</member>
<member name="M:FParsec.Cloning.Cloner.GetSerializedFields(System.Type,System.Boolean@)">
<summary>Returns the public and non-public fields of the type (and its base types),
except fields with the NonSerialized attribute. In the returned array fields from
derived types come before fields from base types.</summary>
</member>
<member name="M:FParsec.Cloning.Cloner.FindStronglyConnectedComponents(FParsec.Cloning.Cloner.State[])">
<summary>Fills the Strongly StronglyConnectedComponent fields of the
states passed in the array. Returns an array mapping each state to an
integer component identifier.
</summary>
<param name="states">The object states to traverse. The object with array index
0 is ignored. All other objects are assumed to be reachable from the object
with array index 1.</param>
</member>
<member name="M:FParsec.Cloning.Cloner.ComputeTopologicalOrder(FParsec.Cloning.Cloner.State[])">
<summary>Returns an array with the topologically sorted indices of the states.
In the returned array the indices of states belonging to the same strongly
connected component are adjacent (but the order within a strongly connected
component is undefined).
</summary>
<param name="states">The object states to traverse. The object with array index
0 is ignored. All other objects are assumed to be reachable from the object
with array index 1.</param>
</member>
<member name="M:FParsec.FastGenericEqualityERComparer`1.Equals(`0,`0)">
<summary>For reference types it's faster to call Instance.Equals directly
(due to limitations of the inliner of the .NET JIT.)</summary>
</member>
<member name="T:FParsec.FastGenericEqualityERComparer.ArrayStructuralEqualityERComparer`1">
<summary>Forwards all work to F#'s GenericEqualityERComparer.</summary>
</member>
<member name="M:FParsec.IdentifierValidator.ValidateAndNormalize(System.String,System.Int32@)">
<summary>Returns the normalized string, or null in case an invalid identifier
character is found. If an invalid character is found, the string index of the
invalid character is assigned to the out parameter, otherwise -1.</summary>
</member>
<member name="F:FParsec.OperatorPrecedenceParser`3.OpsArrayLength">
<summary>The length of LhsOps and RhsOps. Must be a power of 2.</summary>
</member>
<member name="F:FParsec.OperatorPrecedenceParser`3.ErrorOp">
<summary>ParsePrefixOp returns this value to signal that it backtracked and we should try to parse a term.</summary>
</member>
<member name="F:FParsec.OperatorPrecedenceParser`3.ZeroPrecedenceOperatorData">
<summary>Can not be readonly because it is passed as as a ref (for performance reasons), but it is never mutated.</summary>
</member>
<member name="M:FParsec.OperatorPrecedenceParser`3.ParsePrefixOp(FParsec.OperatorPrecedenceParser{`0,`1,`2}.OperatorData@,FParsec.Operator{`0,`1,`2},FParsec.Reply{`0}@,FParsec.CharStream{`2})">
<summary>Parses the following prefix operators, plus the expression the operators apply to.</summary>
</member>
<member name="M:FParsec.OperatorPrecedenceParser`3.ParseExpressionContinue(FParsec.OperatorPrecedenceParser{`0,`1,`2}.OperatorData@,FParsec.Operator{`0,`1,`2},FParsec.Reply{`0}@,FParsec.CharStream{`2})">
<summary>Parses (higher-precedence) infix and postfix operators after the first term, together with the argument expressions.</summary>
</member>
<member name="T:FParsec.StringBuffer">
<summary>A substring of a pinned string on the large object heap.
StringBuffers are cached in a pool and hence need to be properly disposed.</summary>
</member>
<member name="F:FParsec.StringBuffer.PoolSegment.Last">
<summary>the last allocated segment</summary>
</member>
<member name="P:FParsec.StringBuffer.PoolSegment.Size">
<summary>String.Length - x, where x > 0</summary>
</member>
<member name="F:FParsec.StringBuffer.Allocated">
<summary>Sum of the lengths of all currently allocated StringBuffers</summary>
</member>
<member name="M:FParsec.Text.DetectPreamble(System.Byte[],System.Int32,System.Text.Encoding@,System.Boolean)">
<summary>Detects the presence of an encoding preamble in the first count bytes of the byte buffer.
If detectEncoding is false, this function only searches for the preamble of the given default encoding,
otherwise also for any of the standard unicode byte order marks (UTF-8, UTF-16 LE/BE, UTF-32 LE/BE).
If an encoding different from the given default encoding is detected, the new encoding
is assigned to the encoding reference.
Returns the number of bytes in the detected preamble, or 0 if no preamble is detected.
</summary>
</member>
<member name="M:FParsec.Text.ReadAllRemainingCharsFromStream(System.Char*,System.Int32,System.Byte[],System.Int32,System.Int32,System.IO.Stream,System.Int64,System.Text.Decoder,System.Boolean)">
<summary>Reads all remaining chars into the given buffer. If the remaining stream
content holds more than the given maximum number of chars, an exception will be thrown.</summary>
</member>
<member name="M:FParsec.Text.FoldCase(System.String)">
<summary>Returns a case-folded copy of the string argument. All chars are mapped
using the (non-Turkic) 1-to-1 case folding mappings (v. 6.0) for Unicode code
points in the Basic Multilingual Plane, i.e. code points below 0x10000.
If the argument is null, null is returned.</summary>
</member>
<member name="M:FParsec.Text.NormalizeNewlines(System.String)">
<summary>Returns the given string with all occurrences of "\r\n" and "\r" replaced
by "\n". If the argument is null, null is returned.</summary>
</member>
<member name="M:FParsec.Text.CountTextElements(System.String)">
<summary>A faster implementation of System.Globalization.StringInfo(str).LengthInTextElements.</summary>
</member>
<member name="M:FParsec.Text.IsWhitespace(System.Char)">
<summary>A faster implementation of System.Char.IsWhiteSpace.</summary>
</member>
<member name="T:FParsec.UnmanagedMemoryPool">
<summary>
Allocates and keeps references to chunks of unmanaged memory that we
intend to keep around for the lifetime of the AppDomain.
</summary>
</member>
</members>
</doc>

View File

@@ -0,0 +1,755 @@
<?xml version="1.0" encoding="utf-8"?>
<doc>
<assembly><name>FSharp.Compiler.CodeDom</name></assembly>
<members>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="M:Internal.Utilities.FSharpEnvironment.Option.ofString(System.String)">
<summary>
Convert string into Option string where null and String.Empty result in None
</summary>
</member>
<member name="T:Internal.Utilities.FSharpEnvironment.Option">
</member>
<member name="T:Internal.Utilities.FSharpEnvironment">
</member>
<member name="">
</member>
<member name="T:Microsoft.FSharp.Compiler.CodeDom.FSharpAspNetCodeProvider">
<summary>
Implementation of the CodeDomProvider for the F# language.
This is specialized version that can be used with ASP.NET.
</summary>
</member>
<member name="">
</member>
<member name="T:Microsoft.FSharp.Compiler.CodeDom.FSharpCodeProvider">
<summary>
Implementation of the CodeDomProvider for the F# language.
If you intend to use CodeDom with ASP.NET you should use &lt;c&gt;FSharpAspNetCodeProvider&lt;/c&gt; instead.
</summary>
</member>
<member name="T:Microsoft.FSharp.Compiler.CodeDom.Internal.AssemblyAttributes">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="T:Microsoft.FSharp.Compiler.CodeDom.Internal.Compiler">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="T:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.MemberGenerateType">
<summary>
Where are we generating member?
</summary>
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="F:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context.ReturnUsingException">
<summary>
We use exception for returning value when generating complex
code that returns using imperative &quot;return&quot; statement
</summary>
</member>
<member name="F:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context.CurrentMethodReturnType">
<summary>
Type of the method
</summary>
</member>
<member name="F:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context.LocalVariableTypes">
<summary>
Types of all local variables in the method
</summary>
</member>
<member name="F:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context.TypeArgumentNames">
<summary>
Names of all type arguments in scope (need to rename T -&gt; &apos;T etc.)
</summary>
</member>
<member name="">
</member>
<member name="F:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context.Options">
<summary>
Options, output, ...
</summary>
</member>
<member name="F:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context.UniqueID">
<summary>
Some unique ID for every namespace (so we don&apos;t have name clashes)
</summary>
</member>
<member name="">
</member>
<member name="F:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.AdditionalOptions.AspNetArrays">
<summary>
Hacking for ASP.NET incorrect array initializers
They generate &quot;string&quot; where codedom test suite uses &quot;string[]&quot;
</summary>
</member>
<member name="F:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.AdditionalOptions.UnknonwFieldsAsLocals">
<summary>
Reference inherited fields using &quot;fld&quot; instead of &quot;this.fld&quot;
(could be used in the future to allow implicit classes in ASP.NET?)
</summary>
</member>
<member name="F:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.AdditionalOptions.None">
<summary>
No extra configuration
</summary>
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.generateCompileUnit(System.CodeDom.CodeCompileUnit,Microsoft.FSharp.Core.FSharpFunc{System.CodeDom.CodeCompileUnit,Microsoft.FSharp.Core.Unit})">
<summary>
Generate code for compile unit (file)
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.generateTypeDeclOnly(System.CodeDom.CodeTypeDeclaration)">
<summary>
Generate code for type declaration (not included in namespace)
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.generateNamespace(System.CodeDom.CodeNamespace)">
<summary>
Generate code for namespace without compilation unit
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.generateNamespaceInternal``1(System.Tuple{System.CodeDom.CodeNamespace,Microsoft.FSharp.Collections.FSharpList{System.Tuple{Microsoft.FSharp.Collections.FSharpList{System.String},System.CodeDom.CodeTypeDeclaration}},``0},System.Collections.Generic.IEnumerable{System.String})">
<summary>
Generates namespace code - takes output from &apos;preprocessNamespace&apos;
</summary>
</member>
<member name="">
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.preprocessNamespace(System.CodeDom.CodeNamespace)">
<summary>
Returns CodeNamespace, list of classes with scope (which includes class names
of containing classes and sequence of class renames)
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.generateMainMethod(System.CodeDom.CodeEntryPointMethod,System.CodeDom.CodeTypeDeclaration,System.CodeDom.CodeNamespace)">
<summary>
Generates a main method.
</summary>
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.generateClassMemberMethod(Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.MemberGenerateType,System.CodeDom.CodeMemberMethod,System.Int32)">
<summary>
Generates method code
Generates comments and than calls &apos;generatMethod&apos;
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.generateMethod(Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.MemberGenerateType,System.CodeDom.CodeMemberMethod,Microsoft.FSharp.Core.FSharpFunc{Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context,Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context})">
<summary>
By default all CodeDOM generated methods are &apos;virtual&apos; which means that
we have to generate &quot;abstract and default&quot; (unless we&apos;re in struct or
we&apos;re implementing an interface, or the method is overriden)
(NOTE: the same logic isn&apos;t properly implemented for properties)
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.generateInterfaceMemberMethod(System.CodeDom.CodeMemberMethod,System.Int32)">
<summary>
Abstract method in the interface
</summary>
</member>
<member name="">
</member>
<member name="">
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.generateInterfaceMemberProperty(System.CodeDom.CodeMemberProperty)">
<summary>
Abstract property in the interface
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.generateField(System.CodeDom.CodeMemberField)">
<summary>
fields
</summary>
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.generateExpression(System.CodeDom.CodeExpression)">
<summary>
Generate expression - with unkonw type
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.|CodeArrayAccessOrIndexer|_|(Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context,System.CodeDom.CodeExpression)">
<summary>
Matches array or indexer expression and corrects it if the generated CodeDOM is incorrect
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.generateExpressionDefaultThis(System.Boolean,System.CodeDom.CodeExpression)">
<summary>
Generates a &quot;this&quot; or &quot;CurrentType&quot; reference depending on whether a reference
is static or not. Used for &quot;ambiguous&quot; references without a type or object qualifier.
Unfortunately the Code tree isn&apos;t so kind as to tell us whether a reference is static
or not up front. Instead we predetermine a set of some static members and
assume all other references are instance references.
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.tryGetExpressionType(System.CodeDom.CodeExpression,Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context)">
<summary>
Tries to resolve type of an expression using a few tricks:
* Fields of current type may have known type
* Properties of current type as well
* We can also try to resolve other properties (sometimes it helps)
* Resolve type for local variables or argument reference
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.tryIsExpressionArray(System.CodeDom.CodeExpression,Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context)">
<summary>
Tries to resolve if type is an array, so we can generate
appropriate code (it can be either indexer or array, but we need to generate
.Item call for indexers (no overloading is supported by .[]).
Returns: &quot;None&quot; - can&apos;t resolve, &quot;Some&quot; resovled (true/false - is it an array?)
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.generateArrayCreateExpr(System.CodeDom.CodeArrayCreateExpression)">
<summary>
Generate array initializer. Checks generator options for ASP.NET workaround.
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.generatePrimitiveExpr(Microsoft.FSharp.Core.FSharpOption{System.Type},System.CodeDom.CodePrimitiveExpression)">
<summary>
Generate value of primitive expression
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.convertFunc(System.Type)">
<summary>
Returns F# conversion function for the specified type (or empty string)
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.isNumericConversion(System.Type,System.Type)">
<summary>
Are both types numerical types where numeric conversion function can be applied?
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.binaryOp(System.CodeDom.CodeBinaryOperatorType,Microsoft.FSharp.Core.FSharpFunc{Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context,Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context},Microsoft.FSharp.Core.FSharpFunc{Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context,Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context})">
<summary>
Generates code for binary operator using function for left and right operand
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.processTypeArgs(System.CodeDom.CodeTypeParameterCollection)">
<summary>
Preprocess collection with type parameters
Returns array to be used with &lt;c&gt;usingTyParams&lt;/c&gt; and
function to be called to generate &lt; ... &gt; code
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.usingTyParams(System.Collections.Generic.IEnumerable{System.String},Microsoft.FSharp.Core.FSharpFunc{Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context,Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context},Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context)">
<summary>
Record specified type parameters in the context, call generating function
and then restore the original type parameters
(this works if someone uses nested type parameters with the same name)
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.generateTypeArgs(System.CodeDom.CodeTypeReferenceCollection)">
<summary>
Generate type arguments using context
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.generateTypeRef(System.CodeDom.CodeTypeReference)">
<summary>
Generate type reference using context
(this is most commonly used method)
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.generateTypeRefNet(System.CodeDom.CodeTypeReference)">
<summary>
Get type reference, but don&apos;t rename .NET types to F# types
(this is only needed when calling static methods on the type)
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.getTypeRefSimple(System.CodeDom.CodeTypeReference)">
<summary>
Get full type reference string using empty context
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.getTypeRef(System.CodeDom.CodeTypeReference,Microsoft.FSharp.Collections.FSharpMap{System.String,System.String},System.String,Microsoft.FSharp.Collections.FSharpSet{System.String},System.Boolean)">
<summary>
Get full type reference using information from context
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.getBaseTypeRefString(System.String)">
<summary>
Generate type reference with empty context
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.getBaseTypeRef(System.CodeDom.CodeTypeReference,Microsoft.FSharp.Collections.FSharpMap{System.String,System.String},System.String,Microsoft.FSharp.Collections.FSharpSet{System.String},System.Boolean)">
<summary>
Generates type reference (not for arrays)
</summary>
</member>
<member name="">
</member>
<member name="">
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.tryAddVariableType(System.String,System.CodeDom.CodeTypeReference,Microsoft.FSharp.Collections.FSharpMap{System.String,System.Type})">
<summary>
Tries to resolve type of a variable and adds it to the Context dictionary
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.tryGetSystemType(Microsoft.FSharp.Core.FSharpOption{System.CodeDom.CodeTypeReference})">
<summary>
Get System.Type of know type (either standard type or resolved)
</summary>
</member>
<member name="">
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.op_MinusBang(Microsoft.FSharp.Core.FSharpFunc{Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context,Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context},System.String,Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context)">
<summary>
Output string as a valid F# identifier
</summary>
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.|FoundSystemType|_|(System.String)">
<summary>
Tries to find .NET type for specified type name
This is used when we need to know type in order to generate something correctly,
but it&apos;s just a fallback case
</summary>
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.colFilterT``1(Microsoft.FSharp.Core.FSharpFunc{Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context,Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context},System.Collections.IEnumerable,Microsoft.FSharp.Core.FSharpFunc{``0,Microsoft.FSharp.Core.FSharpFunc{Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context,Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context}},Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context)">
<summary>
Call specified function only on elements of specified type.
(performs dynamic type test using x.GetType())
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.colT``1(Microsoft.FSharp.Core.FSharpFunc{Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context,Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context},System.Collections.Generic.IEnumerable{``0},Microsoft.FSharp.Core.FSharpFunc{``0,Microsoft.FSharp.Core.FSharpFunc{Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context,Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context}},Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context)">
<summary>
Process collection - keeps context through the whole processing
calls &apos;f&apos; for every element in sequence and &apos;fs&apos; between every two elements
as a separator. This is a variant that works on typed collections.
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.col``1(Microsoft.FSharp.Core.FSharpFunc{Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context,Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context},System.Collections.IEnumerable,Microsoft.FSharp.Core.FSharpFunc{``0,Microsoft.FSharp.Core.FSharpFunc{Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context,Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context}},Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context)">
<summary>
Process collection - keeps context through the whole processing
calls &apos;f&apos; for every element in sequence and &apos;fs&apos; between every two elements
as a separator
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.mapFilter``2(Microsoft.FSharp.Core.FSharpFunc{``0,Microsoft.FSharp.Core.FSharpOption{``1}},Microsoft.FSharp.Collections.FSharpList{``0})">
<summary>
Perform map and filter operations in one
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.createCounter">
<summary>
Create closure to do the counting
(this is usend when we need indexing during collection processing)
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.str``1(``0,Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context)">
<summary>
Print object converted to string
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.id``1(``0)">
<summary>
Identity function
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.withCtxt``2(Microsoft.FSharp.Core.FSharpFunc{``0,Microsoft.FSharp.Core.FSharpFunc{``0,``1}},``0)">
<summary>
Call function, but give it context as an argument
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.op_MinusMinus(Microsoft.FSharp.Core.FSharpFunc{Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context,Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context},System.String,Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context)">
<summary>
Append specified string without line-break
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.op_PlusPlus(Microsoft.FSharp.Core.FSharpFunc{Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context,Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context},System.String,Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context)">
<summary>
Break-line and append specified string
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.uniqid(Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context)">
<summary>
Print unique id using: &quot;+&gt; uniqid&quot;
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.op_PlusGreater(Microsoft.FSharp.Core.FSharpFunc{Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context,Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context},Microsoft.FSharp.Core.FSharpFunc{Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context,Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context},Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.Context)">
<summary>
Function composition operator
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.createContext(System.IO.TextWriter,System.CodeDom.Compiler.CodeGeneratorOptions,Microsoft.FSharp.Compiler.CodeDom.Internal.Generator.AdditionalOptions)">
<summary>
Create context using specified text writer and options
</summary>
</member>
<member name="T:Microsoft.FSharp.Compiler.CodeDom.Internal.Generator">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="T:Microsoft.FSharp.Compiler.CodeDom.Internal.Global">
</member>
<member name="">
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Visitor.codeDomCallbackWithScope``4(Microsoft.FSharp.Core.FSharpFunc{Microsoft.FSharp.Core.FSharpFunc{``0,Microsoft.FSharp.Core.FSharpFunc{``1,Microsoft.FSharp.Core.FSharpFunc{``2,``1}}},Microsoft.FSharp.Core.FSharpFunc{``0,Microsoft.FSharp.Core.FSharpFunc{``1,Microsoft.FSharp.Core.FSharpFunc{System.Object,``1}}}},``0,``1,``3)">
<summary>
Walks through the CodeDom tree and keeps current &quot;scope&quot; and the result.
The result is collected through entire tree, but the modified scope is
passed only to sub-nodes of the current node.
First argument is a function that is called for nodes and has a
function as a first argument, scope and result as a second and current node as a third.
The function argument can be used to walk deeper in the tree if wanted.
</summary>
</member>
<member name="M:Microsoft.FSharp.Compiler.CodeDom.Internal.Visitor.codeDomFlatFilter``1(Microsoft.FSharp.Core.FSharpFunc{System.Object,System.Tuple{System.Boolean,System.Boolean}},``0)">
<summary>
Search for members and return flat list of selected members
Function given as an argument returns tuple - first item specifies
if the current element should be included in the result, the second
specifies if we should walk through child members of the current object
</summary>
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="T:Microsoft.FSharp.Compiler.CodeDom.Internal.Visitor">
</member>
</members>
</doc>

View File

@@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<doc>
<assembly><name>FSharp.PowerPack.Build.Tasks</name></assembly>
<members>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="M:Internal.Utilities.FSharpEnvironment.Option.ofString(System.String)">
<summary>
Convert string into Option string where null and String.Empty result in None
</summary>
</member>
<member name="T:Internal.Utilities.FSharpEnvironment.Option">
</member>
<member name="T:Internal.Utilities.FSharpEnvironment">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
</members>
</doc>

View File

@@ -0,0 +1,84 @@
<!--
***********************************************************************************************
FSharp.PowerPack.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
PowerPack build rules.
Copyright (C) Microsoft Corporation. Apache 2.0 License.
***********************************************************************************************
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="FsLex" AssemblyFile="FSharp.PowerPack.Build.Tasks.dll"/>
<UsingTask TaskName="FsYacc" AssemblyFile="FSharp.PowerPack.Build.Tasks.dll"/>
<PropertyGroup>
<CompileDependsOn>CallFsLex;CallFsYacc;$(CompileDependsOn)</CompileDependsOn>
</PropertyGroup>
<!-- Build FsLex files. -->
<Target
Name="CallFsLex"
Inputs="@(FsLex)"
Outputs="@(FsLex->'$(FsLexOutputFolder)%(Filename).fs')"
Condition="'@(FsLex)'!=''">
<!-- Create the output directory -->
<MakeDir Directories="$(FsLexOutputFolder)"/>
<!-- Call FsLex -->
<FsLex
InputFile="%(FsLex.Identity)"
OutputFile="$(FsLexOutputFolder)%(FsLex.Filename).fs"
ToolPath="$(FsLexToolPath)"
ToolExe="$(FsLexToolExe)"
OtherFlags="%(FsLex.OtherFlags)"
Unicode="$(FsLexUnicode)">
<!-- Track outputs for 'Clean' -->
<Output TaskParameter="OutputFile" ItemName="FileWrites"/>
</FsLex>
<!-- Make sure it will get cleaned -->
<CreateItem Include="$(FsLexOutputFolder)%(FsLex.Filename).fs">
<Output TaskParameter="Include" ItemName="FileWrites"/>
</CreateItem>
</Target>
<!-- Build FsYacc files. -->
<Target
Name="CallFsYacc"
Inputs="@(FsYacc)"
Outputs="@(FsYacc->'$(FsYaccOutputFolder)%(Filename).fs')"
Condition="'@(FsYacc)'!=''">
<!-- Create the output directory -->
<MakeDir Directories="$(FsYaccOutputFolder)"/>
<!-- Call FsYacc -->
<FsYacc
InputFile="%(FsYacc.Identity)"
OutputFile="$(FsYaccOutputFolder)%(FsYacc.Filename).fs"
Open="%(FsYacc.Open)"
Module="%(FsYacc.Module)"
OtherFlags="%(FsYacc.OtherFlags)"
ToolPath="$(FsYaccToolPath)"
ToolExe="$(FsYaccToolExe)">
<!-- Track outputs for 'Clean' -->
<Output TaskParameter="OutputFile" ItemName="FileWrites"/>
</FsYacc>
<!-- Make sure it will get cleaned -->
<CreateItem Include="$(FsYaccOutputFolder)%(FsYacc.Filename).fs">
<Output TaskParameter="Include" ItemName="FileWrites"/>
</CreateItem>
</Target>
<ItemGroup>
<AvailableItemName Include="FsLex">
<Visible>false</Visible>
</AvailableItemName>
<AvailableItemName Include="FsYacc">
<Visible>false</Visible>
</AvailableItemName>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,7 @@
param($rootPath, $toolsPath, $package, $project)
Add-BindingRedirect $project.Name
$project.ProjectItems | ForEach { if ($_.Name -eq "InstallationDummyFile.txt") { $_.Remove() } }
$projectPath = Split-Path $project.FullName -Parent
Join-Path $projectPath "InstallationDummyFile.txt" | Remove-Item

View File

@@ -0,0 +1,367 @@
<?xml version="1.0" encoding="utf-8"?>
<doc>
<assembly><name>FSharp.PowerPack.Linq</name></assembly>
<members>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="M:Microsoft.FSharp.Linq.QuotationEvaluator.ToLinqExpression(Microsoft.FSharp.Quotations.FSharpExpr)">
<summary>
Convert the quotation expression to LINQ expression trees
This operation will only succeed for a subset of quotation expressions.
Exceptions: InvalidArgumentException will be raised if the input expression is
not in the subset that can be converted to a LINQ expression tree
</summary>
</member>
<member name="">
</member>
<member name="M:Microsoft.FSharp.Linq.QuotationEvaluator.EvaluateUntyped(Microsoft.FSharp.Quotations.FSharpExpr)">
<summary>
Compile the quotation expression by first converting to LINQ expression trees
Exceptions: InvalidArgumentException will be raised if the input expression is
not in the subset that can be converted to a LINQ expression tree
</summary>
</member>
<member name="M:Microsoft.FSharp.Linq.QuotationEvaluator.Evaluate``1(Microsoft.FSharp.Quotations.FSharpExpr{``0})">
<summary>
Evaluate the quotation expression by first converting to LINQ expression trees
Exceptions: InvalidArgumentException will be raised if the input expression is
not in the subset that can be converted to a LINQ expression tree
</summary>
</member>
<member name="M:Microsoft.FSharp.Linq.QuotationEvaluator.CompileUntyped(Microsoft.FSharp.Quotations.FSharpExpr)">
<summary>
Compile the quotation expression by first converting to LINQ expression trees
Exceptions: InvalidArgumentException will be raised if the input expression is
not in the subset that can be converted to a LINQ expression tree
</summary>
</member>
<member name="M:Microsoft.FSharp.Linq.QuotationEvaluator.Compile``1(Microsoft.FSharp.Quotations.FSharpExpr{``0})">
<summary>
Compile the quotation expression by first converting to LINQ expression trees
Exceptions: InvalidArgumentException will be raised if the input expression is
not in the subset that can be converted to a LINQ expression tree
</summary>
</member>
<member name="">
</member>
<member name="M:Microsoft.FSharp.Linq.ExtraHashCompare.GenericNotEqualIntrinsic``1(``0,``0)">
<summary>
An intrinsic for compiling &lt;c&gt;&amp;lt;@ x &lt;&gt; y @&amp;gt;&lt;/c&gt; to expression trees
</summary>
</member>
<member name="T:Microsoft.FSharp.Linq.ExtraHashCompare">
</member>
<member name="M:Microsoft.FSharp.Linq.QueryModule.groupJoin``4(System.Collections.Generic.IEnumerable{``0},System.Collections.Generic.IEnumerable{``1},Microsoft.FSharp.Core.FSharpFunc`2{``0,``2},Microsoft.FSharp.Core.FSharpFunc`2{``1,``2},Microsoft.FSharp.Core.FSharpFunc`2{``0,Microsoft.FSharp.Core.FSharpFunc`2{System.Collections.Generic.IEnumerable{``1},``3}})">
<summary>
This join operator implements the LINQ GroupJoin operator and the &lt;c&gt;query&lt;/c&gt; convertor recognises it as such
</summary>
</member>
<member name="M:Microsoft.FSharp.Linq.QueryModule.join``4(System.Collections.Generic.IEnumerable{``0},System.Collections.Generic.IEnumerable{``1},Microsoft.FSharp.Core.FSharpFunc`2{``0,``2},Microsoft.FSharp.Core.FSharpFunc`2{``1,``2},Microsoft.FSharp.Core.FSharpFunc`2{``0,Microsoft.FSharp.Core.FSharpFunc`2{``1,``3}})">
<summary>
This join operator corresponds to the LINQ Join operator and the &lt;c&gt;query&lt;/c&gt; convertor recognises it as such
</summary>
</member>
<member name="M:Microsoft.FSharp.Linq.QueryModule.groupBy``2(Microsoft.FSharp.Core.FSharpFunc`2{``0,``1},System.Collections.Generic.IEnumerable{``0})">
<summary>
When used in queries, this operator corresponds to the LINQ Join operator and the &lt;c&gt;query&lt;/c&gt; convertor recognises it as such
</summary>
</member>
<member name="M:Microsoft.FSharp.Linq.QueryModule.maxBy``2(Microsoft.FSharp.Core.FSharpFunc`2{``0,``1},System.Collections.Generic.IEnumerable{``0})">
<summary>
When used in queries, this operator corresponds to the LINQ Max operator and the &lt;c&gt;query&lt;/c&gt; convertor recognises it as such
It differs in return type from &lt;c&gt;Seq.maxBy&lt;/c&gt;
</summary>
</member>
<member name="M:Microsoft.FSharp.Linq.QueryModule.minBy``2(Microsoft.FSharp.Core.FSharpFunc`2{``0,``1},System.Collections.Generic.IEnumerable{``0})">
<summary>
When used in queries, this operator corresponds to the LINQ Min operator and the &lt;c&gt;query&lt;/c&gt; convertor recognises it as such
It differs in return type from &lt;c&gt;Seq.minBy&lt;/c&gt;
</summary>
</member>
<member name="M:Microsoft.FSharp.Linq.QueryModule.contains``1(``0,System.Collections.Generic.IEnumerable{``0})">
<summary>
When used in queries, this operator corresponds to the LINQ Contains operator and the &lt;c&gt;query&lt;/c&gt; convertor recognises it as such
</summary>
</member>
<member name="M:Microsoft.FSharp.Linq.QueryModule.query``1(Microsoft.FSharp.Quotations.FSharpExpr{``0})">
<summary>
Evaluate the quotation expression by first converting to a LINQ expression tree
making use of IQueryable operators and then executing expression tree
Exceptions: &lt;c&gt;InvalidArgumentException&lt;/c&gt; will be raised if the input expression is
not in the subset that can be converted to a LINQ expression tree
</summary>
</member>
<member name="T:Microsoft.FSharp.Linq.QueryModule">
</member>
<member name="M:Microsoft.FSharp.Linq.QuotationEvaluation.LinqExpressionHelper``1(``0)">
<summary>
This function should not be called directly.
</summary>
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="T:Microsoft.FSharp.Linq.QuotationEvaluation.HelperTypes">
<summary>
A set of types used for implementing quotation conversions.
These are public only because targets of Linq Lambda expressions require them to be so
</summary>
</member>
<member name="T:Microsoft.FSharp.Linq.QuotationEvaluation">
<summary>
This module provides Compile and Eval extension members
for F# quotation values, implemented by translating to LINQ
expression trees and using the LINQ dynamic compiler.
</summary>
</member>
</members>
</doc>

View File

@@ -0,0 +1,367 @@
<?xml version="1.0" encoding="utf-8"?>
<doc>
<assembly><name>FSharp.PowerPack.Linq</name></assembly>
<members>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="M:Microsoft.FSharp.Linq.QuotationEvaluator.ToLinqExpression(Microsoft.FSharp.Quotations.FSharpExpr)">
<summary>
Convert the quotation expression to LINQ expression trees
This operation will only succeed for a subset of quotation expressions.
Exceptions: InvalidArgumentException will be raised if the input expression is
not in the subset that can be converted to a LINQ expression tree
</summary>
</member>
<member name="">
</member>
<member name="M:Microsoft.FSharp.Linq.QuotationEvaluator.EvaluateUntyped(Microsoft.FSharp.Quotations.FSharpExpr)">
<summary>
Compile the quotation expression by first converting to LINQ expression trees
Exceptions: InvalidArgumentException will be raised if the input expression is
not in the subset that can be converted to a LINQ expression tree
</summary>
</member>
<member name="M:Microsoft.FSharp.Linq.QuotationEvaluator.Evaluate``1(Microsoft.FSharp.Quotations.FSharpExpr{``0})">
<summary>
Evaluate the quotation expression by first converting to LINQ expression trees
Exceptions: InvalidArgumentException will be raised if the input expression is
not in the subset that can be converted to a LINQ expression tree
</summary>
</member>
<member name="M:Microsoft.FSharp.Linq.QuotationEvaluator.CompileUntyped(Microsoft.FSharp.Quotations.FSharpExpr)">
<summary>
Compile the quotation expression by first converting to LINQ expression trees
Exceptions: InvalidArgumentException will be raised if the input expression is
not in the subset that can be converted to a LINQ expression tree
</summary>
</member>
<member name="M:Microsoft.FSharp.Linq.QuotationEvaluator.Compile``1(Microsoft.FSharp.Quotations.FSharpExpr{``0})">
<summary>
Compile the quotation expression by first converting to LINQ expression trees
Exceptions: InvalidArgumentException will be raised if the input expression is
not in the subset that can be converted to a LINQ expression tree
</summary>
</member>
<member name="">
</member>
<member name="M:Microsoft.FSharp.Linq.ExtraHashCompare.GenericNotEqualIntrinsic``1(``0,``0)">
<summary>
An intrinsic for compiling &lt;c&gt;&amp;lt;@ x &lt;&gt; y @&amp;gt;&lt;/c&gt; to expression trees
</summary>
</member>
<member name="T:Microsoft.FSharp.Linq.ExtraHashCompare">
</member>
<member name="M:Microsoft.FSharp.Linq.QueryModule.groupJoin``4(System.Collections.Generic.IEnumerable{``0},System.Collections.Generic.IEnumerable{``1},Microsoft.FSharp.Core.FSharpFunc`2{``0,``2},Microsoft.FSharp.Core.FSharpFunc`2{``1,``2},Microsoft.FSharp.Core.FSharpFunc`2{``0,Microsoft.FSharp.Core.FSharpFunc`2{System.Collections.Generic.IEnumerable{``1},``3}})">
<summary>
This join operator implements the LINQ GroupJoin operator and the &lt;c&gt;query&lt;/c&gt; convertor recognises it as such
</summary>
</member>
<member name="M:Microsoft.FSharp.Linq.QueryModule.join``4(System.Collections.Generic.IEnumerable{``0},System.Collections.Generic.IEnumerable{``1},Microsoft.FSharp.Core.FSharpFunc`2{``0,``2},Microsoft.FSharp.Core.FSharpFunc`2{``1,``2},Microsoft.FSharp.Core.FSharpFunc`2{``0,Microsoft.FSharp.Core.FSharpFunc`2{``1,``3}})">
<summary>
This join operator corresponds to the LINQ Join operator and the &lt;c&gt;query&lt;/c&gt; convertor recognises it as such
</summary>
</member>
<member name="M:Microsoft.FSharp.Linq.QueryModule.groupBy``2(Microsoft.FSharp.Core.FSharpFunc`2{``0,``1},System.Collections.Generic.IEnumerable{``0})">
<summary>
When used in queries, this operator corresponds to the LINQ Join operator and the &lt;c&gt;query&lt;/c&gt; convertor recognises it as such
</summary>
</member>
<member name="M:Microsoft.FSharp.Linq.QueryModule.maxBy``2(Microsoft.FSharp.Core.FSharpFunc`2{``0,``1},System.Collections.Generic.IEnumerable{``0})">
<summary>
When used in queries, this operator corresponds to the LINQ Max operator and the &lt;c&gt;query&lt;/c&gt; convertor recognises it as such
It differs in return type from &lt;c&gt;Seq.maxBy&lt;/c&gt;
</summary>
</member>
<member name="M:Microsoft.FSharp.Linq.QueryModule.minBy``2(Microsoft.FSharp.Core.FSharpFunc`2{``0,``1},System.Collections.Generic.IEnumerable{``0})">
<summary>
When used in queries, this operator corresponds to the LINQ Min operator and the &lt;c&gt;query&lt;/c&gt; convertor recognises it as such
It differs in return type from &lt;c&gt;Seq.minBy&lt;/c&gt;
</summary>
</member>
<member name="M:Microsoft.FSharp.Linq.QueryModule.contains``1(``0,System.Collections.Generic.IEnumerable{``0})">
<summary>
When used in queries, this operator corresponds to the LINQ Contains operator and the &lt;c&gt;query&lt;/c&gt; convertor recognises it as such
</summary>
</member>
<member name="M:Microsoft.FSharp.Linq.QueryModule.query``1(Microsoft.FSharp.Quotations.FSharpExpr{``0})">
<summary>
Evaluate the quotation expression by first converting to a LINQ expression tree
making use of IQueryable operators and then executing expression tree
Exceptions: &lt;c&gt;InvalidArgumentException&lt;/c&gt; will be raised if the input expression is
not in the subset that can be converted to a LINQ expression tree
</summary>
</member>
<member name="T:Microsoft.FSharp.Linq.QueryModule">
</member>
<member name="M:Microsoft.FSharp.Linq.QuotationEvaluation.LinqExpressionHelper``1(``0)">
<summary>
This function should not be called directly.
</summary>
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="T:Microsoft.FSharp.Linq.QuotationEvaluation.HelperTypes">
<summary>
A set of types used for implementing quotation conversions.
These are public only because targets of Linq Lambda expressions require them to be so
</summary>
</member>
<member name="T:Microsoft.FSharp.Linq.QuotationEvaluation">
<summary>
This module provides Compile and Eval extension members
for F# quotation values, implemented by translating to LINQ
expression trees and using the LINQ dynamic compiler.
</summary>
</member>
</members>
</doc>

View File

@@ -0,0 +1,817 @@
<?xml version="1.0" encoding="utf-8"?>
<doc>
<assembly><name>FSharp.PowerPack.Parallel.Seq</name></assembly>
<members>
<member name="">
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.averageBy``2(Microsoft.FSharp.Core.FSharpFunc`2{``0,``1},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Returns the average of the results generated by applying the function to each element
of the sequence.</summary>
<remarks>The elements are averaged using the <c>+</c> operator, <c>DivideByInt</c> method and <c>Zero</c> property
associated with the generated type.</remarks>
<param name="projection">A function applied to transform each element of the sequence.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
<exception cref="System.ArgumentException">Thrown when the input sequence has zero elements.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.average``1(System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Generates a new sequence which, when iterated, will return successive
elements by calling the given function. The results of calling the function
will not be saved, that is the function will be reapplied as necessary to
regenerate the elements. The function is passed the index of the item being
generated.</summary>
<remarks>The returned sequence may be passed between threads safely. However,
individual IEnumerator values generated from the returned sequence should not be accessed concurrently.
Iteration can continue up to <c>Int32.MaxValue</c>.</remarks>
<param name="initializer">A function that generates an item in the sequence from a given index.</param>
<returns>The result sequence.</returns>
<summary>Operates in parallel, using System.Linq.Parallel. Returns a sequence that is built from the given delayed specification of a
sequence.</summary>
<remarks>The input function is evaluated each time an IEnumerator for the sequence
is requested.</remarks>
<param name="generator">The generating function for the sequence.</param>
<summary>Operates in parallel, using System.Linq.Parallel. Compares two sequences using the given comparison function, element by element.
Returns the first non-zero result from the comparison function. If the end of a sequence
is reached it returns a -1 if the first sequence is shorter and a 1 if the second sequence
is shorter.</summary>
<param name="comparer">A function that takes an element from each sequence and returns an int.
If it evaluates to a non-zero value iteration is stopped and that value is returned.</param>
<param name="source1">The first input sequence.</param>
<param name="source2">The second input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when either of the input sequences
is null.</exception>
<summary>Operates in parallel, using System.Linq.Parallel. Returns a sequence that corresponds to a cached version of the input sequence.
This result sequence will have the same elements as the input sequence. The result
can be enumerated multiple times. The input sequence will be enumerated at most
once and only as far as is necessary. Caching a sequence is typically useful when repeatedly
evaluating items in the original sequence is computationally expensive or if
iterating the sequence causes side-effects that the user does not want to be
repeated multiple times.
Enumeration of the result sequence is thread safe in the sense that multiple independent IEnumerator
values may be used simultaneously from different threads (accesses to
the internal lookaside table are thread safe). Each individual IEnumerator
is not typically thread safe and should not be accessed concurrently.</summary>
<remarks>Once enumeration of the input sequence has started,
it's enumerator will be kept live by this object until the enumeration has completed.
At that point, the enumerator will be disposed.
The enumerator may be disposed and underlying cache storage released by
converting the returned sequence object to type IDisposable, and calling the Dispose method
on this object. The sequence object may then be re-enumerated and a fresh enumerator will
be used.</remarks>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
<summary>Operates in parallel, using System.Linq.Parallel. Returns the average of the elements in the sequence.</summary>
<remarks>The elements are averaged using the <c>+</c> operator, <c>DivideByInt</c> method and <c>Zero</c> property
associated with the element type.</remarks>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
<exception cref="System.ArgumentException">Thrown when the input sequence has zero elements.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.maxBy``2(Microsoft.FSharp.Core.FSharpFunc`2{``0,``1},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Returns the greatest of all elements of the sequence, compared via Operators.max on the function result.</summary>
<param name="projection">A function to transform items from the input sequence into comparable keys.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
<exception cref="System.ArgumentException">Thrown when the input sequence is empty.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.max``1(System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Returns a sequence of each element in the input sequence and its predecessor, with the
exception of the first element which is only returned as the predecessor of the second element.</summary>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
<summary>Operates in parallel, using System.Linq.Parallel. Returns the greatest of all elements of the sequence, compared via Operators.max</summary>
<param name="source">The input sequence.</param>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
<exception cref="System.ArgumentException">Thrown when the input sequence is empty.</exception>
<returns>The result sequence.</returns>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.minBy``2(Microsoft.FSharp.Core.FSharpFunc`2{``0,``1},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Returns the lowest of all elements of the sequence, compared via Operators.min on the function result.</summary>
<param name="projection">A function to transform items from the input sequence into comparable keys.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
<exception cref="System.ArgumentException">Thrown when the input sequence is empty.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.min``1(System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Like fold, but computes on-demand and returns the sequence of intermediary and final results.</summary>
<param name="folder">A function that updates the state with each element from the sequence.</param>
<param name="state">The initial state.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
<summary>Operates in parallel, using System.Linq.Parallel. Builds a new sequence object that delegates to the given sequence object. This ensures
the original sequence cannot be rediscovered and mutated by a type cast. For example,
if given an array the returned sequence will return the elements of the array, but
you cannot cast the returned sequence object to an array.</summary>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
<summary>Operates in parallel, using System.Linq.Parallel. Returns the lowest of all elements of the sequence, compared via <c>Operators.min</c>.</summary>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
<exception cref="System.ArgumentException">Thrown when the input sequence is empty.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.sumBy``2(Microsoft.FSharp.Core.FSharpFunc`2{``0,``1},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Returns the sum of the results generated by applying the function to each element of the sequence.</summary>
<remarks>The generated elements are summed using the <c>+</c> operator and <c>Zero</c> property associated with the generated type.</remarks>
<param name="projection">A function to transform items from the input sequence into the type that will be summed.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.sum``1(System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Returns the first N elements of the sequence.</summary>
<remarks>Throws <c>InvalidOperationException</c>
if the count exceeds the number of elements in the sequence. <c>Seq.truncate</c>
returns as many items as the sequence contains instead of throwing an exception.</remarks>
<param name="count">The number of items to take.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
<exception cref="System.ArgumentException">Thrown when the input sequence is empty.</exception>
<exception cref="System.InvalidOperationException">Thrown when count exceeds the number of elements
in the sequence.</exception>
<summary>Operates in parallel, using System.Linq.Parallel. Applies the given function to successive elements, returning the first
result where the function returns "Some(x)".</summary>
<param name="chooser">A function that transforms items from the input sequence into options.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
<summary>Operates in parallel, using System.Linq.Parallel. Returns a sequence that contains the elements generated by the given computation.
The given initial <c>state</c> argument is passed to the element generator.
For each IEnumerator elements in the stream are generated on-demand by applying the element
generator, until a None value is returned by the element generator. Each call to the element
generator returns a new residual <c>state</c>.</summary>
<remarks>The stream will be recomputed each time an IEnumerator is requested and iterated for the Seq.
The returned sequence may be passed between threads safely. However,
individual IEnumerator values generated from the returned sequence should not be accessed concurrently.</remarks>
<param name="generator">A function that takes in the current state and returns an option tuple of the next
element of the sequence and the next state value.</param>
<param name="state">The initial state value.</param>
<returns>The result sequence.</returns>
<summary>Operates in parallel, using System.Linq.Parallel. Returns a sequence that yields sliding windows of containing elements drawn from the input
sequence. Each window is returned as a fresh array.</summary>
<param name="windowSize">The number of elements in each window.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
<exception cref="System.ArgumentException">Thrown when the input sequence is empty.</exception>
<summary>Operates in parallel, using System.Linq.Parallel. Combines the three sequences into a list of triples. The sequences need not have equal lengths:
when one sequence is exhausted any remaining elements in the other
sequences are ignored.</summary>
<param name="source1">The first input sequence.</param>
<param name="source2">The second input sequence.</param>
<param name="source3">The third input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when any of the input sequences is null.</exception>
<summary>Operates in parallel, using System.Linq.Parallel. Returns the sum of the elements in the sequence.</summary>
<remarks>The elements are summed using the <c>+</c> operator and <c>Zero</c> property associated with the generated type.</remarks>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="">
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.zip``2(System.Collections.Generic.IEnumerable{``0},System.Collections.Generic.IEnumerable{``1})">
<summary>Operates in parallel, using System.Linq.Parallel. Combines the two sequences into a list of pairs. The two sequences need not have equal lengths:
when one sequence is exhausted any remaining elements in the other
sequence are ignored.</summary>
<param name="source1">The first input sequence.</param>
<param name="source2">The second input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when either of the input sequences is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.truncate``1(System.Int32,System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Returns a sequence that when enumerated returns at most N elements.</summary>
<param name="count">The maximum number of items to enumerate.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.tryFindIndex``1(Microsoft.FSharp.Core.FSharpFunc`2{``0,System.Boolean},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Returns the index of the first element in the sequence
that satisfies the given predicate. Return <c>None</c> if no such element exists.</summary>
<param name="predicate">A function that evaluates to a Boolean when given an item in the sequence.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.tryFind``1(Microsoft.FSharp.Core.FSharpFunc`2{``0,System.Boolean},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Returns the first element for which the given function returns <c>true</c>.
Return <c>None</c> if no such element exists.</summary>
<param name="predicate">A function that evaluates to a Boolean when given an item in the sequence.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.toList``1(System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Builds a list from the given collection.</summary>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.toArray``1(System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Builds an array from the given collection.</summary>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.takeWhile``1(Microsoft.FSharp.Core.FSharpFunc`2{``0,System.Boolean},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Returns a sequence that, when iterated, yields elements of the underlying sequence while the
given predicate returns <c>true</c>, and then returns no further elements.</summary>
<param name="predicate">A function that evaluates to false when no more items should be returned.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.sortBy``2(Microsoft.FSharp.Core.FSharpFunc`2{``0,``1},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Applies a key-generating function to each element of a sequence and yield a sequence ordered
by keys. The keys are compared using generic comparison as implemented by <c>Operators.compare</c>.</summary>
<remarks>This function returns a sequence that digests the whole initial sequence as soon as
that sequence is iterated. As a result this function should not be used with
large or infinite sequences. The function makes no assumption on the ordering of the original
sequence.
This is a stable sort, that is the original order of equal elements is preserved.</remarks>
<param name="projection">A function to transform items of the input sequence into comparable keys.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.sort``1(System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Yields a sequence ordered by keys.</summary>
<remarks>This function returns a sequence that digests the whole initial sequence as soon as
that sequence is iterated. As a result this function should not be used with
large or infinite sequences. The function makes no assumption on the ordering of the original
sequence.
This is a stable sort, that is the original order of equal elements is preserved.</remarks>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.skipWhile``1(Microsoft.FSharp.Core.FSharpFunc`2{``0,System.Boolean},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Returns a sequence that, when iterated, skips elements of the underlying sequence while the
given predicate returns <c>true</c>, and then yields the remaining elements of the sequence.</summary>
<param name="predicate">A function that evaluates an element of the sequence to a boolean value.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.skip``1(System.Int32,System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Returns a sequence that skips N elements of the underlying sequence and then yields the
remaining elements of the sequence.</summary>
<param name="count">The number of items to skip.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
<exception cref="System.InvalidOperationException">Thrown when count exceeds the number of elements
in the sequence.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.singleton``1(``0)">
<summary>Operates in parallel, using System.Linq.Parallel. Returns a sequence that yields one item only.</summary>
<param name="value">The input item.</param>
<returns>The result sequence.</returns>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.reduce``1(Microsoft.FSharp.Core.FSharpFunc`2{``0,Microsoft.FSharp.Core.FSharpFunc`2{``0,``0}},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Applies a function to each element of the sequence, threading an accumulator argument
through the computation. Begin by applying the function to the first two elements.
Then feed this result into the function along with the third element and so on.
Return the final result.</summary>
<param name="reduction">A function that takes in the current accumulated result and the next
element of the sequence to produce the next accumulated result.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
<exception cref="System.ArgumentException">Thrown when the input sequence is empty.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.pick``2(Microsoft.FSharp.Core.FSharpFunc`2{``0,Microsoft.FSharp.Core.FSharpOption{``1}},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Applies the given function to successive elements, returning the first
<c>x</c> where the function returns "Some(x)".</summary>
<param name="chooser">A function to transform each item of the input sequence into an option of the output type.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
<exception cref="System.Collections.Generic.KeyNotFoundException">Thrown when every item of the sequence
evaluates to <c>None</c> when the given function is applied.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.ofList``1(Microsoft.FSharp.Collections.FSharpList{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Views the given list as a sequence.</summary>
<param name="source">The input list.</param>
<returns>The result sequence.</returns>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.ofArray``1(``0[])">
<summary>Operates in parallel, using System.Linq.Parallel. Views the given array as a sequence.</summary>
<param name="source">The input array.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.nth``1(System.Int32,System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Computes the nth element in the collection.</summary>
<param name="index">The index of element to retrieve.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.mapi``2(Microsoft.FSharp.Core.FSharpFunc`2{System.Int32,Microsoft.FSharp.Core.FSharpFunc`2{``0,``1}},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Builds a new collection whose elements are the results of applying the given function
to each of the elements of the collection. The integer index passed to the
function indicates the index (from 0) of element being transformed.</summary>
<param name="mapping">A function to transform items from the input sequence that also supplies the current index.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.map2``3(Microsoft.FSharp.Core.FSharpFunc`2{``0,Microsoft.FSharp.Core.FSharpFunc`2{``1,``2}},System.Collections.Generic.IEnumerable{``0},System.Collections.Generic.IEnumerable{``1})">
<summary>Operates in parallel, using System.Linq.Parallel. Builds a new collection whose elements are the results of applying the given function
to the corresponding pairs of elements from the two sequences. If one input sequence is shorter than
the other then the remaining elements of the longer sequence are ignored.</summary>
<param name="mapping">A function to transform pairs of items from the input sequences.</param>
<param name="source">The first input sequence.</param>
<param name="source2">The second input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when either of the input sequences is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.map``2(Microsoft.FSharp.Core.FSharpFunc`2{``0,``1},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Builds a new collection whose elements are the results of applying the given function
to each of the elements of the collection. The given function will be applied
as elements are demanded using the <c>MoveNext</c> method on enumerators retrieved from the
object.</summary>
<remarks>The returned sequence may be passed between threads safely. However,
individual IEnumerator values generated from the returned sequence should not be accessed concurrently.</remarks>
<param name="mapping">A function to transform items from the input sequence.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.length``1(System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Returns the lengthof the sequence</summary>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.iter2``2(Microsoft.FSharp.Core.FSharpFunc`2{``0,Microsoft.FSharp.Core.FSharpFunc`2{``1,Microsoft.FSharp.Core.Unit}},System.Collections.Generic.IEnumerable{``0},System.Collections.Generic.IEnumerable{``1})">
<summary>Operates in parallel, using System.Linq.Parallel. Applies the given function to two collections simultaneously. If one sequence is shorter than
the other then the remaining elements of the longer sequence are ignored.</summary>
<param name="action">A function to apply to each pair of elements from the input sequences.</param>
<param name="source1">The first input sequence.</param>
<param name="source2">The second input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when either of the input sequences is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.iteri``1(Microsoft.FSharp.Core.FSharpFunc`2{System.Int32,Microsoft.FSharp.Core.FSharpFunc`2{``0,Microsoft.FSharp.Core.Unit}},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Applies the given function to each element of the collection. The integer passed to the
function indicates the index of element.</summary>
<param name="action">A function to apply to each element of the sequence that can also access the current index.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.iter``1(Microsoft.FSharp.Core.FSharpFunc`2{``0,Microsoft.FSharp.Core.Unit},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Applies the given function to each element of the collection.</summary>
<param name="action">A function to apply to each element of the sequence.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.init``1(System.Int32,Microsoft.FSharp.Core.FSharpFunc`2{System.Int32,``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Generates a new sequence which, when iterated, will return successive
elements by calling the given function, up to the given count. The results of calling the function
will not be saved, that is the function will be reapplied as necessary to
regenerate the elements. The function is passed the index of the item being
generated.</summary>
<remarks>The returned sequence may be passed between threads safely. However,
individual IEnumerator values generated from the returned sequence should not be accessed concurrently.</remarks>
<param name="count">The maximum number of items to generate for the sequence.</param>
<param name="initializer">A function that generates an item in the sequence from a given index.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentException">Thrown when count is negative.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.isEmpty``1(System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Returns true if the sequence contains no elements, false otherwise.</summary>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.head``1(System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Returns the first element of the sequence.</summary>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
<exception cref="System.ArgumentException">Thrown when the input does not have any elements.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.groupBy``2(Microsoft.FSharp.Core.FSharpFunc`2{``0,``1},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Applies a key-generating function to each element of a sequence and yields a sequence of
unique keys. Each unique key has also contains a sequence of all elements that match
to this key.</summary>
<remarks>This function returns a sequence that digests the whole initial sequence as soon as
that sequence is iterated. As a result this function should not be used with
large or infinite sequences. The function makes no assumption on the ordering of the original
sequence.</remarks>
<param name="projection">A function that transforms an element of the sequence into a comparable key.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.forall2``2(Microsoft.FSharp.Core.FSharpFunc`2{``0,Microsoft.FSharp.Core.FSharpFunc`2{``1,System.Boolean}},System.Collections.Generic.IEnumerable{``0},System.Collections.Generic.IEnumerable{``1})">
<summary>Operates in parallel, using System.Linq.Parallel. Tests the all pairs of elements drawn from the two sequences satisfy the
given predicate. If one sequence is shorter than
the other then the remaining elements of the longer sequence are ignored.</summary>
<param name="predicate">A function to test pairs of elements from the input sequences.</param>
<param name="source1">The first input sequence.</param>
<param name="source2">The second input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when either of the input sequences is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.forall``1(Microsoft.FSharp.Core.FSharpFunc`2{``0,System.Boolean},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Tests if all elements of the sequence satisfy the given predicate.</summary>
<remarks>The predicate is applied to the elements of the input sequence. If any application
returns false then the overall result is false and no further elements are tested.
Otherwise, true is returned.</remarks>
<param name="predicate">A function to test an element of the input sequence.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.fold``2(Microsoft.FSharp.Core.FSharpFunc`2{``1,Microsoft.FSharp.Core.FSharpFunc`2{``0,``1}},``1,System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Applies a function to each element of the collection, threading an accumulator argument
through the computation. If the input function is <c>f</c> and the elements are <c>i0...iN</c>
then computes <c>f (... (f s i0)...) iN</c></summary>
<param name="folder">A function that updates the state with each element from the sequence.</param>
<param name="state">The initial state.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.findIndex``1(Microsoft.FSharp.Core.FSharpFunc`2{``0,System.Boolean},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Returns the index of the first element for which the given function returns <c>true</c>.</summary>
<param name="predicate">A function to test whether the index of a particular element should be returned.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.Collections.Generic.KeyNotFoundException">Thrown if no element returns true when
evaluated by the predicate</exception>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.find``1(Microsoft.FSharp.Core.FSharpFunc`2{``0,System.Boolean},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Returns the first element for which the given function returns <c>true</c>.</summary>
<param name="predicate">A function to test whether an item in the sequence should be returned.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.Collections.Generic.KeyNotFoundException">Thrown if no element returns true when
evaluated by the predicate</exception>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.filter``1(Microsoft.FSharp.Core.FSharpFunc`2{``0,System.Boolean},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Returns a new collection containing only the elements of the collection
for which the given predicate returns "true".</summary>
<remarks>The returned sequence may be passed between threads safely. However,
individual IEnumerator values generated from the returned sequence should not be accessed concurrently.
Remember sequence is lazy, effects are delayed until it is enumerated.</remarks>
<param name="predicate">A function to test whether each item in the input sequence should be included in the output.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.exists2``2(Microsoft.FSharp.Core.FSharpFunc`2{``0,Microsoft.FSharp.Core.FSharpFunc`2{``1,System.Boolean}},System.Collections.Generic.IEnumerable{``0},System.Collections.Generic.IEnumerable{``1})">
<summary>Operates in parallel, using System.Linq.Parallel. Tests if any pair of corresponding elements of the input sequences satisfies the given predicate.</summary>
<remarks>The predicate is applied to matching elements in the two sequences up to the lesser of the
two lengths of the collections. If any application returns true then the overall result is
true and no further elements are tested. Otherwise, false is returned. If one sequence is shorter than
the other then the remaining elements of the longer sequence are ignored.</remarks>
<param name="predicate">A function to test each pair of items from the input sequences.</param>
<param name="source1">The first input sequence.</param>
<param name="source2">The second input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when either of the two input sequences is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.exists``1(Microsoft.FSharp.Core.FSharpFunc`2{``0,System.Boolean},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Tests if any element of the sequence satisfies the given predicate.</summary>
<remarks>The predicate is applied to the elements of the input sequence. If any application
returns true then the overall result is true and no further elements are tested.
Otherwise, false is returned.</remarks>
<param name="predicate">A function to test each item of the input sequence.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.empty``1">
<summary>Operates in parallel, using System.Linq.Parallel. Creates an empty sequence.</summary>
<returns>The result sequence.</returns>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.distinctBy``2(Microsoft.FSharp.Core.FSharpFunc`2{``0,``1},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Returns a sequence that contains no duplicate entries according to the
generic hash and equality comparisons on the keys returned by the given key-generating function.
If an element occurs multiple times in the sequence then the later occurrences are discarded.</summary>
<param name="projection">A function transforming the sequence items into comparable keys.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.distinct``1(System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Returns a sequence that contains no duplicate entries according to generic hash and
equality comparisons on the entries.
If an element occurs multiple times in the sequence then the later occurrences are discarded.</summary>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.countBy``2(Microsoft.FSharp.Core.FSharpFunc`2{``0,``1},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Applies a key-generating function to each element of a sequence and return a sequence yielding unique
keys and their number of occurrences in the original sequence.</summary>
<remarks>Note that this function returns a sequence that digests the whole initial sequence as soon as
that sequence is iterated. As a result this function should not be used with
large or infinite sequences. The function makes no assumption on the ordering of the original
sequence.</remarks>
<param name="projection">A function transforming each item of input sequence into a key to be
compared against the others.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.concat``2(System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Combines the given enumeration-of-enumerations as a single concatenated
enumeration.</summary>
<remarks>The returned sequence may be passed between threads safely. However,
individual IEnumerator values generated from the returned sequence should not be accessed concurrently.</remarks>
<param name="sources">The input enumeration-of-enumerations.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.collect``3(Microsoft.FSharp.Core.FSharpFunc`2{``0,``1},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Applies the given function to each element of the sequence and concatenates all the
results.</summary>
<remarks>Remember sequence is lazy, effects are delayed until it is enumerated.</remarks>
<param name="mapping">A function to transform elements of the input sequence into the sequences
that will then be concatenated.</param>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.choose``2(Microsoft.FSharp.Core.FSharpFunc`2{``0,Microsoft.FSharp.Core.FSharpOption{``1}},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Applies the given function to each element of the list. Return
the list comprised of the results "x" for each element where
the function returns Some(x).</summary>
<remarks>The returned sequence may be passed between threads safely. However,
individual IEnumerator values generated from the returned sequence should not
be accessed concurrently.</remarks>
<param name="chooser">A function to transform items of type T into options of type U.</param>
<param name="source">The input sequence of type T.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.cast``1(System.Collections.IEnumerable)">
<summary>Operates in parallel, using System.Linq.Parallel. Wraps a loosely-typed System.Collections sequence as a typed sequence.</summary>
<remarks>The use of this function usually requires a type annotation.
An incorrect type annotation may result in runtime type
errors.
Individual IEnumerator values generated from the returned sequence should not be accessed concurrently.</remarks>
<param name="source">The input sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when the input sequence is null.</exception>
</member>
<member name="M:Microsoft.FSharp.Collections.PSeqModule.append``1(System.Collections.Generic.IEnumerable{``0},System.Collections.Generic.IEnumerable{``0})">
<summary>Operates in parallel, using System.Linq.Parallel. Wraps the two given enumerations as a single concatenated
enumeration.</summary>
<remarks>The returned sequence may be passed between threads safely. However,
individual IEnumerator values generated from the returned sequence should not be accessed
concurrently.</remarks>
<param name="source1">The first sequence.</param>
<param name="source2">The second sequence.</param>
<returns>The result sequence.</returns>
<exception cref="System.ArgumentNullException">Thrown when either of the two provided sequences is
null.</exception>
</member>
<member name="T:Microsoft.FSharp.Collections.PSeqModule">
<summary>Parallel operations on IEnumerables.</summary>
</member>
</members>
</doc>

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

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<repositories>
<repository path="..\packages.config" />
</repositories>

View File

@@ -0,0 +1,179 @@
module Ast
open System.Collections.Generic
type targetOutput = Text | CHeader | CList | JS | Nasm
let version = "1.1.3" // Shader Minifer version
let debugMode = false
let mutable outputName = "shader_code.h"
let mutable targetOutput = CHeader
let mutable verbose = false
let mutable smoothstepTrick = false
let mutable fieldNames = "xyzw"
let mutable macroThreshold = 10000
let mutable preserveExternals = false
let mutable preserveAllGlobals = false
let generatedMacros = Dictionary<string, int>()
let mutable reorderDeclarations = false
let mutable reorderFunctions = false
let mutable hlsl = false
let mutable noSequence = false
let mutable noRenaming = false
let mutable noRenamingList = [ "main" ]
let mutable forbiddenNames = [ "if"; "in"; "do" ]
let addFobiddenName s = forbiddenNames <- s :: forbiddenNames
type Ident = string
type Expr =
| Int of int * string
| Float of float * string
| Var of Ident
| FunCall of Expr * Expr list
| Subscript of Expr * Expr
| Dot of Expr * Ident
| Cast of Ident * Expr // hlsl
| VectorExp of Expr list // hlsl
and TypeSpec =
| TypeName of string
| TypeStruct of string(*type*) * Ident option(*name*) * Decl list
and Type = {
name: TypeSpec // e.g. int
typeQ: string option // e.g. const, uniform
}
and DeclElt = {
name: Ident // e.g. foo
size: Expr option // e.g. [3]
semantics: Expr list // e.g. : color
init: Expr option // e.g. = f(x)
}
and Decl = Type * DeclElt list
and Instr =
| Block of Instr list
| Decl of Decl
| Expr of Expr
| If of Expr * Instr (*then*) * Instr option (*else*)
| ForD of Decl * Expr option * Expr option * Instr (*for loop starting with a declaration*)
| ForE of Expr option * Expr option * Expr option * Instr (*for loop starting with an expression*)
| While of Expr * Instr
| DoWhile of Expr * Instr
| Keyword of string * Expr option (*break, continue, return, discard*)
| Verbatim of string
and FunctionType = {
retType: Type (*return*)
fName: Ident (*name*)
args: Decl list (*args*)
semantics: Expr list (*semantics*)
}
and TopLevel =
| TLVerbatim of string
| Function of FunctionType * Instr
| TLDecl of Decl
| TypeDecl of TypeSpec // structs
let makeType name tyQ = {Type.name=name; typeQ=tyQ}
let makeDecl name size sem init = {name=name; size=size; semantics=sem; init=init}
let makeFunctionType ty name args sem =
{retType=ty; fName=name; args=args; semantics=sem}
type MapEnv = {
fExpr: MapEnv -> Expr -> Expr
fInstr: Instr -> Instr
vars: Map<Ident, Type * Expr option * Expr option >
}
let mapEnv fe fi = {fExpr = fe; fInstr = fi; vars = Map.empty}
let foldList env fct li =
let env = ref env
let res = li |> List.map ((fun i -> // FIXME: use List.fold is cleaner :)
let x = fct !env i
env := fst x
snd x) : 'a -> 'a)
!env, res
let rec mapExpr env = function
| FunCall(fct, args) ->
env.fExpr env (FunCall(mapExpr env fct, List.map (mapExpr env) args))
| Subscript(arr, ind) ->
env.fExpr env (Subscript(mapExpr env arr, mapExpr env ind))
| Dot(e, field) -> env.fExpr env (Dot(mapExpr env e, field))
| Cast(id, e) -> env.fExpr env (Cast(id, mapExpr env e))
| VectorExp(li) ->
env.fExpr env (VectorExp(List.map (mapExpr env) li))
| e -> env.fExpr env e
and mapDecl env (ty, vars) =
let aux env decl =
let env = {env with vars = env.vars.Add(decl.name, (ty, decl.size, decl.init))}
env, {decl with size=Option.map (mapExpr env) decl.size; init=Option.map (mapExpr env) decl.init}
let env, vars = foldList env aux vars
env, (ty, vars)
let rec mapInstr env i =
let aux = function
| Block b ->
let _, b = foldList env mapInstr b
env, Block b
| Expr e -> env, Expr (mapExpr env e)
| Decl d ->
let env, res = mapDecl env d
env, Decl res
| If(cond, th, el) ->
env, If (mapExpr env cond, snd (mapInstr env th), Option.map (mapInstr env >> snd) el)
| While(cond, body) ->
env, While (mapExpr env cond, snd (mapInstr env body))
| DoWhile(cond, body) ->
env, DoWhile (mapExpr env cond, snd (mapInstr env body))
| ForD(init, cond, inc, body) ->
let env', decl = mapDecl env init
let res = ForD (decl, Option.map (mapExpr env') cond,
Option.map (mapExpr env') inc, snd (mapInstr env' body))
if hlsl then env', res
else env, res
| ForE(init, cond, inc, body) ->
let res = ForE (Option.map (mapExpr env) init, Option.map (mapExpr env) cond,
Option.map (mapExpr env) inc, snd (mapInstr env body))
env, res
| Keyword(k, e) ->
env, Keyword (k, Option.map (mapExpr env) e)
| Verbatim _ as v -> env, v
let env, res = aux i
env, env.fInstr res
let mapTopLevel env li =
let env, res = li |> foldList env (fun env tl ->
match tl with
| TLDecl t ->
let env, res = mapDecl env t
env, TLDecl res
| Function(fct, body) -> env, Function(fct, snd (mapInstr env body))
| e -> env, e)
res
let countIdent code =
let count = ref 0
let add li = count := !count + List.length li
let mapInstr = function
| Decl (_, li) as e -> add li; e
| ForD((_, li), _, _, _) as e -> add li; e
| e -> e
let mapExpr _ e = e
let mapTL = function
| Function(fct, _) -> incr count; add fct.args
| TLDecl (_, li) -> add li
| _ -> ()
mapTopLevel (mapEnv mapExpr mapInstr) code |> ignore
List.iter mapTL code
!count

View File

@@ -0,0 +1,103 @@
module CGen
open System.IO
// Values to export in the C code (uniform and attribute values)
let exportedValues = ref ([] : (string * string * string) list)
let export ty name (newName:string) =
if newName.[0] <> '0' then
exportedValues := !exportedValues |> List.map (fun (ty2, name2, newName2 as arg) ->
if ty = ty2 && name = newName2 then ty, name2, newName
else arg
)
else
exportedValues := (ty, name, newName) :: !exportedValues
let output() =
if Ast.debugMode || Ast.outputName = "" then stdout
else new StreamWriter(Ast.outputName) :> TextWriter
let printHeader data asAList =
use out = output()
let fileName =
if Ast.outputName = "" then "shader_code.h"
else Path.GetFileName Ast.outputName
let macroName = fileName.Replace(".", "_").ToUpper() + "_"
fprintfn out "/* File generated with Shader Minifier %s" Ast.version
fprintfn out " * http://www.ctrl-alt-test.fr"
fprintfn out " */"
if not asAList then
fprintfn out "#ifndef %s" macroName
fprintfn out "# define %s" macroName
for ty, name, newName in List.sort !exportedValues do
// let newName = Printer.identTable.[int newName]
if ty = "" then
fprintfn out "# define VAR_%s \"%s\"" (name.ToUpper()) newName
else
fprintfn out "# define %c_%s \"%s\"" (System.Char.ToUpper ty.[0]) (name.ToUpper()) newName
fprintfn out ""
for file, code in data do
let name = (Path.GetFileName file).Replace(".", "_")
if asAList then
fprintfn out "// %s" file
fprintfn out "\"%s\"," (Printer.print code)
else
fprintfn out "char %s[] =\r\n \"%s\";" name (Printer.print code)
fprintfn out ""
if not asAList then fprintfn out "#endif // %s" macroName
let printNoHeader data =
use out = output()
let str = [for _,code in data -> Printer.print code] |> String.concat "\n"
fprintf out "%s" str
let printJSHeader data =
use out = output()
fprintfn out "/* File generated with Shader Minifier %s" Ast.version
fprintfn out " * http://www.ctrl-alt-test.fr"
fprintfn out " */"
for ty, name, newName in List.sort !exportedValues do
if ty = "" then
fprintfn out "var var_%s = \"%s\"" (name.ToUpper()) newName
else
fprintfn out "var %c_%s = \"%s\"" (System.Char.ToUpper ty.[0]) (name.ToUpper()) newName
fprintfn out ""
for file, code in data do
let name = (Path.GetFileName file).Replace(".", "_")
fprintfn out "var %s =\r\n \"%s\"" name (Printer.print code)
fprintfn out ""
let printNasmHeader data =
use out = output()
fprintfn out "; File generated with Shader Minifier %s" Ast.version
fprintfn out "; http://www.ctrl-alt-test.fr"
for ty, name, newName in List.sort !exportedValues do
if ty = "" then
fprintfn out "_var_%s: db '%s', 0" (name.ToUpper()) newName
else
fprintfn out "_%c_%s: db '%s', 0" (System.Char.ToUpper ty.[0]) (name.ToUpper()) newName
fprintfn out ""
for file, code in data do
let name = (Path.GetFileName file).Replace(".", "_")
fprintfn out "_%s:\r\n\tdb '%s', 0" name (Printer.print code)
fprintfn out ""
let print data =
match Ast.targetOutput with
| Ast.Text -> printNoHeader data
| Ast.CHeader -> printHeader data false
| Ast.CList -> printHeader data true
| Ast.JS -> printJSHeader data
| Ast.Nasm -> printNasmHeader data

View File

@@ -0,0 +1,147 @@
module main
open System
open System.IO
open Microsoft.FSharp.Text
// Compute table of variables names, based on frequency
let computeFrequencyIdentTable li =
let _, str = Printer.quickPrint li
let stat = Seq.countBy id str |> dict
let get c = let ok, res = stat.TryGetValue(c) in if ok then res else 0
let letters = ['a'..'z']@['A'..'Z']
// First, use most frequent letters
let table = letters |> List.sortBy get |> List.rev |> List.map string
// Then, generate identifiers with 2 letters
let score (s:string) = - (get s.[0] + get s.[1])
let table2 = [for c1 in letters do for c2 in letters do yield c1.ToString() + c2.ToString()]
|> List.sortBy score
Printer.identTable <- Array.ofList (table @ table2)
let nullOut = new StreamWriter(Stream.Null) :> TextWriter
// like printf when verbose option is set
let vprintf fmt =
let out = if Ast.verbose then stdout else nullOut
fprintf out fmt
let printSize code =
if Ast.verbose then
let n, _ = Printer.quickPrint code
printfn "Shader size is: %d" n
let rename code =
Renamer.renameMode <- Renamer.Unambiguous
Printer.printMode <- Printer.SingleChar
let code, lastIdent = Renamer.renTopLevel code
computeFrequencyIdentTable code
Renamer.computeContextTable code
Printer.printMode <- Printer.FromTable
Renamer.renameMode <- Renamer.Context
let code, lastIdent = Renamer.renTopLevel code
vprintf "%d identifiers renamed. " Renamer.numberOfUsedIdents
printSize code
code
let minify file =
vprintf "Input file size is: %d\n" (FileInfo(file).Length)
let code = Parse.runParser file
vprintf "File parsed. "; printSize code
let code = Rewriter.reorder code
let code = Rewriter.apply code
vprintf "Rewrite tricks applied. "; printSize code
let code =
if Ast.noRenaming then code
else rename code
// vprintf "Identifiers renamed. "; printSize code
// let code =
// if !Ast.macroThreshold < 10000 then
// let code, n = Rewriter.injectMacros lastIdent code
// vprintfn "%d macros added." n
// code
// else code
vprintf "Minification of '%s' finished.\n" file
code
let run files =
try
let codes = Array.map minify files
CGen.print (Array.zip files codes)
0
with
| Failure s as exn -> printfn "%s" s; 1 //; printfn "%s" exn.StackTrace
| exn -> printfn "Error: %s" exn.Message; 1 //; printfn "%s" exn.StackTrace
let printHeader () =
printfn "Shader Minifier %s (c) Laurent Le Brun 2012" Ast.version
printfn "http://www.ctrl-alt-test.fr"
printfn ""
let () =
let files = ref []
let setFile s = files := s :: !files
let setFieldNames s =
if s = "rgba" || s = "xyzw" || s = "stpq" || s = "" then
Ast.fieldNames <- s
else
printfn "'%s' is not a valid value for field-names" s
printfn "You must use 'rgba', 'xyzw', or 'stpq'."
let noRenamingFct (s:string) = Ast.noRenamingList <- [for i in s.Split([|','|]) -> i.Trim()]
let setFormat = function
| "c-variables" -> Ast.targetOutput <- Ast.CHeader
| "js" -> Ast.targetOutput <- Ast.JS
| "c-array" -> Ast.targetOutput <- Ast.CList
| "none" -> Ast.targetOutput <- Ast.Text
| "nasm" -> Ast.targetOutput <- Ast.Nasm
| s -> printfn "'%s' is not a valid format" s
let specs =
["-o", ArgType.String (fun s -> Ast.outputName <- s), "Set the output filename (default is shader_code.h)"
"-v", ArgType.Unit (fun() -> Ast.verbose<-true), "Verbose, display additional information"
"--hlsl", ArgType.Unit (fun() -> Ast.hlsl<-true), "Use HLSL (default is GLSL)"
"--format", ArgType.String setFormat, "Can be: c-variables (default), c-array, js, nasm, or none"
"--field-names", ArgType.String setFieldNames, "Choose the field names for vectors: 'rgba', 'xyzw', or 'stpq'"
"--preserve-externals", ArgType.Unit (fun() -> Ast.preserveExternals<-true), "Do not rename external values (e.g. uniform)"
"--preserve-all-globals", ArgType.Unit (fun() -> Ast.preserveAllGlobals<-true; Ast.preserveExternals<-true), "Do not rename functions and global variables"
"--no-renaming", ArgType.Unit (fun() -> Ast.noRenaming<-true), "Do not rename anything"
"--no-renaming-list", ArgType.String noRenamingFct, "Comma-separated list of functions to preserve"
"--no-sequence", ArgType.Unit (fun() -> Ast.noSequence<-true), "Do not use the comma operator trick"
"--smoothstep", ArgType.Unit (fun() -> Ast.smoothstepTrick<-true), "Use IQ's smoothstep trick"
//"--macro-threshold", ArgType.Int (fun i ->
// printfn "Macros are disabled in the release."; Ast.macroThreshold <- i), "[disabled] Use a #define macro if it can save at least <int> bytes"
//"--make-elevated2", ArgType.Unit (fun () -> printfn "Please buy the commercial version."; exit 1), "Generate the 4k intro 'Elevated 2'"
"--shader-only", ArgType.Unit (fun() -> Ast.targetOutput<-Ast.Text), "[Deprecated]"
"--js-output", ArgType.Unit (fun() -> Ast.targetOutput<-Ast.JS), "[Deprecated]"
"--", ArgType.Rest setFile, "Stop parsing command line"
] |> List.map (fun (s, f, d) -> ArgInfo(s, f, d))
ArgParser.Parse(specs, setFile)
files := List.rev !files
let myExit n =
if Ast.debugMode then System.Console.ReadLine() |> ignore
exit n
if !files = [] then
printHeader()
ArgParser.Usage(specs, usage="Please give the shader files to compress on the command line.")
myExit 1
elif List.length !files > 1 && not Ast.preserveExternals then
printfn "When compressing multiple files, you must use the --preserve-externals option."
myExit 1
else
if Ast.verbose then printHeader()
myExit (run (Array.ofList !files))

View File

@@ -0,0 +1,346 @@
module Parse
// TODO: true, false
// TODO: switch case
open FParsec.Primitives
open FParsec.CharParsers
let commentLine = parse {
do! skipString "//" // .>> noneOf "[")) // (pchar '[')) // <?> "comment, not verbatim code"
do! notFollowedBy (anyOf "[]") <?> "not a verbatim code"
do! skipManyTill anyChar (followedBy newline) } |> attempt
let commentBlock = parse {
do! skipString "/*"
do! skipManyTill anyChar (skipString "*/") }
let ws = (many (choice [spaces1; commentLine; commentBlock] <?> "") |>> ignore)
let ch c = skipChar c >>. ws
let str s = pstring s .>> ws
let ident =
let nonDigit = asciiLetter <|> pchar '_'
let p = pipe2 nonDigit (manyChars (nonDigit <|> digit <?> "")) (fun c s -> c.ToString() + s)
(p .>> ws) <?> "identifier"
let opp = new FParsec.OperatorPrecedenceParser<_,_,_>()
let exprNoComma = opp.ExpressionParser
let expr = sepBy1 exprNoComma (ch ',') |>> (List.reduce (fun acc e -> Ast.FunCall(Ast.Var ",", [acc;e])))
let parenExp = between (ch '(') (ch ')') expr
// Primitives
let octal =
let r = @"0[0-7]+"
let conv s = System.Convert.ToInt32(s, 8) |> (fun x -> Ast.Int(x, ""))
let body = regex r |>> conv
body .>> ws
let hexa =
let prefix = pstring "0x" <|> pstring "0X"
let r = @"([0-9a-fA-F])+"
let conv s = System.Convert.ToInt32(s, 16) |> (fun x -> Ast.Int(x, ""))
let body = regex r |>> conv
prefix >>. body .>> ws
let number =
let r = @"(\d+\.?\d*|\.\d+)([eE][-+]?[0-9]+)?"
let conv (s: string) =
let ok, res = System.Int32.TryParse(s)
if ok then Ast.Int (res, "")
else Ast.Float (try float s, "" with _ -> failwith ("invalid number: " + s))
regex r .>> ws |>> conv
let anyNumber =
let n = (hexa <|> octal <|> number) <?> "number"
let suffix = ["f"; "F"; "LF"; "lf"; "u"; "U"; "l"; "L"; "h"; "H"]
|> List.map str |> choice
let suffix = suffix <?> "suffix"
let addSuffix = function
| Some su, Ast.Int (i, _) -> Ast.Int (i, su)
| Some su, Ast.Float (f,_) -> Ast.Float (f, su)
| _, n -> n
pipe2 n (opt suffix) (fun nb su -> addSuffix (su, nb))
let vectorExp =
let inner = sepBy exprNoComma (ch ',')
between (ch '{') (ch '}') inner |>> Ast.VectorExp
let prim' = choice [vectorExp; parenExp; ident |>> Ast.Var; anyNumber]
<?> "expression"
let cast =
let op = between (ch '(') (ch ')') ident
pipe2 op prim' (fun id e -> Ast.Cast(id, e)) <?> "cast"
let prim = attempt cast <|> prim'
// Very high priority (parenthesis, function call, field access)
let argList = sepBy exprNoComma (ch ',')
let fcall = between (ch '(') (ch ')') argList |>>
(fun args fct -> Ast.FunCall(fct, args))
let subscript = between (ch '[') (ch ']') expr |>>
(fun ind arr -> Ast.Subscript(arr, ind))
let dot = ch '.' >>. ident |>> (fun field r -> Ast.Dot(r, field))
let post = (dot <|> subscript <|> fcall) <?> ""
let simpleExpr = pipe2 prim (many post)
(fun prim posts -> List.fold (fun acc elt -> elt acc) prim posts)
opp.TermParser <- simpleExpr
// Operators
let precedence1 = [
["*"; "/"; "%"], FParsec.Associativity.Left
["+"; "-"], FParsec.Associativity.Left
["<<"; ">>"], FParsec.Associativity.Left
["<"; ">"; "<="; ">="], FParsec.Associativity.Left
["=="; "!="], FParsec.Associativity.Left
["&"], FParsec.Associativity.Left
["^"], FParsec.Associativity.Left
["|"], FParsec.Associativity.Left
["&&"], FParsec.Associativity.Left
["^^"], FParsec.Associativity.Left
["||"], FParsec.Associativity.Left
]
// precedence of ?: is between precedence1 and precedence2
let precedence2 = [
["="; "+="; "-="; "*="; "/="; "%="; "<<="; ">>="; "&="; "^="; "|="], FParsec.Associativity.Right
]
// Add all the operators in the OperatorParser
let makeOperator =
// we start with operators with highest priority, then we decrement the counter.
let precCounter = ref 20 //(we have at most 20 different priorities)
let addInfix li =
for ops, assoc in li do
decr precCounter
for op in ops do
opp.AddOperator(FParsec.InfixOperator(op, ws, !precCounter, assoc, fun x y -> Ast.FunCall(Ast.Var op, [x; y])))
let addPrefix() =
decr precCounter
for op in ["++"; "--"; "+"; "-"; "~"; "!"] do
opp.AddOperator(FParsec.PrefixOperator(op, ws, !precCounter, true, fun x -> Ast.FunCall(Ast.Var op, [x])))
let addPostfix() =
decr precCounter
for op in ["++"; "--"] do
opp.AddOperator(FParsec.PostfixOperator(op, ws, !precCounter, true, fun x -> Ast.FunCall(Ast.Var ("$"+op), [x])))
addPostfix()
addPrefix()
addInfix precedence1
decr precCounter
opp.AddOperator(FParsec.TernaryOperator("?", ws, ":", ws, !precCounter, FParsec.Associativity.Right, fun x y z -> Ast.FunCall(Ast.Var "?:", [x; y; z])))
addInfix precedence2
let simpleStatement = opt expr |>> (function Some exp -> Ast.Expr exp | None -> Ast.Block [])
let statement, stmtRef = createParserForwardedToRef()
let declaration, declRef = createParserForwardedToRef()
let keyword s = attempt (pstring s .>> notFollowedBy letter .>> notFollowedBy digit) .>> ws
// A type block, like struct or interface blocks
let blockSpecifier prefix =
// Restriction on field names
let check ((_,l) as arg : Ast.Decl) =
List.iter (fun (decl:Ast.DeclElt) ->
if decl.name <> Rewriter.renameField decl.name then
failwithf "Record field name '%s' is not allowed by Shader Minifier,\nbecause it looks like a vec4 field name." decl.name) l
arg
let decls = many (declaration .>> ch ';' |>> check)
let name = opt ident
pipe2 name (between (ch '{') (ch '}') decls)
(fun n d -> Ast.TypeStruct(prefix, n, d))
let structSpecifier = parse {
let! str = keyword "struct"
let! res = blockSpecifier str
return res
}
let structDecl =
let semi = if Ast.hlsl then opt (ch ';') |>> ignore else ch ';'
(structSpecifier .>> semi) |>> Ast.TypeDecl
// eg. "const out int", "uniform float"
let specifiedTypeGLSL =
let storage = ["const"; "inout"; "in"; "out"; "centroid"
"patch"; "sample"; "uniform"; "buffer"; "shared"; "coherent"
"volatile"; "restrict"; "readonly"; "writeonly"; "subroutine"
"attribute"; "varying"
"highp"; "mediump"; "lowp"
"invariant"; "precise"
"smooth"; "flat"; "noperspective"
]
|> List.map keyword |> choice <?> "Type qualifier"
let layout = keyword "layout" >>. ch '(' >>. manyCharsTill anyChar (ch ')')
|>> (function s -> "layout(" + s + ")")
let qualifier = many (storage <|> layout)
|>> (function [] -> None | li -> Some (String.concat " " li))
let typeSpec = structSpecifier <|> (ident |>> Ast.TypeName)
pipe2 qualifier typeSpec (fun tyQ name -> Ast.makeType name tyQ)
let specifiedTypeHLSL =
let storage = ["extern"; "nointerpolation"; "precise"; "shared"; "groupshared"
"static"; "uniform"; "volatile"; "const"; "row_major"; "column_major"
"inline"; "target"
"out"; "in"; "inout"
"point"; "triangle"; "line"; "triangleadj"; "lineadj"
"linear"; "centroid"; "nointerpolation"; "noperspective"; "sample"
"cbuffer"; "tbuffer"
]
|> List.map keyword |> choice <?> "Type qualifier"
let qualifier = many storage |>> (function [] -> None | li -> Some (String.concat " " li))
let generic = ch '<' >>. manyCharsTill anyChar (ch '>')
|> opt
|>> (function Some s -> "<" + s + ">" | None -> "")
let typeName = pipe2 ident generic (+)
let typeSpec = structSpecifier <|> (typeName |>> Ast.TypeName)
pipe3 qualifier typeSpec generic (fun tyQ name gen -> Ast.makeType name tyQ)
let specifiedType =
if Ast.hlsl then specifiedTypeHLSL else specifiedTypeGLSL
// For HLSL, e.g. ": color"
let semantics =
many (ch ':' >>. simpleExpr)
// eg. "int foo[] = exp, bar = 3"
declRef := (
let bracket = between (ch '[') (ch ']') (opt expr) |>> (fun size -> defaultArg size (Ast.Int (0, "")))
let init = ch '=' >>. exprNoComma
let var = pipe4 ident (opt bracket) semantics (opt init) Ast.makeDecl
let list = sepBy1 var (ch ',')
tuple2 specifiedType list
)
// eg. int foo[] used for function arguments
let singleDeclaration =
let bracket = between (ch '[') (ch ']') (opt expr) |>> (fun size -> defaultArg size (Ast.Int (0, "")))
let init = ch '=' >>. exprNoComma
pipe5 specifiedType ident (opt bracket) semantics (opt init)
(fun ty id brack sem ini -> (ty, [Ast.makeDecl id brack sem ini]))
// GLSL, eg. "uniform Transform { ... };"
let interfaceBlock = parse {
let! ty = specifiedType
let! sem = semantics
let s = sem |> List.map (fun s -> ":" + Printer.exprToS s) |> String.concat ""
let! ret = blockSpecifier (Printer.typeToS ty + s)
|>> Ast.TypeDecl
// semi-colon seems to be optional in hlsl
do! if Ast.hlsl then opt (ch ';') |>> ignore else ch ';'
return ret
}
let forLoop =
let init1 = declaration |>> (fun decl e2 e3 body -> Ast.ForD(decl, e2, e3, body))
let init2 = opt expr |>> (fun e1 e2 e3 body -> Ast.ForE(e1, e2, e3, body))
let init = attempt init1 <|> init2 .>> ch ';'
let cond = opt expr .>> ch ';'
let inc = opt expr .>> ch ')'
pipe4 (keyword "for" >>. ch '(' >>. init) cond inc statement
(fun f e2 e3 body -> f e2 e3 body)
let whileLoop =
pipe2 (keyword "while" >>. parenExp) statement
(fun cond stmt -> Ast.While(cond, stmt))
let doWhileLoop =
pipe2 (keyword "do" >>. statement) (str "while" >>. parenExp)
(fun stmt cond -> Ast.DoWhile(cond, stmt))
let ifStatement =
pipe3 (keyword "if" >>. parenExp) statement (opt (str "else" >>. statement))
(fun cond stmt1 stmt2 -> Ast.If(cond, stmt1, stmt2))
let block =
let list = many statement |>> Ast.Block
between (ch '{') (ch '}') list
let skipComment = skipMany (commentLine <|> commentBlock)
let macro =
let nl = skipComment >>. skipMany (pchar '\\' >>. newline)
let line = manyCharsTill (anyChar .>> nl) newline
// an ident, without eating trailing spaces
let ident = manyChars (pchar '_' <|> asciiLetter <|> digit)
// parse the #define macros to get the macro name
let define = pipe2 (keyword "define" >>. ident) line
(fun id line -> Ast.addFobiddenName id; "define " + id + line)
pchar '#' >>. (define <|> line) .>> ws |>> (fun s -> "#" + s)
let verbatim = parse {
do! skipString "//["
do! skipComment
let! content = manyCharsTill (anyChar .>> skipComment) (pstring "//]")
do! ws
return content }
// HLSL attribute, eg. [maxvertexcount(12)]
let attribute =
if Ast.hlsl then
ch '[' >>. manyCharsTill anyChar (ch ']')
|>> (function s -> "[" + s + "]")
else
pzero
let special =
let key =
choice [
keyword "break"
keyword "continue"
keyword "discard"
] |>> (fun k -> Ast.Keyword(k, None))
let ret = pipe2 (keyword "return") (opt expr) (fun k e -> Ast.Keyword(k, e))
(key <|> ret) .>> ch ';'
// A statement
stmtRef := choice [
block
special
forLoop
ifStatement
whileLoop
doWhileLoop
verbatim |>> Ast.Verbatim
macro |>> Ast.Verbatim
attribute |>> Ast.Verbatim
attempt ((declaration .>> ch ';') |>> Ast.Decl)
simpleStatement .>> ch ';'] <?> "instruction"
// eg. "int foo(float a[], out int b) : color"
let functionHeader =
let void_ = keyword "void" |>> (fun _ -> [])
let argList = void_ <|> (sepBy singleDeclaration (ch ','))
let argList = between (ch '(') (ch ')') argList
pipe4 specifiedType ident argList semantics Ast.makeFunctionType
let pfunction =
pipe2 functionHeader block (fun head body -> Ast.Function(head, body))
let toplevel =
let decl = declaration .>> ch ';'
let item = choice [
macro |>> Ast.TLVerbatim
verbatim |>> Ast.TLVerbatim
attribute |>> Ast.TLVerbatim
attempt decl |>> Ast.TLDecl
structDecl
attempt interfaceBlock
pfunction
]
let forwardDecl = functionHeader .>> ch ';' |>> (fun _ -> Ast.reorderFunctions <- true)
many ((attempt forwardDecl|>>fun _ -> None) <|> (item|>>Some)) |>> List.choose id // FIXME: use skip?
let parse = ws >>. toplevel .>> eof
let runParser file =
let res = runParserOnFile parse () file System.Text.Encoding.Default
match res with
| Success(r,_,_) -> r
| Failure(str, exn, _) -> failwithf "Parse error: %s" str

View File

@@ -0,0 +1,248 @@
module Printer
open Ast
let mutable identTable = [||]
let mutable output = stdout
let out a = sprintf a
// how to print variable names
type printMode = FromTable | SingleChar | Nothing
let mutable printMode = Nothing
let precedenceList = [
[","]
["="; "+="; "-="; "*="; "/="; "%="; "<<="; ">>="; "&="; "^="; "|="] // precedence = 1
["?:"]
["||"]
["^^"]
["&&"]
["|"]
["^"]
["&"]
["=="; "!="]
["<"; ">"; "<="; ">="]
["<<"; ">>"]
["+"; "-"]
["*"; "/"; "%"]
// _++ is prefix and $++ is postfix
["_++"; "_--"; "_+"; "_-"; "_~"; "_!"; "$++"; "$--"]
["."]
]
let precedence =
precedenceList
|> List.mapi (fun k li -> List.map (fun op -> op, k) li)
|> List.concat
|> dict
// check if the string is defined by a macro
let (!!) str =
match generatedMacros.TryGetValue str with
| true, s -> identTable.[int s]
| false, _ -> str
let idToS (id: string) =
if id.[0] = '0' then
match printMode with
| FromTable -> !!id // identTable.[int id]
| Nothing -> ""
| SingleChar -> string (char (1000 + int id))
else !!id
let listToS toS sep li =
List.map toS li |> String.concat sep
let floatToS f =
let si = if f < 0. then "-" else ""
let test = (abs f).ToString(System.Globalization.CultureInfo.InvariantCulture)
// display "3." instead of "3"
if (not Ast.hlsl) && fst (System.Int32.TryParse test) then !!(out "%f." f)
// display ".5" instead of "0.5"
else if (f = 0.0) then "0"
else if test.[0] = '0' then si + !!(test.[1..])
else si + !!test
let rec exprToS exp = exprToSLevel 0 exp
and exprToSLevel level = function
| Int (i, suf) -> !!(out "%d%s" i suf)
| Float (f, suf) -> out "%s%s" (floatToS f) suf
| Var s -> idToS s
| FunCall(f, args) ->
match f, args with
| Var "?:", [a1; a2; a3] ->
let prec = precedence.["?:"]
let res = out "%s?%s:%s" (exprToSLevel prec a1) (exprToSLevel prec a2) (exprToSLevel prec a3)
if prec < level then out "(%s)" res else res
| Var op, _ when System.Char.IsLetter op.[0] -> out "%s(%s)" (idToS op) (listToS exprToS "," args)
| Var op, _ when op.[0] = '0' -> out "%s(%s)" (idToS op) (listToS exprToS "," args)
| Var op, [a1] when op.[0] = '$' -> out "%s%s" (exprToSLevel precedence.[op] a1) op.[1..]
| Var op, [a1] -> out "%s%s" op (exprToSLevel precedence.["_" + op] a1)
| Var op, [a1; a2] ->
let prec = precedence.[op]
let res =
if prec = 1 then // "=", "+=", or other operative with right-associativity
out "%s%s%s" (exprToSLevel (prec+1) a1) op (exprToSLevel prec a2)
else
out "%s%s%s" (exprToSLevel prec a1) op (exprToSLevel (prec+1) a2)
if prec < level then out "(%s)" res
else res
| _ -> out "%s(%s)" (exprToS f) (listToS exprToS "," args)
| Subscript(arr, ind) ->
out "%s[%s]" (exprToS arr) (exprToS ind)
| Cast(id, e) ->
// Cast seems to have the same precedence as unary minus
out "(%s)%s" id (exprToSLevel precedence.["_-"] e)
| VectorExp(li) ->
out "{%s}" (listToS exprToS "," li)
| Dot(e, field) ->
out "%s.%s" (exprToSLevel precedence.["."] e) field
// Add a space if needed
let sp (s: string) =
if s.Length > 0 && System.Char.IsLetterOrDigit (s.[0]) then " " + s
else s
let sp2 (s: string) (s2: string) =
if s.Length > 0 && System.Char.IsLetterOrDigit(s.[s.Length-1]) &&
s2.Length > 0 && System.Char.IsLetterOrDigit(s2.[0]) then s + " " + s2
else s + s2
let backslashN() =
match targetOutput with
| Text -> "\n"
| Nasm -> "', 10, '"
| _ -> "\\n"
// Print HLSL semantics
let semToS sem =
let res = sem |> List.map exprToS |> String.concat ":"
if res = "" then res else ":" + res
let rec structToS prefix id decls =
let name = match id with None -> "" | Some s -> " " + s
let d = decls |> List.map declToS |> List.map (fun s -> s + ";") |> String.concat ""
out "%s{%s}" (sp2 prefix name) d
and typeSpecToS = function
| TypeName s -> s
| TypeStruct(prefix, id, decls) -> structToS prefix id decls
and typeToS (ty: Type) =
let get = Option.fold (fun _ s -> !!s + " ") ""
let typeSpec = typeSpecToS ty.name
out "%s%s" (get ty.typeQ) !!typeSpec
and declToS (ty, vars) =
let out1 decl =
let size =
match decl.size with
| None -> ""
| Some (Int (0, _)) -> "[]"
| Some n -> out "[%s]" (exprToS n)
let init =
match decl.init with
| None -> ""
| Some i -> out "=%s" (exprToS i)
out "%s%s%s%s" (idToS decl.name) size (semToS decl.semantics) init
if vars = [] then ""
else out "%s %s" (typeToS ty) (vars |> List.map out1 |> String.concat ",")
let ignoreFirstNewLine = ref true
let nl =
let wh = String.replicate 80 " "
fun n ->
if !ignoreFirstNewLine then
ignoreFirstNewLine := false
""
else
match targetOutput with
| Text -> ""
| CHeader | CList -> out "\"\r\n%s\"" wh.[0 .. 2 * n]
| JS -> out "\" +\r\n%s\"" wh.[0 .. 2 * n]
| Nasm -> out "'\r\n\tdb%s'" wh.[0 .. 2 * n]
let escape (s: string) =
match targetOutput with
| Text -> s
| CHeader | CList | JS -> s.Replace("\"", "\\\"").Replace("\n", "\\n")
| Nasm -> s.Replace("'", "\'").Replace("\n", "', 10, '")
let rec instrToS' indent = function
| Block [] -> ";"
| Block b ->
let body = List.map (instrToS (indent+1)) b |> String.concat ""
out "{%s%s}" body (nl indent)
| Decl (_, []) -> ""
| Decl d -> out "%s;" (declToS d)
| Expr e -> out "%s;" (exprToS e)
| If(cond, th, el) ->
let el = match el with
| None -> ""
| Some el -> out "%s%s%s%s" (nl indent) !!"else" (nl (indent+1)) (instrToS' (indent+1) el |> sp)
out "if(%s)%s%s" (exprToS cond) (instrToSInd indent th) el
| ForD(init, cond, inc, body) ->
let cond = defaultArg (Option.map exprToS cond) ""
let inc = defaultArg (Option.map exprToS inc) ""
out "%s(%s;%s;%s)%s" !!"for" (declToS init) cond inc (instrToSInd indent body)
| ForE(init, cond, inc, body) ->
let cond = defaultArg (Option.map exprToS cond) ""
let inc = defaultArg (Option.map exprToS inc) ""
let init = defaultArg (Option.map exprToS init) ""
out "%s(%s;%s;%s)%s" !!"for" init cond inc (instrToSInd indent body)
| While(cond, body) ->
out "%s(%s)%s" !!"while" (exprToS cond) (instrToSInd indent body)
| DoWhile(cond, body) ->
out "%s%s%s(%s)" !!"do" !!"while" (exprToS cond |> sp) (instrToS indent body)
| Keyword(k, None) -> out "%s;" !!k
| Keyword(k, Some exp) -> out "%s%s;" !!k (exprToS exp |> sp)
| Verbatim s ->
// add a space at end when it seems to be needed
let s = if System.Char.IsLetterOrDigit s.[s.Length - 1] then s + " " else s
if s <> "" && s.[0] = '#' then out "%s%s" (backslashN()) (escape s)
else escape s
and instrToS indent i =
out "%s%s" (nl indent) (instrToS' indent i)
// print indented instruction
and instrToSInd indent i = instrToS (indent+1) i
let funToS (f: FunctionType) =
out "%s %s(%s)%s" (typeToS f.retType) (idToS f.fName) (listToS declToS "," f.args) (semToS f.semantics)
let topLevelToS = function
| TLVerbatim s ->
// add a space at end when it seems to be needed
let s = if System.Char.IsLetterOrDigit s.[s.Length - 1] then s + " " else s
out "%s%s" (nl 0) (escape s)
| Function (fct, Block []) -> out "%s%s%s{}" (nl 0) (funToS fct) (nl 0)
| Function (fct, (Block _ as body)) -> out "%s%s%s" (nl 0) (funToS fct) (instrToS 0 body)
| Function (fct, body) -> out "%s%s%s{%s%s}" (nl 0) (funToS fct) (nl 0) (instrToS 1 body) (nl 0)
| TLDecl (_, []) -> ""
| TLDecl decl -> out "%s%s;" (nl 0) (declToS decl)
| TypeDecl t -> out "%s;" (typeSpecToS t)
let print tl =
let wasMacro = ref true
// handle the required \n before a macro
ignoreFirstNewLine := true
let f x =
let isMacro = match x with TLVerbatim s -> s <> "" && s.[0] = '#' | _ -> false
let needEndline = isMacro && not !wasMacro
wasMacro := isMacro
if needEndline then out "%s%s" (backslashN()) (topLevelToS x)
else topLevelToS x
tl |> List.map f |> String.concat ""
let quickPrint tl =
let out = Ast.targetOutput
Ast.targetOutput <- Text
let str = print tl
Ast.targetOutput <- out
str.Length, str

View File

@@ -0,0 +1,297 @@
module Renamer
open System.Collections.Generic
open Ast
type renameMode = Unambiguous | Frequency | Context
let mutable renameMode = Unambiguous
let doNotOverloadList = Ast.noRenamingList
(* Contextual renaming *)
let contextTable = new HashMultiMap<(char*char), int>(HashIdentity.Structural)
// This function is called when all 1-char ident are already used
let makeLetterIdent =
let chars = [| 'a' .. 'z' |]
let first = ref 0
let second = ref 0
fun () ->
incr second
if !second >= chars.Length then second := 0; incr first
string(chars.[!first]) + string(chars.[!second])
let computeContextTable code =
let _, str = Printer.quickPrint code
str |> Seq.pairwise |> Seq.iter (fun (prev, next) ->
match contextTable.TryFind (prev, next) with
| Some n -> contextTable.[(prev, next)] <- n + 1
| None -> contextTable.[(prev, next)] <- 1
)
//let chars, n = Seq.maxBy snd [for pair in contextTable -> pair.Key, pair.Value]
//printfn "max occ: %A -> %d" chars n
let chooseIdent ident candidates =
let allChars = [char 0 .. char 255]
let prevs = allChars |> Seq.choose (fun c ->
match contextTable.TryFind (c, ident) with
| Some occ -> Some (c, occ)
| None -> None
)
let nexts = allChars |> Seq.choose (fun c ->
match contextTable.TryFind (ident, c) with
| Some occ -> Some (c, occ)
| None -> None
)
let mutable best = -1000, "a"
for word in candidates do
let letter = (word : string).[0] // FIXME: use both first and last letter to compute stats
let mutable score = 0
for c, occ in prevs do
match contextTable.TryFind (c, letter) with
| None -> ()
| Some occ2 -> score <- score + occ2 // * occ
for c, occ in nexts do
match contextTable.TryFind (letter, c) with
| None -> ()
| Some occ2 -> score <- score + occ2 // * occ
if score > fst best then best <- score, word
// failwith ("No 1-letter name available. " +
// "Try to remove identifiers or reduce scope of variables. " +
// "If it is a problem for you, please send a bug report!")
let bestS =
if fst best = -1000 then
makeLetterIdent ()
else
snd best
let bestC = bestS.[0] // FIXME: doesn't work when ident have more than 1-char!
// update table
for c in allChars do
match contextTable.TryFind (c, ident), contextTable.TryFind (c, bestC) with
| None, _ -> ()
| Some n1, None -> contextTable.[(c, bestC)] <- n1
| Some n1, Some n2 -> contextTable.[(c, bestC)] <- n1 + n2
match contextTable.TryFind (ident, c), contextTable.TryFind (bestC, c) with
| None, _ -> ()
| Some n1, None -> contextTable.[(bestC, c)] <- n1
| Some n1, Some n2 -> contextTable.[(bestC, c)] <- n1 + n2
bestS
(* ** Renamer ** *)
// Environment for renamer
// int means the scope number (fun with n args = n + 1)
type Env = {
map: Map<Ident, Ident>
max: int
fct: Map<Ident, Map<int, Ident>>
reusable: Ident list
}
let mutable numberOfUsedIdents = 0
let alwaysNewName env id =
numberOfUsedIdents <- numberOfUsedIdents + 1
let newName = sprintf "%04d" numberOfUsedIdents
let env = {env with map = Map.add id newName env.map; max = env.max + 1}
env, newName
let optimizeFrequency env id =
match env.reusable with
|[] -> // create a new variable
let newName = sprintf "%04d" env.max
let env = {env with map = Map.add id newName env.map; max = env.max + 1}
numberOfUsedIdents <- max numberOfUsedIdents env.max
env, newName
|e::l -> // reuse a variable name
{env with map = Map.add id e env.map; reusable = l}, e
// FIXME: handle 2-letter names
let optimizeContext env id =
let cid = char (1000 + int id)
let l2 = env.reusable
// |> Seq.choose (fun s -> if s.Length = 1 then Some s.[0] else None)
let newName = chooseIdent cid l2
let l = env.reusable |> List.filter (fun x -> x.[0] <> newName.[0])
{env with map = Map.add id newName env.map; reusable = l}, newName
let newId env id =
match renameMode with
| Unambiguous -> alwaysNewName env id
| Frequency -> optimizeFrequency env id
| Context -> optimizeContext env id
let renFunction env nbArgs id =
if List.exists ((=) id) Ast.noRenamingList then env, id // don't rename "main"
else
// we're looking for a function name, already used before,
// but not with the same number of arg, and which is not in doNotOverloadList.
let search (x: KeyValuePair<Ident,Map<int,Ident>>) =
not (x.Value.ContainsKey nbArgs ||
List.exists ((=) x.Key) doNotOverloadList)
match env.fct |> Seq.tryFind search with
| Some res when renameMode <> Unambiguous ->
let newName = res.Key
let fct = env.fct.Add (res.Key, res.Value.Add(nbArgs, id))
let env = {env with fct = fct; map = env.map.Add(id, newName)}
env, newName
| _ ->
let env, newName = newId env id
let env = {env with fct = env.fct.Add (newName, Map.empty.Add(nbArgs, id))}
env, newName
let renSpecial env ty id =
let env, name = newId env id
CGen.export ty id name
env, name
let renFctName env (f: FunctionType) =
let ext = hlsl && f.semantics <> []
if (ext && preserveExternals) || preserveAllGlobals then
env, f
else
let newEnv, newName = renFunction env (List.length f.args) f.fName
if ext then CGen.export "F" f.fName newName
newEnv, {f with fName = newName}
let renList env fct li =
let env = ref env
let res = li |> List.map (fun i ->
let x = fct !env i
env := fst x
snd x)
!env, res
let rec renExpr env =
let mapper _ = function
| Var v -> Var (defaultArg (Map.tryFind v env.map) v)
| e -> e
mapExpr (mapEnv mapper id)
let renDecl isTopLevel env (ty:Type, vars) : Env * Decl =
let aux env decl =
let env, newName =
let ext =
match ty.typeQ with
| Some tyQ -> ["in"; "out"; "attribute"; "varying"; "uniform"]
|> List.exists (fun s -> tyQ.Contains(s))
| None -> false
if isTopLevel && (ext || hlsl || Ast.preserveAllGlobals) then
if Ast.preserveExternals then
{env with reusable = List.filter ((<>)decl.name) env.reusable}, decl.name
else
let env, newName = newId env decl.name
CGen.export "" decl.name newName // TODO: first argument seems now useless
env, newName
else
newId env decl.name
let init = Option.map (renExpr env) decl.init
env, {decl with name=newName; init=init}
let env, res = renList env aux vars
env, (ty, res)
// "Garbage collection": remove names that are not used in the block
// so that we can reuse them.
let garbage (env: Env) block =
let d = HashSet()
let collect mEnv = function
| Var id as e ->
if not (mEnv.vars.ContainsKey(id)) then d.Add id |> ignore
e
| FunCall(Var id, li) as e ->
match env.fct.TryFind id with
| Some m -> if not (m.ContainsKey li.Length) then d.Add id |> ignore
| None -> d.Add id |> ignore
e
| e -> e
mapInstr (mapEnv collect id) block |> ignore
let set = HashSet(Seq.choose env.map.TryFind d)
let map, reusable = Map.partition (fun _ id -> set.Contains id) env.map
let reusable = reusable |> Seq.filter (fun x -> not (List.exists ((=) x.Value) Ast.noRenamingList))
let merge = [for i in reusable -> i.Value] @ env.reusable |> Seq.distinct |> Seq.toList // |> List.sort
{env with map=map; reusable=merge}
let rec renInstr env =
let renOpt o = Option.map (renExpr env) o
function
| Expr e -> env, Expr (renExpr env e)
| Decl d ->
let env, res = renDecl false env d
env, Decl res
| Block b as i ->
//let env = garbage env i
let _, res = renList env renInstr b
env, Block res
| If(cond, th, el) ->
let _, th = renInstr env th
let el = Option.map (fun x -> snd (renInstr env x)) el
env, If(renExpr env cond, th, el)
| ForD(init, cond, inc, body) as loop ->
//let newEnv = garbage env loop
let newEnv, init = renDecl false env init
let _, body = renInstr newEnv body
let cond = Option.map (renExpr newEnv) cond
let inc = Option.map (renExpr newEnv) inc
if hlsl then newEnv, ForD(init, renOpt cond, renOpt inc, body)
else env, ForD(init, renOpt cond, renOpt inc, body)
| ForE(init, cond, inc, body) ->
let _, body = renInstr env body
env, ForE(renOpt init, renOpt cond, renOpt inc, body)
| While(cond, body) ->
let _, body = renInstr env body
env, While(renExpr env cond, body)
| DoWhile(cond, body) ->
let _, body = renInstr env body
env, DoWhile(renExpr env cond, body)
| Keyword(k, e) -> env, Keyword(k, renOpt e)
| Verbatim _ as v -> env, v
let rec renTopLevelName env = function
| TLDecl d ->
let env, res = renDecl true env d
env, TLDecl res
| Function(fct, body) ->
let env, res = renFctName env fct
env, Function(res, body)
| e -> env, e
let rec renTopLevelBody env = function
| Function(fct, body) ->
let env = garbage env body
let env, args = renList env (renDecl false) fct.args
let env, body = renInstr env body
Function({fct with args=args}, body)
| e -> e
// Remove the values from the env
// so that the functions are not overloaded
let rec doNotOverload env = function
| [] -> env
| name::li ->
let re = env.reusable |> List.filter (fun x -> x <> name)
let env = {env with map = Map.add name name env.map; reusable = re}
doNotOverload env li
let rec renTopLevel li =
let idents = Printer.identTable |> Array.toList
|> List.filter (fun x -> x.Length = 1)
|> List.filter (fun x -> not <| List.exists ((=) x) Ast.forbiddenNames)
// Rename top-level values first
let env = {map = Map.empty ; max = 0 ; fct = Map.empty ; reusable = idents}
let env = doNotOverload env doNotOverloadList
let env, li = renList env renTopLevelName li
// Then, rename local values
List.map (renTopLevelBody env) li, numberOfUsedIdents-1

View File

@@ -0,0 +1,322 @@
module Rewriter
open System
open System.Collections.Generic
open Ast
(* ** Rewrite tricks ** *)
let renameField field =
let transform = function
| 'r' | 'x' | 's' -> fieldNames.[0]
| 'g' | 'y' | 't' -> fieldNames.[1]
| 'b' | 'z' | 'p' -> fieldNames.[2]
| 'a' | 'w' | 'q' -> fieldNames.[3]
| c -> failwithf "Internal error: transform('%c')" c
if Seq.forall (fun c -> Seq.exists ((=) c) "rgba") field ||
Seq.forall (fun c -> Seq.exists ((=) c) "xyzw") field ||
Seq.forall (fun c -> Seq.exists ((=) c) "stpq") field
then
field |> String.map transform
else field
// Remove useless spaces in macros
let stripSpaces str =
let result = Text.StringBuilder()
let last = ref '\n'
let write c =
last := c
result.Append(c) |> ignore
let isId c = Char.IsLetterOrDigit c || c = '_' || c = '('
// hack because we can't remove space in "#define foo (1+1)"
let mutable space = false
let mutable macro = false
for c in str do
if c = '\n' then
if macro then write '\n'
else space <- true
macro <- false
elif Char.IsWhiteSpace(c) then
space <- true
else
if not macro && c = '#' then
macro <- true
if !last <> '\n' then write '\n'
if space && isId c && isId (!last) then
write ' '
write c
space <- false
if macro then result.Append("\n") |> ignore
result.ToString()
let bool = function
| true -> Var "true" // Int (1, "")
| false -> Var "false" // Int (0, "")
let rec expr env = function
| FunCall(Var "-", [Int (i1, su)]) -> Int (-i1, su)
| FunCall(Var "-", [FunCall(Var "-", [e])]) -> e
| FunCall(Var "+", [e]) -> e
| FunCall(Var ",", [e1; FunCall(Var ",", [e2; e3])]) ->
FunCall(Var ",", [expr env (FunCall(Var ",", [e1; e2])); e3])
// Boolean simplifications (let's ignore the suffix)
| FunCall(Var "<", [Int (i1, _); Int (i2, _)]) -> bool(i1 < i2)
| FunCall(Var ">", [Int (i1, _); Int (i2, _)]) -> bool(i1 > i2)
| FunCall(Var "<=", [Int (i1, _); Int (i2, _)]) -> bool(i1 <= i2)
| FunCall(Var ">=", [Int (i1, _); Int (i2, _)]) -> bool(i1 <= i2)
| FunCall(Var "==", [Int (i1, _); Int (i2, _)]) -> bool(i1 = i2)
| FunCall(Var "!=", [Int (i1, _); Int (i2, _)]) -> bool(i1 <> i2)
| FunCall(Var "<", [Float (i1,_); Float (i2,_)]) -> bool(i1 < i2)
| FunCall(Var ">", [Float (i1,_); Float (i2,_)]) -> bool(i1 > i2)
| FunCall(Var "<=", [Float (i1,_); Float (i2,_)]) -> bool(i1 <= i2)
| FunCall(Var ">=", [Float (i1,_); Float (i2,_)]) -> bool(i1 <= i2)
| FunCall(Var "==", [Float (i1,_); Float (i2,_)]) -> bool(i1 = i2)
| FunCall(Var "!=", [Float (i1,_); Float (i2,_)]) -> bool(i1 <> i2)
// Stupid simplifications (they can be useful to simplify rewritten code)
| FunCall(Var "/", [e; Float (1.,_)]) -> e
| FunCall(Var "*", [e; Float (1.,_)]) -> e
| FunCall(Var "*", [Float (1.,_); e]) -> e
| FunCall(Var "*", [_; Float (0.,_) as e]) -> e
| FunCall(Var "*", [Float (0.,_) as e; _]) -> e
| FunCall(Var "+", [e; Float (0.,_)]) -> e
| FunCall(Var "+", [Float (0.,_); e]) -> e
| FunCall(Var "-", [e; Float (0.,_)]) -> e
| FunCall(Var "-", [Float (0.,_); e]) -> FunCall(Var "-", [e])
// No simplification when numbers have different suffixes
| FunCall(_, [Int (_, su1); Int (_, su2)]) as e when su1 <> su2 -> e
| FunCall(_, [Float (_, su1); Float (_, su2)]) as e when su1 <> su2 -> e
| FunCall(Var "-", [Int (i1, su); Int (i2, _)]) -> Int (i1 - i2, su)
| FunCall(Var "+", [Int (i1, su); Int (i2, _)]) -> Int (i1 + i2, su)
| FunCall(Var "*", [Int (i1, su); Int (i2, _)]) -> Int (i1 * i2, su)
| FunCall(Var "/", [Int (i1, su); Int (i2, _)]) -> Int (i1 / i2, su)
| FunCall(Var "mod", [Int (i1, su); Int (i2, _)]) -> Int (i1 % i2, su)
| FunCall(Var "-", [Float (f1,su)]) -> Float (-f1, su)
| FunCall(Var "-", [Float (i1,su); Float (i2,_)]) -> Float (i1 - i2, su)
| FunCall(Var "+", [Float (i1,su); Float (i2,_)]) -> Float (i1 + i2, su)
| FunCall(Var "*", [Float (i1,su); Float (i2,_)]) -> Float (i1 * i2, su)
| FunCall(Var "/", [Float (i1,su); Float (i2,_)]) as e ->
let div = Float (i1 / i2, su)
if (Printer.exprToS e).Length <= (Printer.exprToS div).Length then e
else div
| FunCall(Var "smoothstep", [Float (0.,_); Float (1.,_); _]) as e -> e
| FunCall(Var "smoothstep", [a; b; x]) when Ast.smoothstepTrick ->
let sub1 = FunCall(Var "-", [x; a])
let sub2 = FunCall(Var "-", [b; a])
let div = FunCall(Var "/", [sub1; sub2]) |> mapExpr env
FunCall(Var "smoothstep", [Float (0.,""); Float (1.,""); div])
| Dot(e, field) when fieldNames <> "" -> Dot(e, renameField field)
| Var s as e when s.StartsWith("i_") ->
match Map.tryFind s env.vars with
| Some (ty, size, Some init) -> init
| _ -> e
| e -> e
// Squeeze declarations: "float a=2.; float b;" => "float a=2.,b;"
let rec squeezeDeclarations = function
|[]-> []
|Decl(ty1, li1) :: Decl(ty2, li2) :: l when ty1 = ty2 ->
squeezeDeclarations (Decl(ty1, li1 @ li2) :: l)
|e::l -> e :: squeezeDeclarations l
// Squeeze top-level declarations, e.g. uniforms
let rec squeezeTLDeclarations = function
|[]-> []
|TLDecl(ty1, li1) :: TLDecl(ty2, li2) :: l when ty1 = ty2 ->
squeezeTLDeclarations (TLDecl(ty1, li1 @ li2) :: l)
|e::l -> e :: squeezeTLDeclarations l
let rwTypeSpec = function
| TypeName n -> TypeName (stripSpaces n)
| x -> x // structs
let rwType (ty: Type) =
makeType (rwTypeSpec ty.name) (Option.map stripSpaces ty.typeQ)
let instr = function
| Block [] as e -> e
| Block b ->
// Remove dead code after return/break/...
let endOfCode = Seq.tryFindIndex (function Keyword(_, _) -> true | _ -> false) b
let b = match endOfCode with None -> b | Some x -> b |> Seq.truncate (x+1) |> Seq.toList
// Remove inner empty blocks
let b = b |> List.filter (function Block [] -> false | _ -> true)
// Try to remove blocks by using the comma operator
let returnExp = b |> Seq.tryPick (function Keyword("return", e) -> e | _ -> None)
let canOptimize = b |> List.forall (function
| Expr _ -> true | Keyword("return", Some e) -> true | _ -> false)
if not Ast.noSequence && canOptimize then
let li = List.choose (function Expr e -> Some e | _ -> None) b
match returnExp with
| None -> Expr (List.reduce (fun acc x -> FunCall(Var ",", [acc;x])) li)
| Some e ->
let expr = List.reduce (fun acc x -> FunCall(Var ",", [acc;x])) (li@[e])
Keyword("return", Some expr)
else
Block (squeezeDeclarations b)
| Decl (ty, li) -> Decl (rwType ty, li |> List.filter (fun x -> not (x.name.StartsWith("i_"))))
| ForD((ty, d), cond, inc, body) ->
let d = d |> List.filter (fun x -> not (x.name.StartsWith("i_")))
ForD((rwType ty, d), cond, inc, body)
// FIXME: properly handle booleans
| If(Var "true", e1, e2) -> e1
| If(Var "false", e1, Some e2) -> e2
| If(Var "false", e1, None) -> Block []
| Verbatim s -> Verbatim (stripSpaces s)
| e -> e
let reorderTopLevel t =
if reorderDeclarations then
let externals, functions = List.partition (function TLDecl _ -> true | _ -> false) t
List.sort externals @ functions
else
t
let apply li =
li
|> reorderTopLevel
|> mapTopLevel (mapEnv expr instr)
|> List.map (function
| TLDecl (ty, li) ->
TLDecl (rwType ty, li |> List.filter (fun x -> not (x.name.StartsWith("i_"))))
| TLVerbatim s -> TLVerbatim (stripSpaces s)
| e -> e
)
|> squeezeTLDeclarations
(* ** Macro creation ** *)
let macroCount = Dictionary()
let addWord str =
if str <> "" then
match macroCount.TryGetValue str with
| true, n -> macroCount.Remove str |> ignore; macroCount.Add(str, (n + 1))
| false, _ -> macroCount.Add(str, 1)
let macroExpr _ expr =
match expr with
| Var s when System.Char.IsLetter s.[0] -> addWord s
| Int _ -> addWord (Printer.exprToS expr)
| Float _ -> addWord (Printer.exprToS expr)
| _ -> ()
expr
let macroTy (ty:Type) =
match ty.name with TypeName s -> addWord s | TypeStruct _ -> () // FIXME
addWord (defaultArg ty.typeQ "")
let macroInstr expr =
match expr with
| Decl (ty, _) -> macroTy ty
| If(_, _, el) -> addWord "if"; if el <> None then addWord "else"
| ForD((ty, _), _, _, _) -> macroTy ty; addWord "for"
| ForE(_, _, _, _) -> addWord "for"
| While(_, _) -> addWord "while"
| DoWhile(_, _) -> addWord "do"; addWord "while"
| Keyword(k, _) -> addWord k
| _ -> ()
expr
let macroTL = function
| Function(fct, _) ->
List.iter (fst >> macroTy) fct.args
macroTy fct.retType
| TLDecl (ty, _) -> macroTy ty
| _ -> ()
let injectMacros numberOfIdent code =
macroCount.Clear()
generatedMacros.Clear()
List.iter macroTL code
mapTopLevel (mapEnv macroExpr macroInstr) code |> ignore
let macroLen = "#define \n".Length
let mutable name = numberOfIdent
for i in macroCount do
let oldLen = i.Value * i.Key.Length
// check if we still have 1-char names available
let newIdentSize = if name > 26 * 2 then 2 else 1
let newLen = macroLen + i.Key.Length + newIdentSize * i.Value
//printfn "%s: %d vs %d" i.Key oldLen newLen
if oldLen - newLen >= macroThreshold then
name <- name + 1
generatedMacros.Add(i.Key, name)
let macros = [for i in generatedMacros ->
TLVerbatim(sprintf "define %s %s" Printer.identTable.[i.Value] i.Key)]
macros @ code, name - numberOfIdent
(* Reorder functions because of forward declarations *)
let rec findRemove callback = function
| (name, [], content) :: l ->
//printfn "=> %s" name
callback name content
l
| [] -> failwith "Cannot reorder functions (probably because of a recursion)."
| x :: l -> x :: findRemove callback l
// slow, but who cares?
let graphReorder deps =
let list = ref []
let lastName = ref ""
let rec loop deps =
let deps = findRemove (fun s x -> lastName := s; list := x :: !list) deps
let deps = deps |> List.map (fun (n, d, c) -> n, List.filter ((<>) !lastName) d, c)
if deps <> [] then loop deps
loop deps
!list |> List.rev
// get the list of external values the block depends on
let computeDependencies block =
let d = HashSet()
let collect mEnv = function
| Var id as e ->
if not (mEnv.vars.ContainsKey(id)) then d.Add id |> ignore
e
| e -> e
mapInstr (mapEnv collect id) block |> ignore
d |> Seq.toList
// This function assumes that functions are NOT overloaded
let computeAllDependencies code =
let fct = code |> List.choose (function
| Function(fct, block) as f -> Some (fct.fName, block, f)
| _ -> None)
let deps = fct |> List.map (fun (name, block, f) ->
let dep = computeDependencies block
|> List.filter (fun name -> List.exists (fun (x,_,_) -> name = x) fct)
name, dep, f)
deps
// reorder functions if there were forward declarations
let reorder code =
if Ast.reorderFunctions then
if Ast.verbose then
printfn "Reordering functions because of forward declarations."
let order = code |> computeAllDependencies |> graphReorder
let rest = code |> List.filter (function Function _ -> false | _ -> true)
rest @ order
else
code

View File

@@ -0,0 +1,43 @@
uniform vec2 resolution;
uniform float time;
float h(vec3 q)
{
float f=1.*distance(q,vec3(cos(time)+sin(time*.2),.3,2.+cos(time*.5)*.5));
f*=distance(q,vec3(-cos(time*.7),.3,2.+sin(time*.5)));
f*=distance(q,vec3(-sin(time*.2)*.5,sin(time),2.));
f*=cos(q.y)*cos(q.x)-.1-cos(q.z*7.+time*7.)*cos(q.x*3.)*cos(q.y*4.)*.1;
return f;
}
void main()
{
vec2 p = -1.0 + 2.0 * gl_FragCoord.xy / resolution.xy;
vec3 o=vec3(p.x,p.y*1.25-0.3,0.);
vec3 d=vec3(p.x+cos(time)*0.3,p.y,1.)/64.;
vec4 c=vec4(0.);
float t=0.;
for(int i=0;i<75;i++)
{
if(h(o+d*t)<.4)
{
t-=5.;
for(int j=0;j<5;j++)
{
if(h(o+d*t)<.4)
break;
t+=1.;
}
vec3 e=vec3(.01,.0,.0);
vec3 n=vec3(.0);
n.x=h(o+d*t)-h(vec3(o+d*t+e.xyy));
n.y=h(o+d*t)-h(vec3(o+d*t+e.yxy));
n.z=h(o+d*t)-h(vec3(o+d*t+e.yyx));
n=normalize(n);
c+=max(dot(vec3(.0,.0,-.5),n),.0)+max(dot(vec3(.0,-.5,.5),n),.0)*.5;
break;
}
t+=5.;
}
gl_FragColor=c+vec4(.1,.2,.5,1.)*(t*.025);
}

Some files were not shown because too many files have changed in this diff Show More