summaryrefslogtreecommitdiff
path: root/Util/VS2010
diff options
context:
space:
mode:
authorGravatar Rustan Leino <unknown>2013-03-05 16:58:16 -0800
committerGravatar Rustan Leino <unknown>2013-03-05 16:58:16 -0800
commitc819fabbb8da669952cb7e2e5937c73ff6dcfabe (patch)
treefdfa5ecd7ef81709608d5dcb5ba232611c1b073f /Util/VS2010
parentf82dab21f1240fb3f8d67a880f4f93017d85c345 (diff)
Removed Dafny, Jennisys, Chalice, and BCT, which now live in different Codeplex repositories.
Diffstat (limited to 'Util/VS2010')
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService.sln20
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/ChaliceLanguageService.csproj179
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/Configuration.cs24
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/GlobalSuppressions.cs11
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/Grammar.cs399
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/Guids.cs13
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/Integration/AuthoringScope.cs66
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/Integration/Configuration.cs116
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/Integration/Declaration.cs30
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/Integration/Declarations.cs56
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/Integration/IASTResolver.cs13
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/Integration/IronyLanguageService.cs347
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/Integration/IronyViewFilter.cs42
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/Integration/LineScanner.cs58
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/Integration/Method.cs20
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/Integration/Methods.cs50
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/Integration/Package.cs130
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/Integration/Resolver.cs50
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/Integration/Source.cs41
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/IronyLanguageServicePackage.cs91
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/Key.snkbin596 -> 0 bytes
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/Properties/AssemblyInfo.cs36
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/Resources.Designer.cs63
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/Resources.resx130
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/Resources/Irony.dllbin236032 -> 0 bytes
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/VSPackage.resx129
-rw-r--r--Util/VS2010/Chalice/ChaliceLanguageService/source.extension.vsixmanifest27
-rw-r--r--Util/VS2010/Chalice/StartChalice.bat10
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService.sln20
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/Configuration.cs24
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/DafnyLanguageService.csproj179
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/GlobalSuppressions.cs11
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/Grammar.cs388
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/Guids.cs13
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/Integration/AuthoringScope.cs66
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/Integration/Configuration.cs116
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/Integration/Declaration.cs30
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/Integration/Declarations.cs56
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/Integration/IASTResolver.cs13
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/Integration/IronyLanguageService.cs373
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/Integration/IronyViewFilter.cs42
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/Integration/LineScanner.cs58
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/Integration/Method.cs20
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/Integration/Methods.cs50
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/Integration/Package.cs130
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/Integration/Resolver.cs50
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/Integration/Source.cs41
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/IronyLanguageServicePackage.cs90
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/Key.snkbin596 -> 0 bytes
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/Properties/AssemblyInfo.cs36
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/Resources.Designer.cs63
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/Resources.resx130
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/Resources/Irony.dllbin236032 -> 0 bytes
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/VSPackage.resx129
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/source.extension.vsixmanifest27
-rw-r--r--Util/VS2010/Dafny/StartDafny.bat10
-rw-r--r--Util/VS2010/DafnyExtension/DafnyExtension.sln20
-rw-r--r--Util/VS2010/DafnyExtension/DafnyExtension/BraceMatching.cs253
-rw-r--r--Util/VS2010/DafnyExtension/DafnyExtension/BufferIdleEventUtil.cs155
-rw-r--r--Util/VS2010/DafnyExtension/DafnyExtension/ClassificationTagger.cs107
-rw-r--r--Util/VS2010/DafnyExtension/DafnyExtension/ContentType.cs18
-rw-r--r--Util/VS2010/DafnyExtension/DafnyExtension/DafnyDriver.cs419
-rw-r--r--Util/VS2010/DafnyExtension/DafnyExtension/DafnyExtension.csproj191
-rw-r--r--Util/VS2010/DafnyExtension/DafnyExtension/ErrorTagger.cs85
-rw-r--r--Util/VS2010/DafnyExtension/DafnyExtension/HoverText.cs126
-rw-r--r--Util/VS2010/DafnyExtension/DafnyExtension/IdentifierTagger.cs344
-rw-r--r--Util/VS2010/DafnyExtension/DafnyExtension/OutliningTagger.cs185
-rw-r--r--Util/VS2010/DafnyExtension/DafnyExtension/ProgressMargin.cs260
-rw-r--r--Util/VS2010/DafnyExtension/DafnyExtension/Properties/AssemblyInfo.cs33
-rw-r--r--Util/VS2010/DafnyExtension/DafnyExtension/ResolverTagger.cs321
-rw-r--r--Util/VS2010/DafnyExtension/DafnyExtension/TokenTagger.cs342
-rw-r--r--Util/VS2010/DafnyExtension/DafnyExtension/WordHighlighter.cs211
-rw-r--r--Util/VS2010/DafnyExtension/DafnyExtension/source.extension.vsixmanifest25
73 files changed, 0 insertions, 7411 deletions
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService.sln b/Util/VS2010/Chalice/ChaliceLanguageService.sln
deleted file mode 100644
index dfda1244..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService.sln
+++ /dev/null
@@ -1,20 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChaliceLanguageService", "ChaliceLanguageService\ChaliceLanguageService.csproj", "{66E611EE-84D8-4EB9-9A33-164A53E00553}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {66E611EE-84D8-4EB9-9A33-164A53E00553}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {66E611EE-84D8-4EB9-9A33-164A53E00553}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {66E611EE-84D8-4EB9-9A33-164A53E00553}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {66E611EE-84D8-4EB9-9A33-164A53E00553}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/ChaliceLanguageService.csproj b/Util/VS2010/Chalice/ChaliceLanguageService/ChaliceLanguageService.csproj
deleted file mode 100644
index 44a36137..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/ChaliceLanguageService.csproj
+++ /dev/null
@@ -1,179 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Demo.ChaliceLanguageService</RootNamespace>
- <AssemblyName>ChaliceLanguageService</AssemblyName>
- <SignAssembly>True</SignAssembly>
- <AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <ProjectGuid>{66E611EE-84D8-4EB9-9A33-164A53E00553}</ProjectGuid>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>4.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- <PublishUrl>publish\</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Disk</InstallFrom>
- <UpdateEnabled>false</UpdateEnabled>
- <UpdateMode>Foreground</UpdateMode>
- <UpdateInterval>7</UpdateInterval>
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>
- <UpdatePeriodically>false</UpdatePeriodically>
- <UpdateRequired>false</UpdateRequired>
- <MapFileExtensions>true</MapFileExtensions>
- <ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <IsWebBootstrapper>false</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
- <TargetFrameworkProfile />
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <RunCodeAnalysis>true</RunCodeAnalysis>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Irony, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ca48ace7223ead47, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>Resources\Irony.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.VisualStudio.OLE.Interop" />
- <Reference Include="Microsoft.VisualStudio.Package.LanguageService.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>C:\Program Files\Microsoft Visual Studio 2010 Beta2 SDK\VisualStudioIntegration\Common\Assemblies\Microsoft.VisualStudio.Package.LanguageService.10.0.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.VisualStudio.Shell.10.0">
- <HintPath>C:\Program Files\Microsoft Visual Studio 2010 Beta2 SDK\VisualStudioIntegration\Common\Assemblies\Microsoft.VisualStudio.Shell.10.0.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>C:\Program Files\Microsoft Visual Studio 2010 Beta2 SDK\VisualStudioIntegration\Common\Assemblies\Microsoft.VisualStudio.Shell.Immutable.10.0.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.VisualStudio.Shell.Interop" />
- <Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <SpecificVersion>False</SpecificVersion>
- <EmbedInteropTypes>True</EmbedInteropTypes>
- <HintPath>C:\Program Files\Microsoft Visual Studio 2010 Beta2 SDK\VisualStudioIntegration\Common\Assemblies\Microsoft.VisualStudio.Shell.Interop.10.0.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0" />
- <Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0" />
- <Reference Include="Microsoft.VisualStudio.TextManager.Interop" />
- <Reference Include="Microsoft.VisualStudio.TextManager.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\..\..\Program Files\Microsoft Visual Studio 2008 SDK\VisualStudioIntegration\Common\Assemblies\Microsoft.VisualStudio.TextManager.Interop.8.0.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Design" />
- <Reference Include="System.Drawing" />
- <Reference Include="System.Windows.Forms" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Configuration.cs" />
- <Compile Include="Grammar.cs" />
- <Compile Include="Guids.cs" />
- <Compile Include="Integration\AuthoringScope.cs" />
- <Compile Include="Integration\Configuration.cs" />
- <Compile Include="Integration\Declaration.cs" />
- <Compile Include="Integration\Declarations.cs" />
- <Compile Include="Integration\IASTResolver.cs" />
- <Compile Include="Integration\IronyViewFilter.cs" />
- <Compile Include="Integration\IronyLanguageService.cs" />
- <Compile Include="Integration\LineScanner.cs" />
- <Compile Include="Integration\Method.cs" />
- <Compile Include="Integration\Methods.cs" />
- <Compile Include="Integration\Package.cs" />
- <Compile Include="Integration\Resolver.cs" />
- <Compile Include="Integration\Source.cs" />
- <Compile Include="Resources.Designer.cs">
- <AutoGen>True</AutoGen>
- <DesignTime>True</DesignTime>
- <DependentUpon>Resources.resx</DependentUpon>
- </Compile>
- <Compile Include="GlobalSuppressions.cs" />
- <Compile Include="IronyLanguageServicePackage.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <EmbeddedResource Include="Resources.resx">
- <Generator>ResXFileCodeGenerator</Generator>
- <LastGenOutput>Resources.Designer.cs</LastGenOutput>
- <SubType>Designer</SubType>
- </EmbeddedResource>
- <EmbeddedResource Include="VSPackage.resx">
- <MergeWithCTO>true</MergeWithCTO>
- <SubType>Designer</SubType>
- </EmbeddedResource>
- </ItemGroup>
- <ItemGroup>
- <Content Include="Resources\Irony.dll" />
- <None Include="source.extension.vsixmanifest" />
- </ItemGroup>
- <ItemGroup>
- <None Include="Key.snk" />
- </ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.VisualBasic.PowerPacks.10.0">
- <Visible>False</Visible>
- <ProductName>Microsoft Visual Basic PowerPacks 10.0</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
- <Visible>False</Visible>
- <ProductName>Windows Installer 3.1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- </ItemGroup>
- <PropertyGroup>
- <!--
- To specify a different registry root to register your package, uncomment the TargetRegistryRoot
- tag and specify a registry root in it.
- <TargetRegistryRoot></TargetRegistryRoot>
- -->
- <RegisterOutputPackage>true</RegisterOutputPackage>
- <RegisterWithCodebase>true</RegisterWithCodebase>
- </PropertyGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\VSSDK\Microsoft.VsSDK.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project> \ No newline at end of file
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/Configuration.cs b/Util/VS2010/Chalice/ChaliceLanguageService/Configuration.cs
deleted file mode 100644
index e5b10f00..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/Configuration.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Microsoft.VisualStudio.Package;
-using Microsoft.VisualStudio.TextManager.Interop;
-
-namespace Demo
-{
- public static partial class Configuration
- {
- public const string Name = "Chalice";
- public const string FormatList = "Chalice File (*.chalice)\n*.chalice";
-
- static Configuration()
- {
- // default colors - currently, these need to be declared
- CreateColor("Keyword", COLORINDEX.CI_BLUE, COLORINDEX.CI_USERTEXT_BK);
- CreateColor("Comment", COLORINDEX.CI_DARKGREEN, COLORINDEX.CI_USERTEXT_BK);
- CreateColor("Identifier", COLORINDEX.CI_SYSPLAINTEXT_FG, COLORINDEX.CI_USERTEXT_BK);
- CreateColor("String", COLORINDEX.CI_MAROON, COLORINDEX.CI_USERTEXT_BK);
- CreateColor("Number", COLORINDEX.CI_MAROON, COLORINDEX.CI_USERTEXT_BK);
- CreateColor("Text", COLORINDEX.CI_SYSPLAINTEXT_FG, COLORINDEX.CI_USERTEXT_BK);
- }
- }
-} \ No newline at end of file
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/GlobalSuppressions.cs b/Util/VS2010/Chalice/ChaliceLanguageService/GlobalSuppressions.cs
deleted file mode 100644
index f0857cbb..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/GlobalSuppressions.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// This file is used by Code Analysis to maintain SuppressMessage
-// attributes that are applied to this project. Project-level
-// suppressions either have no target or are given a specific target
-// and scoped to a namespace, type, member, etc.
-//
-// To add a suppression to this file, right-click the message in the
-// Error List, point to "Suppress Message(s)", and click "In Project
-// Suppression File". You do not need to add suppressions to this
-// file manually.
-
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1017:MarkAssembliesWithComVisible")]
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/Grammar.cs b/Util/VS2010/Chalice/ChaliceLanguageService/Grammar.cs
deleted file mode 100644
index 8a05d7b2..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/Grammar.cs
+++ /dev/null
@@ -1,399 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Irony.Parsing;
-
-namespace Demo
-{
- [Language("Chalice", "1.0", "Chalice Programming Language")]
- public class Grammar : Irony.Parsing.Grammar
- {
- public Grammar() {
- #region 1. Terminals
- NumberLiteral n = TerminalFactory.CreateCSharpNumber("number");
- StringLiteral s = new StringLiteral("String", "\"", StringFlags.AllowsAllEscapes);
- IdentifierTerminal ident = new IdentifierTerminal("Identifier");
-
- // Copy pasted directly from Parser.scala
- string[] reserved = new string[] {
- "class", "ghost", "var", "const", "method", "channel", "condition",
- "assert", "assume", "new", "this", "reorder",
- "between", "and", "above", "below", "share", "unshare", "acquire", "release", "downgrade",
- "lock", "fork", "join", "rd", "acc", "credit", "holds", "old", "assigned",
- "call", "if", "else", "while",
- "invariant", "lockchange",
- "returns", "requires", "ensures", "where",
- "int", "bool", "false", "true", "null", "string", "waitlevel", "lockbottom",
- "module", "external",
- "predicate", "function", "free", "send", "receive",
- "ite", "fold", "unfold", "unfolding", "in", "forall", "exists",
- "seq", "nil", "result", "eval", "token",
- "wait", "signal",
- "refines", "transforms", "replaces", "by", "spec"
- };
-
- string[] delimiters = new string[] {
- "(", ")", "{", "}", "[[", "]]",
- "<==>", "==>", "&&", "||",
- "==", "!=", "<", "<=", ">=", ">", "<<", "in", "!in",
- "+", "-", "*", "/", "%", "!", ".", "..",
- ";", ":", ":=", ",", "?", "|", "[", "]", "++", "::",
- "_"
- };
-
- this.MarkReservedWords(reserved);
-
- Terminal Comment = new CommentTerminal("Comment", "/*", "*/");
- NonGrammarTerminals.Add(Comment);
- Terminal LineComment = new CommentTerminal("LineComment", "//", "\n");
- NonGrammarTerminals.Add(LineComment);
-
- #endregion
-
- #region Disabled for a simpler grammar
- /*
- Terminal dot = ToTerm(".", "dot");
- Terminal less = ToTerm("<");
- Terminal greater = ToTerm(">");
- Terminal arrow = ToTerm("->");
- Terminal LBracket = ToTerm("[");
- Terminal RBracket = ToTerm("]");
- Terminal LParen = ToTerm("(");
- Terminal RParen = ToTerm(")");
- Terminal RCurly = ToTerm("}");
- Terminal LCurly = ToTerm("{");
- Terminal LMb = ToTerm("<[");
- Terminal RMb = ToTerm("]>");
- Terminal comma = ToTerm(",");
- Terminal semicolon = ToTerm(";");
- Terminal colon = ToTerm(":");
-
- #region 2. Non-terminals
- #region 2.1 Expressions
- NonTerminal expression = new NonTerminal("Expr");
- NonTerminal BinOp = new NonTerminal("BinOp");
- NonTerminal LUnOp = new NonTerminal("LUnOp");
- NonTerminal RUnOp = new NonTerminal("RUnOp");
-
- NonTerminal ArrayConstructor = new NonTerminal("ArrayConstructor");
- NonTerminal MObjectConstructor = new NonTerminal("MObjectConstructor");
- NonTerminal MObjectList = new NonTerminal("MObjectList");
- #endregion
-
- #region 2.2 QualifiedName
- //Expression List: expr1, expr2, expr3, ..
- NonTerminal expressionList = new NonTerminal("ExprList");
- NonTerminal identList = new NonTerminal("identList");
- //A name in form: a.b.c().d[1,2].e ....
- NonTerminal NewStmt = new NonTerminal("NewStmt");
- NonTerminal NewArrStmt = new NonTerminal("NewArrStmt");
- NonTerminal QualifiedName = new NonTerminal("QualifiedName");
- NonTerminal AccessQualName = new NonTerminal("AccessQualName");
- NonTerminal GenericsPostfix = new NonTerminal("GenericsPostfix");
- NonTerminal ArrayExpression = new NonTerminal("ArrayExpression");
- NonTerminal FunctionExpression = new NonTerminal("FunctionExpression");
- NonTerminal selectExpr = new NonTerminal("selectExpr");
- NonTerminal accessExpr = new NonTerminal("accessExpr");
- #endregion
-
- #region 2.3 Statement
- NonTerminal Condition = new NonTerminal("Condition");
-
- NonTerminal Statement = new NonTerminal("Statement");
- NonTerminal Statements = new NonTerminal("Statements");
-
- //Block
- NonTerminal blockStatement = new NonTerminal("CompoundStatement");
- #endregion
-
- #region 2.4 Program and Functions
- NonTerminal Prog = new NonTerminal("Prog");
- NonTerminal declaration = new NonTerminal("declaration");
- NonTerminal classDecl = new NonTerminal("class decl");
- NonTerminal memberDecl = new NonTerminal("member decl");
- NonTerminal fieldDecl = new NonTerminal("field declaration");
- NonTerminal idType = new NonTerminal("identifier type");
- NonTerminal typeDecl = new NonTerminal("type reference");
- NonTerminal methodDecl = new NonTerminal("method declaration");
- NonTerminal formalParameters = new NonTerminal("formals");
- NonTerminal methodSpec = new NonTerminal("method spec");
- NonTerminal formalsList = new NonTerminal("ParamaterListOpt");
- NonTerminal functionDecl = new NonTerminal("function declaration");
- NonTerminal predicateDecl = new NonTerminal("predicate declaration");
- NonTerminal invariantDecl = new NonTerminal("invariant declaration");
- NonTerminal Semi = new NonTerminal("semi");
- NonTerminal Rhs = new NonTerminal("right-hand side");
- NonTerminal FieldInit = new NonTerminal("field init");
- NonTerminal FieldInits = new NonTerminal("field inits");
- NonTerminal installBounds = new NonTerminal("installBounds");
- NonTerminal localVarStmt = new NonTerminal("localVarStmt");
- NonTerminal evalstate = new NonTerminal("evalstate");
- NonTerminal channelDecl = new NonTerminal("channel declaration");
- NonTerminal loopSpec = new NonTerminal("loop specification");
- NonTerminal rdPermArg = new NonTerminal("rdPermArg");
- #endregion
-
- #endregion
-
- #region 3. BNF rules
-
- Semi.Rule = semicolon;
-
- #region 3.1 Expressions
- selectExpr.Rule = (ToTerm("this") + ".").Q() + QualifiedName;
- accessExpr.Rule = (ToTerm("this") + ".").Q() + AccessQualName;
- evalstate.Rule =
- ident + ToTerm(".") +
- (ToTerm("acquire")
- | "release"
- | "fork" + FunctionExpression
- )
- ;
- rdPermArg.Rule = ToTerm("*") | expression;
-
- expression.Rule = ToTerm("true")
- | "false"
- | "null"
- | "waitlevel"
- | "lockbottom"
- | "this"
- | "result"
- | s
- | n
- | QualifiedName
- // The following is needed: to parse "A<B ..." either as comparison or as beginning of GenericsPostfix
- | QualifiedName + less + expression
- //| QualifiedName + less + QualifiedName + greater
- //| NewStmt
- | NewArrStmt
- | ArrayExpression
- | FunctionExpression
- | ArrayConstructor
- | MObjectConstructor
- | expression + BinOp + expression
- | LUnOp + expression
- | expression + RUnOp
- | LMb + declaration.Star() + RMb
- | LParen + expression + RParen
- | ToTerm("unfolding") + expression + "in" + expression
- | ToTerm("acc") + "(" + accessExpr + (("," + expression) | Empty) + ")"
- | ToTerm("old") + "(" + expression + ")"
- | ToTerm("eval") + "(" + evalstate + "," + expression + ")"
- | ToTerm("credit") + "(" + expression + "," + expression + ")"
- | ToTerm("credit") + "(" + expression + ")"
- | expression + PreferShiftHere() + "?" + expression + ":" + expression
- | ToTerm("rd") +
- (ToTerm("holds") + "(" + expression + ")"
- | "(" + accessExpr + rdPermArg.Q() + ")"
- )
-
- ;
- expressionList.Rule = MakePlusRule(expressionList, comma, expression);
- identList.Rule = MakePlusRule(identList, comma, ident);
- NewStmt.Rule = "new" + QualifiedName + GenericsPostfix.Q() + LParen + expressionList.Q() + RParen;
- NewArrStmt.Rule = "new" + QualifiedName + GenericsPostfix.Q() + LBracket + expressionList.Q() + RBracket;
- BinOp.Rule = ToTerm("+") | "-" | "*" | "/" | "%" | "^" | "&" | "|"
- | "&&" | "||" | "==" | "!=" | greater | less
- | ">=" | "<=" | "is"
- | "=" | "+=" | "-="
- | "."
- | "==>" | "<==>" | "<<"
- ;
-
- LUnOp.Rule = ToTerm("-") | "~" | "!";
- RUnOp.Rule = ToTerm("++") | "--";
-
- ArrayConstructor.Rule = LBracket + expressionList + RBracket;
- MObjectConstructor.Rule = LBracket + ident + arrow + expression + MObjectList.Star() + RBracket;
- MObjectList.Rule = comma + ident + arrow + expression;
- #endregion
-
- #region 3.2 QualifiedName
- ArrayExpression.Rule = QualifiedName + LBracket + expressionList + RBracket;
- FunctionExpression.Rule = QualifiedName + LParen + expressionList.Q() + RParen;
-
- QualifiedName.Rule = ident | QualifiedName + dot + ident;
- AccessQualName.Rule = ident | "*" | QualifiedName + dot + (ident | "*" | "[*]" + dot + "*" | "[*]" + dot + ident);
-
-
- GenericsPostfix.Rule = less + QualifiedName + greater;
-
- //ExprList.Rule = Expr.Plus(comma);
- #endregion
-
- #region 3.3 Statement
- Condition.Rule = LParen + expression + RParen;
- installBounds.Rule
- = "installBounds"
- //= ToTerm("between") + expressionList + "and" + expressionList
- //| "below" + expressionList
- //| "below" + expressionList + "above" + expressionList
- //| "above" + expressionList
- //| "above" + expressionList + "below" + expressionList
- ;
- FieldInit.Rule
- = ident + ":=" + expression
- ;
- FieldInits.Rule = MakeStarRule(FieldInits, ToTerm(","), FieldInit);
- Rhs.Rule
- = ToTerm("new") + ident
- | ToTerm("new") + ident + "{" + FieldInits + "}"
- | ToTerm("new") + ident + installBounds
- | ToTerm("new") + ident + "{" + FieldInits + "}" + installBounds
- | expression
- ;
- localVarStmt.Rule
- = idType + ":=" + Rhs + Semi
- | idType + Semi
- ;
- loopSpec.Rule
- = ToTerm("invariant") + expression + Semi
- | "lockchange" + expressionList + Semi
- ;
-
-
-
- Statement.Rule = Semi
- | "if" + Condition + Statement
- | "if" + Condition + Statement + PreferShiftHere() + "else" + Statement
- | "while" + Condition + loopSpec.Star() + Statement
- | "for" + LParen + expression.Q() + Semi + expression.Q() + Semi + expression.Q() + RParen + Statement
- | "foreach" + LParen + ident + "in" + expression + RParen + Statement
- | blockStatement
- | expression + Semi
- | "break" + Semi
- | "continue" + Semi
- | "return" + expression + Semi
- | QualifiedName + ":=" + Rhs
-
- | "var" + localVarStmt
- | "const" + localVarStmt
-
- | "call" + identList + ":=" + FunctionExpression + Semi
- | "call" + FunctionExpression + Semi
- | "assert" + expression + Semi
- | "assume" + expression + Semi
- | "unshare" + expression + Semi
- | "lock" + Condition + Statement
- | "[[" + Statements + "]]"
- | "acquire" + expression + Semi
- | "release" + expression + Semi
- | "downgrade" + expression + Semi
- | "free" + expression + Semi
- | "fold" + expression + Semi
- | "unfold" + expression + Semi
- | "reorder" + expression + installBounds + Semi
- | "reorder" + expression + Semi
- | "share" + expression + installBounds + Semi
- | "share" + expression + Semi
- | "fork" + identList + ":=" + FunctionExpression + Semi
- | "fork" + FunctionExpression + Semi
- | "join" + identList + ":=" + expression + Semi
- | "join" + expression + Semi
- | "send" + expression + Semi
- | "receive" + identList + ":=" + expression + Semi
- | "receive" + expression + Semi
-
- ;
- Statements.Rule = MakeStarRule(Statements, null, Statement);
- blockStatement.Rule = LCurly + Statements + RCurly;
-
-
- #endregion
-
- #region 3.4 Prog
- Prog.Rule = declaration.Star() + Eof;
- idType.Rule
- = ident + ":" + typeDecl
- | ident
- ;
-
- typeDecl.Rule
- = (ToTerm("int") | "bool" | ident | "seq") + (("<" + MakePlusRule(typeDecl, ToTerm(","), typeDecl) + ">") | Empty)
- | ToTerm("token") + "<" + (typeDecl + ".") + ident + ">"
- ;
-
- fieldDecl.Rule
- = ToTerm("var") + idType + Semi
- | ToTerm("ghost") + "var" + idType + Semi
- ;
-
- methodSpec.Rule = (ToTerm("requires") | "ensures" | "lockchange") + expression + Semi;
-
- formalsList.Rule = MakeStarRule(formalsList, comma, idType);
- formalParameters.Rule = LParen + formalsList + RParen;
- methodDecl.Rule = "method" + ident + formalParameters
- + (("returns" + formalParameters) | Empty)
- + methodSpec.Star()
- + blockStatement;
- functionDecl.Rule
- = ToTerm("function") + ident + formalParameters + ":" + typeDecl + methodSpec.Star() + "{" + expression + "}";
- predicateDecl.Rule
- = ToTerm("predicate") + ident + "{" + expression + "}";
- invariantDecl.Rule
- = ToTerm("invariant") + expression + Semi;
-
- memberDecl.Rule
- = fieldDecl
- | invariantDecl
- | methodDecl
- //| conditionDecl
- | predicateDecl
- | functionDecl
- ;
- classDecl.Rule
- = (ToTerm("external") | Empty) + "class" + ident + ("module" + ident | Empty) + "{" + memberDecl.Star() + "}";
- channelDecl.Rule
- = ToTerm("channel") + ident + formalParameters + "where" + expression + Semi
- | ToTerm("channel") + ident + formalParameters + Semi;
- declaration.Rule = classDecl | channelDecl
- ;
-
- #endregion
- #endregion
-
- #region 4. Set starting symbol
- this.Root = Prog; // Set grammar root
- #endregion
-
-
- #region 5. Operators precedence
- RegisterOperators(1, "=", "+=", "-=");
- RegisterOperators(2, "+", "-");
- RegisterOperators(3, "*", "/", "%");
- RegisterOperators(4, Associativity.Right, "^");
- RegisterOperators(5, "|", "||");
- RegisterOperators(6, "&", "&&");
- RegisterOperators(7, "==", "!=", ">", "<", ">=", "<=", "<<");
- RegisterOperators(8, "is");
- RegisterOperators(9, "~", "!", "++", "--");
- RegisterOperators(10, "==>", "<==>");
- RegisterOperators(11, ".");
-
- //RegisterOperators(10, Associativity.Right, ".",",", ")", "(", "]", "[", "{", "}");
- //RegisterOperators(11, Associativity.Right, "else");
- #endregion
-
- #region 6. Punctuation symbols
- RegisterPunctuation("(", ")", "[", "]", "{", "}", ",", ";");
- #endregion
- */
- #endregion
-
- #region Simple grammar
- NonTerminal Simple = new NonTerminal("SimpleProg");
- NonTerminal Anything = new NonTerminal("Token");
- Simple.Rule = Anything.Star() + Eof;
- Anything.Rule = n | s;
- foreach (string keyword in reserved) Anything.Rule = Anything.Rule | ToTerm(keyword);
- Anything.Rule = Anything.Rule | ident;
- foreach (string delimiter in delimiters) Anything.Rule = Anything.Rule | ToTerm(delimiter);
-
- RegisterBracePair("{", "}");
- RegisterBracePair("(", ")");
-
- this.Root = Simple;
- #endregion
- }
- }
-}
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/Guids.cs b/Util/VS2010/Chalice/ChaliceLanguageService/Guids.cs
deleted file mode 100644
index ba02ca8c..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/Guids.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-
-namespace Demo
-{
- static class GuidList
- {
- public const string guidIronyLanguageServiceString = "7bcbed0f-df47-4729-b796-b54f14853e2e";
- public const string guidIronyLanguageServicePkgString = "a681f79a-0ed1-4ae0-b79f-4ae69e178800";
- public const string guidIronyLanguageServiceCmdSetString = "be21e7e3-e9c5-4287-95ab-e5125c5063f7";
-
- public static readonly Guid guidIronyLanguageServiceCmdSet = new Guid(guidIronyLanguageServiceCmdSetString);
- };
-} \ No newline at end of file
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/AuthoringScope.cs b/Util/VS2010/Chalice/ChaliceLanguageService/Integration/AuthoringScope.cs
deleted file mode 100644
index 9a49dbe4..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/AuthoringScope.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.TextManager.Interop;
-using Microsoft.VisualStudio.Package;
-
-namespace Demo
-{
- public class AuthoringScope : Microsoft.VisualStudio.Package.AuthoringScope
- {
- public AuthoringScope(object parseResult)
- {
- this.parseResult = parseResult;
-
- // how should this be set?
- this.resolver = new Resolver();
- }
-
- object parseResult;
- IASTResolver resolver;
-
- // ParseReason.QuickInfo
- public override string GetDataTipText(int line, int col, out TextSpan span)
- {
- span = new TextSpan();
- return null;
- }
-
- // ParseReason.CompleteWord
- // ParseReason.DisplayMemberList
- // ParseReason.MemberSelect
- // ParseReason.MemberSelectAndHilightBraces
- public override Microsoft.VisualStudio.Package.Declarations GetDeclarations(IVsTextView view, int line, int col, TokenInfo info, ParseReason reason)
- {
- IList<Declaration> declarations;
- switch (reason)
- {
- case ParseReason.CompleteWord:
- declarations = resolver.FindCompletions(parseResult, line, col);
- break;
- case ParseReason.DisplayMemberList:
- case ParseReason.MemberSelect:
- case ParseReason.MemberSelectAndHighlightBraces:
- declarations = resolver.FindMembers(parseResult, line, col);
- break;
- default:
- throw new ArgumentException("reason");
- }
-
- return new Declarations(declarations);
- }
-
- // ParseReason.GetMethods
- public override Microsoft.VisualStudio.Package.Methods GetMethods(int line, int col, string name)
- {
- return new Methods(resolver.FindMethods(parseResult, line, col, name));
- }
-
- // ParseReason.Goto
- public override string Goto(VSConstants.VSStd97CmdID cmd, IVsTextView textView, int line, int col, out TextSpan span)
- {
- span = new TextSpan();
- return null;
- }
- }
-} \ No newline at end of file
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Configuration.cs b/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Configuration.cs
deleted file mode 100644
index f7412393..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Configuration.cs
+++ /dev/null
@@ -1,116 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Microsoft.VisualStudio.Package;
-using Microsoft.VisualStudio.TextManager.Interop;
-
-namespace Demo
-{
- public static partial class Configuration
- {
- public static Grammar Grammar = new Grammar();
- static List<Microsoft.VisualStudio.TextManager.Interop.IVsColorableItem> colorableItems = new List<Microsoft.VisualStudio.TextManager.Interop.IVsColorableItem>();
-
- public static IList<Microsoft.VisualStudio.TextManager.Interop.IVsColorableItem> ColorableItems
- {
- get { return colorableItems; }
- }
-
- public static TokenColor CreateColor(string name, COLORINDEX foreground, COLORINDEX background)
- {
- return CreateColor(name, foreground, background, false, false);
- }
-
- public static TokenColor CreateColor(string name, COLORINDEX foreground, COLORINDEX background, bool bold, bool strikethrough)
- {
- colorableItems.Add(new ColorableItem(name, foreground, background, bold, strikethrough));
- return (TokenColor)colorableItems.Count;
- }
-
- public static void ColorToken(string tokenName, TokenType type, TokenColor color, TokenTriggers trigger)
- {
- definitions[tokenName] = new TokenDefinition(type, color, trigger);
- }
-
- public static TokenDefinition GetDefinition(string tokenName)
- {
- TokenDefinition result;
- return definitions.TryGetValue(tokenName, out result) ? result : defaultDefinition;
- }
-
- private static TokenDefinition defaultDefinition = new TokenDefinition(TokenType.Text, TokenColor.Text, TokenTriggers.None);
- private static Dictionary<string, TokenDefinition> definitions = new Dictionary<string, TokenDefinition>();
-
- public struct TokenDefinition
- {
- public TokenDefinition(TokenType type, TokenColor color, TokenTriggers triggers)
- {
- this.TokenType = type;
- this.TokenColor = color;
- this.TokenTriggers = triggers;
- }
-
- public TokenType TokenType;
- public TokenColor TokenColor;
- public TokenTriggers TokenTriggers;
- }
- }
-
- public class ColorableItem : Microsoft.VisualStudio.TextManager.Interop.IVsColorableItem
- {
- private string displayName;
- private COLORINDEX background;
- private COLORINDEX foreground;
- private uint fontFlags = (uint)FONTFLAGS.FF_DEFAULT;
-
- public ColorableItem(string displayName, COLORINDEX foreground, COLORINDEX background, bool bold, bool strikethrough)
- {
- this.displayName = displayName;
- this.background = background;
- this.foreground = foreground;
-
- if (bold)
- this.fontFlags = this.fontFlags | (uint)FONTFLAGS.FF_BOLD;
- if (strikethrough)
- this.fontFlags = this.fontFlags | (uint)FONTFLAGS.FF_STRIKETHROUGH;
- }
-
- #region IVsColorableItem Members
- public int GetDefaultColors(COLORINDEX[] piForeground, COLORINDEX[] piBackground)
- {
- if (null == piForeground)
- {
- throw new ArgumentNullException("piForeground");
- }
- if (0 == piForeground.Length)
- {
- throw new ArgumentOutOfRangeException("piForeground");
- }
- piForeground[0] = foreground;
-
- if (null == piBackground)
- {
- throw new ArgumentNullException("piBackground");
- }
- if (0 == piBackground.Length)
- {
- throw new ArgumentOutOfRangeException("piBackground");
- }
- piBackground[0] = background;
-
- return Microsoft.VisualStudio.VSConstants.S_OK;
- }
-
- public int GetDefaultFontFlags(out uint pdwFontFlags)
- {
- pdwFontFlags = this.fontFlags;
- return Microsoft.VisualStudio.VSConstants.S_OK;
- }
-
- public int GetDisplayName(out string pbstrName)
- {
- pbstrName = displayName;
- return Microsoft.VisualStudio.VSConstants.S_OK;
- }
- #endregion
- }
-} \ No newline at end of file
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Declaration.cs b/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Declaration.cs
deleted file mode 100644
index c0fda5ca..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Declaration.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace Demo
-{
- public struct Declaration : IComparable<Declaration>
- {
- public Declaration(string description, string displayText, int glyph, string name)
- {
- this.Description = description;
- this.DisplayText = displayText;
- this.Glyph = glyph;
- this.Name = name;
- }
-
- public string Description;
- public string DisplayText;
- public int Glyph;
- public string Name;
-
- #region IComparable<Declaration> Members
-
- public int CompareTo(Declaration other)
- {
- return DisplayText.CompareTo(other.DisplayText);
- }
-
- #endregion
- }
-} \ No newline at end of file
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Declarations.cs b/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Declarations.cs
deleted file mode 100644
index 98a411ce..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Declarations.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-/***************************************************************************
-
-Copyright (c) Microsoft Corporation. All rights reserved.
-This code is licensed under the Visual Studio SDK license terms.
-THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
-ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
-IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
-PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
-
-***************************************************************************/
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Microsoft.VisualStudio.TextManager.Interop;
-using Microsoft.VisualStudio.Package;
-
-namespace Demo
-{
- public class Declarations : Microsoft.VisualStudio.Package.Declarations
- {
- IList<Declaration> declarations;
- public Declarations(IList<Declaration> declarations)
- {
- this.declarations = declarations;
- }
-
- public override int GetCount()
- {
- return declarations.Count;
- }
-
- public override string GetDescription(int index)
- {
- return declarations[index].Description;
- }
-
- public override string GetDisplayText(int index)
- {
- return declarations[index].DisplayText;
- }
-
- public override int GetGlyph(int index)
- {
- return declarations[index].Glyph;
- }
-
- public override string GetName(int index)
- {
- if (index >= 0)
- return declarations[index].Name;
-
- return null;
- }
- }
-} \ No newline at end of file
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/IASTResolver.cs b/Util/VS2010/Chalice/ChaliceLanguageService/Integration/IASTResolver.cs
deleted file mode 100644
index 8de1a454..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/IASTResolver.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace Demo
-{
- interface IASTResolver
- {
- IList<Declaration> FindCompletions(object result, int line, int col);
- IList<Declaration> FindMembers(object result, int line, int col);
- string FindQuickInfo(object result, int line, int col);
- IList<Method> FindMethods(object result, int line, int col, string name);
- }
-} \ No newline at end of file
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/IronyLanguageService.cs b/Util/VS2010/Chalice/ChaliceLanguageService/Integration/IronyLanguageService.cs
deleted file mode 100644
index bb7cfebb..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/IronyLanguageService.cs
+++ /dev/null
@@ -1,347 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.TextManager.Interop;
-using Microsoft.VisualStudio.Package;
-
-using Irony.Parsing;
-using Irony.Ast;
-
-using System.IO;
-using System.Text.RegularExpressions;
-
-namespace Demo
-{
- public class IronyLanguageService : Microsoft.VisualStudio.Package.LanguageService
- {
- private Grammar grammar;
- private Parser parser;
- private ParsingContext context;
-
- public IronyLanguageService()
- {
- grammar = new Grammar();
- parser = new Parser(Configuration.Grammar);
- context = new ParsingContext(parser);
- }
-
-
- #region Custom Colors
- public override int GetColorableItem(int index, out IVsColorableItem item)
- {
- if (index <= Configuration.ColorableItems.Count)
- {
- item = Configuration.ColorableItems[index - 1];
- return Microsoft.VisualStudio.VSConstants.S_OK;
- }
- else
- {
- throw new ArgumentNullException("index");
- }
- }
-
- public override int GetItemCount(out int count)
- {
- count = Configuration.ColorableItems.Count;
- return Microsoft.VisualStudio.VSConstants.S_OK;
- }
- #endregion
-
- #region MPF Accessor and Factory specialisation
- private LanguagePreferences preferences;
- public override LanguagePreferences GetLanguagePreferences()
- {
- if (this.preferences == null)
- {
- this.preferences = new LanguagePreferences(this.Site,
- typeof(IronyLanguageService).GUID,
- this.Name);
- this.preferences.Init();
- }
-
- return this.preferences;
- }
-
- public override Microsoft.VisualStudio.Package.Source CreateSource(IVsTextLines buffer)
- {
- return new Source(this, buffer, this.GetColorizer(buffer));
- }
-
- private IScanner scanner;
- public override IScanner GetScanner(IVsTextLines buffer)
- {
- if (scanner == null)
- this.scanner = new LineScanner(grammar);
-
- return this.scanner;
- }
- #endregion
-
- public override void OnIdle(bool periodic)
- {
- // from IronPythonLanguage sample
- // this appears to be necessary to get a parse request with ParseReason = Check?
- Source src = (Source)GetSource(this.LastActiveTextView);
- if (src != null && src.LastParseTime >= Int32.MaxValue >> 12)
- {
- src.LastParseTime = 0;
- }
- base.OnIdle(periodic);
- }
-
- public override Microsoft.VisualStudio.Package.AuthoringScope ParseSource(ParseRequest req)
- {
- Debug.Print("ParseSource at ({0}:{1}), reason {2}", req.Line, req.Col, req.Reason);
- Source source = (Source)this.GetSource(req.FileName);
- switch (req.Reason)
- {
- case ParseReason.Check:
- // This is where you perform your syntax highlighting.
- // Parse entire source as given in req.Text.
- // Store results in the AuthoringScope object.
- var parsed = parser.Parse(req.Text, req.FileName);
- var root = parsed.Root;
- if (root != null) {
-
- AstNode node = (AstNode)root.AstNode;
- source.ParseResult = node;
- }
-
- // Used for brace matching.
- //TokenStack braces = parser.Context.OpenBraces;
- //foreach (Token brace in braces) {
- // if (brace.OtherBrace == null) continue;
- // TextSpan openBrace = new TextSpan();
- // openBrace.iStartLine = brace.Location.Line;
- // openBrace.iStartIndex = brace.Location.Column;
- // openBrace.iEndLine = brace.Location.Line;
- // openBrace.iEndIndex = openBrace.iStartIndex + brace.Length;
-
- // TextSpan closeBrace = new TextSpan();
- // closeBrace.iStartLine = brace.OtherBrace.Location.Line;
- // closeBrace.iStartIndex = brace.OtherBrace.Location.Column;
- // closeBrace.iEndLine = brace.OtherBrace.Location.Line;
- // closeBrace.iEndIndex = closeBrace.iStartIndex + brace.OtherBrace.Length;
-
- // if (source.Braces == null) {
- // source.Braces = new List<TextSpan[]>();
- // }
- // source.Braces.Add(new TextSpan[2] { openBrace, closeBrace });
- //}
-
- if (parser.Context.CurrentParseTree.ParserMessages.Count > 0) {
- foreach (ParserMessage error in parser.Context.CurrentParseTree.ParserMessages) {
- TextSpan span = new TextSpan();
- span.iStartLine = span.iEndLine = error.Location.Line;
- span.iStartIndex = error.Location.Column;
- span.iEndIndex = error.Location.Position;
- req.Sink.AddError(req.FileName, error.Message, span, Severity.Error);
- }
- } else { // parse looks okay, send it to Chalice.
- if (!File.Exists(@"C:\tmp\StartChalice.bat")) {
- AddErrorBecauseOfToolProblems(req, @"Can't find C:\tmp\StartChalice.bat");
- } else {
-
- // From: http://dotnetperls.com/process-redirect-standard-output
- // (Also, see: http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.redirectstandardoutput.aspx)
- //
- // Setup the process with the ProcessStartInfo class.
- //
- ProcessStartInfo start = new ProcessStartInfo();
- start.FileName = @"cmd.exe";
- start.Arguments = @"/c C:\tmp\StartChalice.bat"; // Specify exe name.
- start.UseShellExecute = false;
- start.RedirectStandardInput = true;
- start.RedirectStandardOutput = true;
- start.CreateNoWindow = true;
- //start.WindowStyle = ProcessWindowStyle.Minimized; // need this or else you see the window pop up
- //
- // Start the process.
- //
- using (Process process = Process.Start(start)) {
- //
- // Push the file contents to the new process
- //
- StreamWriter myStreamWriter = process.StandardInput;
- myStreamWriter.WriteLine(req.Text);
- myStreamWriter.Close();
- //
- // Read in all the text from the process with the StreamReader.
- //
- using (StreamReader reader = process.StandardOutput) {
- //string result = reader.ReadToEnd();
- //Console.Write(result);
-
- for (string line = reader.ReadLine(); line != null; line = reader.ReadLine()) {
- if (line == "")
- continue;
- if (line.StartsWith("Boogie program verifier")) {
- if (!Regex.IsMatch(line, "Boogie program verifier finished with [0-9]* verified, 0 errors"))
- AddErrorBecauseOfToolProblems(req, line, false);
- continue;
- }
-
- // each line is of the form: "x,y,w,z:arbitrary text"
- int colonIndex = line.IndexOf(':');
- if (colonIndex == -1) {
- AddErrorBecauseOfToolProblems(req, "Couldn't find colon in '" + line + "'");
- continue;
- }
- string numbers = line.Substring(0, colonIndex);
- var message = line.Substring(colonIndex + 1);
- string[] positions = numbers.Split(',');
- if (positions.Length != 4) {
- AddErrorBecauseOfToolProblems(req, "Couldn't find four numbers in '" + numbers + "'");
- continue;
- }
- try {
- TextSpan span = new TextSpan();
- span.iStartLine = span.iEndLine = Math.Max(0, Int32.Parse(positions[0]) - 1);
- span.iStartIndex = Math.Max(0, Int32.Parse(positions[1]) - 1);
- span.iEndLine = Math.Max(0, Int32.Parse(positions[2]) - 1);
- span.iEndIndex = Math.Max(0, Int32.Parse(positions[3]) - 1);
- req.Sink.AddError(req.FileName, message, span, Severity.Error);
- } catch (System.ArgumentNullException) {
- AddErrorBecauseOfToolProblems(req, "Couldn't parse numbers: '" + numbers + "'");
- } catch (System.FormatException) {
- AddErrorBecauseOfToolProblems(req, "Couldn't parse numbers: '" + numbers + "'");
- } catch (System.OverflowException) {
- AddErrorBecauseOfToolProblems(req, "Couldn't parse numbers: '" + numbers + "'");
- }
- }
- }
- }
- }
- }
-
- break;
-
- case ParseReason.DisplayMemberList:
- // Parse the line specified in req.Line for the two
- // tokens just before req.Col to obtain the identifier
- // and the member connector symbol.
- // Examine existing parse tree for members of the identifer
- // and return a list of members in your version of the
- // Declarations class as stored in the AuthoringScope
- // object.
- break;
-
- case ParseReason.MethodTip:
- // Parse the line specified in req.Line for the token
- // just before req.Col to obtain the name of the method
- // being entered.
- // Examine the existing parse tree for all method signatures
- // with the same name and return a list of those signatures
- // in your version of the Methods class as stored in the
- // AuthoringScope object.
- break;
-
- case ParseReason.HighlightBraces:
- case ParseReason.MemberSelectAndHighlightBraces:
- //if (source.Braces != null)
- //{
- // foreach (TextSpan[] brace in source.Braces)
- // {
- // if (brace.Length == 2)
- // req.Sink.MatchPair(brace[0], brace[1], 1);
- // else if (brace.Length >= 3)
- // req.Sink.MatchTriple(brace[0], brace[1], brace[2], 1);
- // }
- //}
- break;
- }
-
- return new AuthoringScope(source.ParseResult);
- }
-
- private static void AddErrorBecauseOfToolProblems(ParseRequest req, string msg) {
- AddErrorBecauseOfToolProblems(req, msg, true);
- }
- private static void AddErrorBecauseOfToolProblems(ParseRequest req, string msg, bool error) {
- TextSpan span = new TextSpan();
- span.iStartLine = span.iEndLine = 0;
- span.iStartIndex = 0;
- span.iEndIndex = 5;
- req.Sink.AddError(req.FileName, msg, span, error ? Severity.Error : Severity.Hint);
- }
-
- /// <summary>
- /// Called to determine if the given location can have a breakpoint applied to it.
- /// </summary>
- /// <param name="buffer">The IVsTextBuffer object containing the source file.</param>
- /// <param name="line">The line number where the breakpoint is to be set.</param>
- /// <param name="col">The offset into the line where the breakpoint is to be set.</param>
- /// <param name="pCodeSpan">
- /// Returns the TextSpan giving the extent of the code affected by the breakpoint if the
- /// breakpoint can be set.
- /// </param>
- /// <returns>
- /// If successful, returns S_OK; otherwise returns S_FALSE if there is no code at the given
- /// position or returns an error code (the validation is deferred until the debug engine is loaded).
- /// </returns>
- /// <remarks>
- /// <para>
- /// CAUTION: Even if you do not intend to support the ValidateBreakpointLocation but your language
- /// does support breakpoints, you must override the ValidateBreakpointLocation method and return a
- /// span that contains the specified line and column; otherwise, breakpoints cannot be set anywhere
- /// except line 1. You can return E_NOTIMPL to indicate that you do not otherwise support this
- /// method but the span must always be set. The example shows how this can be done.
- /// </para>
- /// <para>
- /// Since the language service parses the code, it generally knows what is considered code and what
- /// is not. Normally, the debug engine is loaded and the pending breakpoints are bound to the source. It is at this time the breakpoint location is validated. This method is a fast way to determine if a breakpoint can be set at a particular location without loading the debug engine.
- /// </para>
- /// <para>
- /// You can implement this method to call the ParseSource method with the parse reason of CodeSpan.
- /// The parser examines the specified location and returns a span identifying the code at that
- /// location. If there is code at the location, the span identifying that code should be passed to
- /// your implementation of the CodeSpan method in your version of the AuthoringSink class. Then your
- /// implementation of the ValidateBreakpointLocation method retrieves that span from your version of
- /// the AuthoringSink class and returns that span in the pCodeSpan argument.
- /// </para>
- /// <para>
- /// The base method returns E_NOTIMPL.
- /// </para>
- /// </remarks>
- public override int ValidateBreakpointLocation(IVsTextBuffer buffer, int line, int col, TextSpan[] pCodeSpan)
- {
- // TODO: Add code to not allow breakpoints to be placed on non-code lines.
- // TODO: Refactor to allow breakpoint locations to span multiple lines.
- if (pCodeSpan != null)
- {
- pCodeSpan[0].iStartLine = line;
- pCodeSpan[0].iStartIndex = col;
- pCodeSpan[0].iEndLine = line;
- pCodeSpan[0].iEndIndex = col;
- if (buffer != null)
- {
- int length;
- buffer.GetLengthOfLine(line, out length);
- pCodeSpan[0].iStartIndex = 0;
- pCodeSpan[0].iEndIndex = length;
- }
- return VSConstants.S_OK;
- }
- else
- {
- return VSConstants.S_FALSE;
- }
- }
-
- public override ViewFilter CreateViewFilter(CodeWindowManager mgr, IVsTextView newView)
- {
- return new IronyViewFilter(mgr, newView);
- }
-
- public override string Name
- {
- get { return Configuration.Name; }
- }
-
- public override string GetFormatFilterList()
- {
- return Configuration.FormatList;
- }
- }
-} \ No newline at end of file
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/IronyViewFilter.cs b/Util/VS2010/Chalice/ChaliceLanguageService/Integration/IronyViewFilter.cs
deleted file mode 100644
index 55c3509e..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/IronyViewFilter.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.VisualStudio.Package;
-using Microsoft.VisualStudio.TextManager.Interop;
-
-using VsCommands2K = Microsoft.VisualStudio.VSConstants.VSStd2KCmdID;
-
-namespace Demo
-{
- public class IronyViewFilter : ViewFilter
- {
- public IronyViewFilter(CodeWindowManager mgr, IVsTextView view)
- : base(mgr, view)
- {
-
- }
-
- public override void HandlePostExec(ref Guid guidCmdGroup, uint nCmdId, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut, bool bufferWasChanged)
- {
- if (guidCmdGroup == typeof(VsCommands2K).GUID)
- {
- VsCommands2K cmd = (VsCommands2K)nCmdId;
- switch (cmd)
- {
- case VsCommands2K.UP:
- case VsCommands2K.UP_EXT:
- case VsCommands2K.UP_EXT_COL:
- case VsCommands2K.DOWN:
- case VsCommands2K.DOWN_EXT:
- case VsCommands2K.DOWN_EXT_COL:
- Source.OnCommand(TextView, cmd, '\0');
- return;
- }
- }
-
-
- base.HandlePostExec(ref guidCmdGroup, nCmdId, nCmdexecopt, pvaIn, pvaOut, bufferWasChanged);
- }
- }
-}
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/LineScanner.cs b/Util/VS2010/Chalice/ChaliceLanguageService/Integration/LineScanner.cs
deleted file mode 100644
index 966e9c43..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/LineScanner.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-using System;
-using Microsoft.VisualStudio.Package;
-using Irony.Parsing;
-
-namespace Demo
-{
- public class LineScanner : IScanner
- {
- private Parser parser;
-
- public LineScanner(Grammar grammar)
- {
- this.parser = new Parser(grammar);
- this.parser.Context.Mode = ParseMode.VsLineScan;
- }
-
- public bool ScanTokenAndProvideInfoAboutIt(TokenInfo tokenInfo, ref int state)
- {
- // Reads each token in a source line and performs syntax coloring. It will continue to
- // be called for the source until false is returned.
- Token token = parser.Scanner.VsReadToken(ref state);
-
- // !EOL and !EOF
- if (token != null && token.Terminal != Grammar.CurrentGrammar.Eof && token.Category != TokenCategory.Error)
- {
- tokenInfo.StartIndex = token.Location.Position;
- tokenInfo.EndIndex = tokenInfo.StartIndex + token.Length - 1;
- if (token.EditorInfo != null) {
- tokenInfo.Color = (Microsoft.VisualStudio.Package.TokenColor)token.EditorInfo.Color;
- tokenInfo.Type = (Microsoft.VisualStudio.Package.TokenType)token.EditorInfo.Type;
- }
-
- if (token.KeyTerm != null && token.KeyTerm.EditorInfo != null)
- {
- tokenInfo.Trigger =
- (Microsoft.VisualStudio.Package.TokenTriggers)token.KeyTerm.EditorInfo.Triggers;
- }
- else
- {
- if (token.EditorInfo != null) {
- tokenInfo.Trigger =
- (Microsoft.VisualStudio.Package.TokenTriggers)token.EditorInfo.Triggers;
- }
- }
-
- return true;
- }
-
- return false;
- }
-
- public void SetSource(string source, int offset)
- {
- // Stores line of source to be used by ScanTokenAndProvideInfoAboutIt.
- parser.Scanner.VsSetSource(source, offset);
- }
- }
-}
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Method.cs b/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Method.cs
deleted file mode 100644
index c5071612..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Method.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace Demo
-{
- public struct Method
- {
- public string Name;
- public string Description;
- public string Type;
- public IList<Parameter> Parameters;
- }
-
- public struct Parameter
- {
- public string Name;
- public string Display;
- public string Description;
- }
-} \ No newline at end of file
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Methods.cs b/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Methods.cs
deleted file mode 100644
index 1d7c124f..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Methods.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Microsoft.VisualStudio.TextManager.Interop;
-using Microsoft.VisualStudio.Package;
-
-namespace Demo
-{
- public class Methods : Microsoft.VisualStudio.Package.Methods
- {
- IList<Method> methods;
- public Methods(IList<Method> methods)
- {
- this.methods = methods;
- }
-
- public override int GetCount()
- {
- return methods.Count;
- }
-
- public override string GetName(int index)
- {
- return methods[index].Name;
- }
-
- public override string GetDescription(int index)
- {
- return methods[index].Description;
- }
-
- public override string GetType(int index)
- {
- return methods[index].Type;
- }
-
- public override int GetParameterCount(int index)
- {
- return (methods[index].Parameters == null) ? 0 : methods[index].Parameters.Count;
- }
-
- public override void GetParameterInfo(int index, int paramIndex, out string name, out string display, out string description)
- {
- Parameter parameter = methods[index].Parameters[paramIndex];
- name = parameter.Name;
- display = parameter.Display;
- description = parameter.Description;
- }
- }
-} \ No newline at end of file
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Package.cs b/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Package.cs
deleted file mode 100644
index dc1244d6..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Package.cs
+++ /dev/null
@@ -1,130 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Runtime.InteropServices;
-using Microsoft.VisualStudio.OLE.Interop;
-using MPF = Microsoft.VisualStudio.Package;
-using System.ComponentModel.Design;
-
-namespace Demo
-{
- public class IronyPackage : Microsoft.VisualStudio.Shell.Package, IOleComponent
- {
- uint componentID = 0;
- public IronyPackage()
- {
- ServiceCreatorCallback callback = new ServiceCreatorCallback(
- delegate(IServiceContainer container, Type serviceType)
- {
- if (typeof(IronyLanguageService) == serviceType)
- {
- IronyLanguageService language = new IronyLanguageService();
- language.SetSite(this);
-
- // register for idle time callbacks
- IOleComponentManager mgr = GetService(typeof(SOleComponentManager)) as IOleComponentManager;
- if (componentID == 0 && mgr != null)
- {
- OLECRINFO[] crinfo = new OLECRINFO[1];
- crinfo[0].cbSize = (uint)Marshal.SizeOf(typeof(OLECRINFO));
- crinfo[0].grfcrf = (uint)_OLECRF.olecrfNeedIdleTime |
- (uint)_OLECRF.olecrfNeedPeriodicIdleTime;
- crinfo[0].grfcadvf = (uint)_OLECADVF.olecadvfModal |
- (uint)_OLECADVF.olecadvfRedrawOff |
- (uint)_OLECADVF.olecadvfWarningsOff;
- crinfo[0].uIdleTimeInterval = 300;
- int hr = mgr.FRegisterComponent(this, crinfo, out componentID);
- }
-
- return language;
- }
- else
- {
- return null;
- }
- });
-
- // proffer the LanguageService
- (this as IServiceContainer).AddService(typeof(IronyLanguageService), callback, true);
- }
-
- protected override void Dispose(bool disposing)
- {
- try
- {
- if (componentID != 0)
- {
- IOleComponentManager mgr = GetService(typeof(SOleComponentManager)) as IOleComponentManager;
- if (mgr != null)
- {
- mgr.FRevokeComponent(componentID);
- }
- componentID = 0;
- }
- }
- finally
- {
- base.Dispose(disposing);
- }
- }
-
- #region IOleComponent Members
- public int FContinueMessageLoop(uint uReason, IntPtr pvLoopData, MSG[] pMsgPeeked)
- {
- return 1;
- }
-
- public int FDoIdle(uint grfidlef)
- {
- IronyLanguageService ls = GetService(typeof(IronyLanguageService)) as IronyLanguageService;
-
- if (ls != null)
- {
- ls.OnIdle((grfidlef & (uint)_OLEIDLEF.oleidlefPeriodic) != 0);
- }
-
- return 0;
- }
-
- public int FPreTranslateMessage(MSG[] pMsg)
- {
- return 0;
- }
-
- public int FQueryTerminate(int fPromptUser)
- {
- return 1;
- }
-
- public int FReserved1(uint dwReserved, uint message, IntPtr wParam, IntPtr lParam)
- {
- return 1;
- }
-
- public IntPtr HwndGetWindow(uint dwWhich, uint dwReserved)
- {
- return IntPtr.Zero;
- }
-
- public void OnActivationChange(IOleComponent pic, int fSameComponent, OLECRINFO[] pcrinfo, int fHostIsActivating, OLECHOSTINFO[] pchostinfo, uint dwReserved)
- {
- }
-
- public void OnAppActivate(int fActive, uint dwOtherThreadID)
- {
- }
-
- public void OnEnterState(uint uStateID, int fEnter)
- {
- }
-
- public void OnLoseActivation()
- {
- }
-
- public void Terminate()
- {
- }
- #endregion
- }
-} \ No newline at end of file
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Resolver.cs b/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Resolver.cs
deleted file mode 100644
index 9f6ddeba..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Resolver.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Irony.Parsing;
-
-namespace Demo
-{
- public class Resolver : Demo.IASTResolver
- {
- #region IASTResolver Members
-
-
- public IList<Demo.Declaration> FindCompletions(object result, int line, int col)
- {
- // Used for intellisense.
- List<Demo.Declaration> declarations = new List<Demo.Declaration>();
-
- // Add keywords defined by grammar
- foreach (KeyTerm key in Configuration.Grammar.KeyTerms.Values)
- {
- if(key.OptionIsSet(TermOptions.IsKeyword))
- {
- declarations.Add(new Declaration("", key.Name, 206, key.Name));
- }
- }
-
- declarations.Sort();
- return declarations;
- }
-
- public IList<Demo.Declaration> FindMembers(object result, int line, int col)
- {
- List<Demo.Declaration> members = new List<Demo.Declaration>();
-
- return members;
- }
-
- public string FindQuickInfo(object result, int line, int col)
- {
- return "unknown";
- }
-
- public IList<Demo.Method> FindMethods(object result, int line, int col, string name)
- {
- return new List<Demo.Method>();
- }
-
- #endregion
- }
-}
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Source.cs b/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Source.cs
deleted file mode 100644
index 418bec01..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/Integration/Source.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-/***************************************************************************
-
-Copyright (c) Microsoft Corporation. All rights reserved.
-This code is licensed under the Visual Studio SDK license terms.
-THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
-ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
-IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
-PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
-
-***************************************************************************/
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Microsoft.VisualStudio.TextManager.Interop;
-using Microsoft.VisualStudio.Package;
-
-namespace Demo
-{
- public class Source : Microsoft.VisualStudio.Package.Source
- {
- public Source(LanguageService service, IVsTextLines textLines, Colorizer colorizer)
- : base(service, textLines, colorizer)
- {
- }
-
- private object parseResult;
- public object ParseResult
- {
- get { return parseResult; }
- set { parseResult = value; }
- }
-
- private IList<TextSpan[]> braces;
- public IList<TextSpan[]> Braces
- {
- get { return braces; }
- set { braces = value; }
- }
- }
-} \ No newline at end of file
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/IronyLanguageServicePackage.cs b/Util/VS2010/Chalice/ChaliceLanguageService/IronyLanguageServicePackage.cs
deleted file mode 100644
index 8b9cb825..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/IronyLanguageServicePackage.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-// VsPkg.cs : Implementation of IronyLanguageService
-//
-
-using System;
-using System.Diagnostics;
-using System.Globalization;
-using System.Runtime.InteropServices;
-using System.ComponentModel.Design;
-using Microsoft.Win32;
-using Microsoft.VisualStudio.Shell.Interop;
-using Microsoft.VisualStudio.OLE.Interop;
-using Microsoft.VisualStudio.Shell;
-
-namespace Demo
-{
- /// <summary>
- /// This is the class that implements the package exposed by this assembly.
- ///
- /// The minimum requirement for a class to be considered a valid package for Visual Studio
- /// is to implement the IVsPackage interface and register itself with the shell.
- /// This package uses the helper classes defined inside the Managed Package Framework (MPF)
- /// to do it: it derives from the Package class that provides the implementation of the
- /// IVsPackage interface and uses the registration attributes defined in the framework to
- /// register itself and its components with the shell.
- /// </summary>
- // This attribute tells the registration utility (regpkg.exe) that this class needs
- // to be registered as package.
- [PackageRegistration(UseManagedResourcesOnly = true)]
- // A Visual Studio component can be registered under different regitry roots; for instance
- // when you debug your package you want to register it in the experimental hive. This
- // attribute specifies the registry root to use if no one is provided to regpkg.exe with
- // the /root switch.
- [DefaultRegistryRoot("Software\\Microsoft\\VisualStudio\\10.0Exp")]
- // This attribute is used to register the informations needed to show the this package
- // in the Help/About dialog of Visual Studio.
- [InstalledProductRegistration(/*false,*/ "#110", "#112", "1.0", IconResourceID = 400)]
- // This attribute will make your language service accessible by other packages installed.
- [ProvideService(typeof(IronyLanguageService))]
- // This attribute(s) associates file extensions with your language service.
-// [ProvideLanguageExtension(typeof(IronyLanguageService), ".myc")]
- [ProvideLanguageExtension(typeof(IronyLanguageService), ".chalice")]
-
- // This attributes informs Visual Studio that this package provides a langauge service and
- // which features are implemented.
- [ProvideLanguageService(typeof(IronyLanguageService), Configuration.Name, 0,
- CodeSense = true,
- EnableCommenting = true,
- MatchBraces = true,
- MatchBracesAtCaret = true,
- ShowMatchingBrace = true,
- AutoOutlining = true)]
- // In order be loaded inside Visual Studio in a machine that has not the VS SDK installed,
- // package needs to have a valid load key (it can be requested at
- // http://msdn.microsoft.com/vstudio/extend/). This attributes tells the shell that this
- // package has a load key embedded in its resources.
- [ProvideLoadKey("Standard", "1.0", "Chalice", "Demo", 104)]
- [Guid(GuidList.guidIronyLanguageServicePkgString)]
- public sealed class MyCLanguageService : IronyPackage
- {
- /// <summary>
- /// Default constructor of the package.
- /// Inside this method you can place any initialization code that does not require
- /// any Visual Studio service because at this point the package object is created but
- /// not sited yet inside Visual Studio environment. The place to do all the other
- /// initialization is the Initialize method.
- /// </summary>
- public MyCLanguageService()
- {
- Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering constructor for: {0}", this.ToString()));
- }
-
-
-
- /////////////////////////////////////////////////////////////////////////////
- // Overriden Package Implementation
- #region Package Members
-
- /// <summary>
- /// Initialization of the package; this method is called right after the package is sited, so this is the place
- /// where you can put all the initilaization code that rely on services provided by VisualStudio.
- /// </summary>
- protected override void Initialize()
- {
- Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString()));
- base.Initialize();
-
- }
- #endregion
-
- }
-} \ No newline at end of file
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/Key.snk b/Util/VS2010/Chalice/ChaliceLanguageService/Key.snk
deleted file mode 100644
index f80a4ceb..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/Key.snk
+++ /dev/null
Binary files differ
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/Properties/AssemblyInfo.cs b/Util/VS2010/Chalice/ChaliceLanguageService/Properties/AssemblyInfo.cs
deleted file mode 100644
index 118d4488..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System;
-using System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Package Name")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Company")]
-[assembly: AssemblyProduct("Package Name")]
-[assembly: AssemblyCopyright("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-[assembly: ComVisible(false)]
-[assembly: CLSCompliant(false)]
-[assembly: NeutralResourcesLanguage("en-US")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
-
-
-
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/Resources.Designer.cs b/Util/VS2010/Chalice/ChaliceLanguageService/Resources.Designer.cs
deleted file mode 100644
index cd9f79db..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/Resources.Designer.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:4.0.21006.1
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace Demo {
- using System;
-
-
- /// <summary>
- /// A strongly-typed resource class, for looking up localized strings, etc.
- /// </summary>
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources() {
- }
-
- /// <summary>
- /// Returns the cached ResourceManager instance used by this class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Demo.MyCLanguageService.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
- }
-}
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/Resources.resx b/Util/VS2010/Chalice/ChaliceLanguageService/Resources.resx
deleted file mode 100644
index 03fef612..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/Resources.resx
+++ /dev/null
@@ -1,130 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- VS SDK Notes: This resx file contains the resources that will be consumed directly by your package.
- For example, if you chose to create a tool window, there is a resource with ID 'CanNotCreateWindow'. This
- is used in VsPkg.cs to determine the string to show the user if there is an error when attempting to create
- the tool window.
-
- Resources that are accessed directly from your package *by Visual Studio* are stored in the VSPackage.resx
- file.
--->
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-</root> \ No newline at end of file
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/Resources/Irony.dll b/Util/VS2010/Chalice/ChaliceLanguageService/Resources/Irony.dll
deleted file mode 100644
index e2021a72..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/Resources/Irony.dll
+++ /dev/null
Binary files differ
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/VSPackage.resx b/Util/VS2010/Chalice/ChaliceLanguageService/VSPackage.resx
deleted file mode 100644
index 4c4adabd..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/VSPackage.resx
+++ /dev/null
@@ -1,129 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="104" xml:space="preserve">
- <value>Paste PLK Here</value>
- </data>
- <data name="110" xml:space="preserve">
- <value>Chalice</value>
- </data>
- <data name="112" xml:space="preserve">
- <value>Chalice Programming Language</value>
- </data>
-</root> \ No newline at end of file
diff --git a/Util/VS2010/Chalice/ChaliceLanguageService/source.extension.vsixmanifest b/Util/VS2010/Chalice/ChaliceLanguageService/source.extension.vsixmanifest
deleted file mode 100644
index 15fd4e9a..00000000
--- a/Util/VS2010/Chalice/ChaliceLanguageService/source.extension.vsixmanifest
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010">
-
- <Identifier Id="ChaliceService.MicrosoftResearch.A38156F6-63DF-4E3C-8D23-07D3DE0D3388">
- <Name>ChaliceService</Name>
- <Author>Microsoft Research</Author>
- <Version>1.0</Version>
- <Description>Information about my package</Description>
- <Locale>1033</Locale>
- <!--<InstalledByMSI>false</InstalledByMSI>-->
- <SupportedProducts>
- <VisualStudio Version="10.0">
- <Edition>Pro</Edition>
- <Edition>VST_All</Edition>
- </VisualStudio>
- </SupportedProducts>
- <SupportedFrameworkRuntimeEdition MinVersion="2.0" MaxVersion="4.0" />
- </Identifier>
-
- <References/>
-
- <Content>
- <VsPackage>
- ChaliceService.pkgdef
- </VsPackage>
- </Content>
-</Vsix>
diff --git a/Util/VS2010/Chalice/StartChalice.bat b/Util/VS2010/Chalice/StartChalice.bat
deleted file mode 100644
index e2de0e65..00000000
--- a/Util/VS2010/Chalice/StartChalice.bat
+++ /dev/null
@@ -1,10 +0,0 @@
-@echo off
-echo ---------- Starting ------------ < nul >> c:\tmp\coo.out
-time < nul >> c:\tmp\coo.out
-echo. < nul >> c:\tmp\coo.out
-
-call "c:\Program Files\Scala\bin\scala" -cp c:\boogie\Chalice\target\scala-2.8.1.final\classes chalice.Chalice /boogieOpt:nologo /vs %* 2>> c:\tmp\coo.out
-
-time < nul >> c:\tmp\coo.out
-echo. < nul >> c:\tmp\coo.out
-echo ---------- Done ------------ < nul >> c:\tmp\coo.out
diff --git a/Util/VS2010/Dafny/DafnyLanguageService.sln b/Util/VS2010/Dafny/DafnyLanguageService.sln
deleted file mode 100644
index d900cbb5..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService.sln
+++ /dev/null
@@ -1,20 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DafnyLanguageService", "DafnyLanguageService\DafnyLanguageService.csproj", "{66E611EE-84D8-4EB9-9A33-164A53E00553}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {66E611EE-84D8-4EB9-9A33-164A53E00553}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {66E611EE-84D8-4EB9-9A33-164A53E00553}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {66E611EE-84D8-4EB9-9A33-164A53E00553}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {66E611EE-84D8-4EB9-9A33-164A53E00553}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/Configuration.cs b/Util/VS2010/Dafny/DafnyLanguageService/Configuration.cs
deleted file mode 100644
index f32c75ab..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/Configuration.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Microsoft.VisualStudio.Package;
-using Microsoft.VisualStudio.TextManager.Interop;
-
-namespace Demo
-{
- public static partial class Configuration
- {
- public const string Name = "Dafny";
- public const string FormatList = "Dafny File (*.dfy)\n*.dfy";
-
- static Configuration()
- {
- // default colors - currently, these need to be declared
- CreateColor("Keyword", COLORINDEX.CI_BLUE, COLORINDEX.CI_USERTEXT_BK);
- CreateColor("Comment", COLORINDEX.CI_DARKGREEN, COLORINDEX.CI_USERTEXT_BK);
- CreateColor("Identifier", COLORINDEX.CI_SYSPLAINTEXT_FG, COLORINDEX.CI_USERTEXT_BK);
- CreateColor("String", COLORINDEX.CI_MAROON, COLORINDEX.CI_USERTEXT_BK);
- CreateColor("Number", COLORINDEX.CI_RED, COLORINDEX.CI_USERTEXT_BK);
- CreateColor("Text", COLORINDEX.CI_SYSPLAINTEXT_FG, COLORINDEX.CI_USERTEXT_BK);
- }
- }
-}
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/DafnyLanguageService.csproj b/Util/VS2010/Dafny/DafnyLanguageService/DafnyLanguageService.csproj
deleted file mode 100644
index 175c12dc..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/DafnyLanguageService.csproj
+++ /dev/null
@@ -1,179 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Demo.DafnyLanguageService</RootNamespace>
- <AssemblyName>DafnyLanguageService</AssemblyName>
- <SignAssembly>True</SignAssembly>
- <AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <ProjectGuid>{66E611EE-84D8-4EB9-9A33-164A53E00553}</ProjectGuid>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>4.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- <PublishUrl>publish\</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Disk</InstallFrom>
- <UpdateEnabled>false</UpdateEnabled>
- <UpdateMode>Foreground</UpdateMode>
- <UpdateInterval>7</UpdateInterval>
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>
- <UpdatePeriodically>false</UpdatePeriodically>
- <UpdateRequired>false</UpdateRequired>
- <MapFileExtensions>true</MapFileExtensions>
- <ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <IsWebBootstrapper>false</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
- <TargetFrameworkProfile />
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <RunCodeAnalysis>true</RunCodeAnalysis>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Irony, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ca48ace7223ead47, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>Resources\Irony.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.VisualStudio.OLE.Interop" />
- <Reference Include="Microsoft.VisualStudio.Package.LanguageService.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>C:\Program Files\Microsoft Visual Studio 2010 Beta2 SDK\VisualStudioIntegration\Common\Assemblies\Microsoft.VisualStudio.Package.LanguageService.10.0.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.VisualStudio.Shell.10.0">
- <HintPath>C:\Program Files\Microsoft Visual Studio 2010 Beta2 SDK\VisualStudioIntegration\Common\Assemblies\Microsoft.VisualStudio.Shell.10.0.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>C:\Program Files\Microsoft Visual Studio 2010 Beta2 SDK\VisualStudioIntegration\Common\Assemblies\Microsoft.VisualStudio.Shell.Immutable.10.0.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.VisualStudio.Shell.Interop" />
- <Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <SpecificVersion>False</SpecificVersion>
- <EmbedInteropTypes>True</EmbedInteropTypes>
- <HintPath>C:\Program Files\Microsoft Visual Studio 2010 Beta2 SDK\VisualStudioIntegration\Common\Assemblies\Microsoft.VisualStudio.Shell.Interop.10.0.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0" />
- <Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0" />
- <Reference Include="Microsoft.VisualStudio.TextManager.Interop" />
- <Reference Include="Microsoft.VisualStudio.TextManager.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\..\..\Program Files\Microsoft Visual Studio 2008 SDK\VisualStudioIntegration\Common\Assemblies\Microsoft.VisualStudio.TextManager.Interop.8.0.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Design" />
- <Reference Include="System.Drawing" />
- <Reference Include="System.Windows.Forms" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Configuration.cs" />
- <Compile Include="Grammar.cs" />
- <Compile Include="Guids.cs" />
- <Compile Include="Integration\AuthoringScope.cs" />
- <Compile Include="Integration\Configuration.cs" />
- <Compile Include="Integration\Declaration.cs" />
- <Compile Include="Integration\Declarations.cs" />
- <Compile Include="Integration\IASTResolver.cs" />
- <Compile Include="Integration\IronyViewFilter.cs" />
- <Compile Include="Integration\IronyLanguageService.cs" />
- <Compile Include="Integration\LineScanner.cs" />
- <Compile Include="Integration\Method.cs" />
- <Compile Include="Integration\Methods.cs" />
- <Compile Include="Integration\Package.cs" />
- <Compile Include="Integration\Resolver.cs" />
- <Compile Include="Integration\Source.cs" />
- <Compile Include="Resources.Designer.cs">
- <AutoGen>True</AutoGen>
- <DesignTime>True</DesignTime>
- <DependentUpon>Resources.resx</DependentUpon>
- </Compile>
- <Compile Include="GlobalSuppressions.cs" />
- <Compile Include="IronyLanguageServicePackage.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <EmbeddedResource Include="Resources.resx">
- <Generator>ResXFileCodeGenerator</Generator>
- <LastGenOutput>Resources.Designer.cs</LastGenOutput>
- <SubType>Designer</SubType>
- </EmbeddedResource>
- <EmbeddedResource Include="VSPackage.resx">
- <MergeWithCTO>true</MergeWithCTO>
- <SubType>Designer</SubType>
- </EmbeddedResource>
- </ItemGroup>
- <ItemGroup>
- <Content Include="Resources\Irony.dll" />
- <None Include="source.extension.vsixmanifest" />
- </ItemGroup>
- <ItemGroup>
- <None Include="Key.snk" />
- </ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.VisualBasic.PowerPacks.10.0">
- <Visible>False</Visible>
- <ProductName>Microsoft Visual Basic PowerPacks 10.0</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
- <Visible>False</Visible>
- <ProductName>Windows Installer 3.1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- </ItemGroup>
- <PropertyGroup>
- <!--
- To specify a different registry root to register your package, uncomment the TargetRegistryRoot
- tag and specify a registry root in it.
- <TargetRegistryRoot></TargetRegistryRoot>
- -->
- <RegisterOutputPackage>true</RegisterOutputPackage>
- <RegisterWithCodebase>true</RegisterWithCodebase>
- </PropertyGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\VSSDK\Microsoft.VsSDK.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project> \ No newline at end of file
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/GlobalSuppressions.cs b/Util/VS2010/Dafny/DafnyLanguageService/GlobalSuppressions.cs
deleted file mode 100644
index f0857cbb..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/GlobalSuppressions.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// This file is used by Code Analysis to maintain SuppressMessage
-// attributes that are applied to this project. Project-level
-// suppressions either have no target or are given a specific target
-// and scoped to a namespace, type, member, etc.
-//
-// To add a suppression to this file, right-click the message in the
-// Error List, point to "Suppress Message(s)", and click "In Project
-// Suppression File". You do not need to add suppressions to this
-// file manually.
-
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1017:MarkAssembliesWithComVisible")]
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/Grammar.cs b/Util/VS2010/Dafny/DafnyLanguageService/Grammar.cs
deleted file mode 100644
index ac1b755c..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/Grammar.cs
+++ /dev/null
@@ -1,388 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Irony.Parsing;
-
-namespace Demo
-{
- [Language("Dafny", "1.0", "Dafny Programming Language")]
- public class Grammar : Irony.Parsing.Grammar
- {
- public Grammar() {
- #region 1. Terminals
- NumberLiteral n = TerminalFactory.CreateCSharpNumber("number");
-
- IdentifierTerminal ident = new IdentifierTerminal("Identifier", "'_?", "'_?");
-
- StringLiteral stringLiteral = TerminalFactory.CreateCSharpString("String");
-
- this.MarkReservedWords( // NOTE: these keywords must also appear once more below
- "class", "ghost", "static", "var", "method", "constructor", "datatype", "codatatype",
- "iterator", "type",
- "assert", "assume", "new", "this", "object", "refines",
- "module", "import", "as", "default", "opened",
- "if", "then", "else", "while", "invariant",
- "break", "label", "return", "yield", "parallel", "print",
- "returns", "yields", "requires", "ensures", "modifies", "reads", "decreases",
- "bool", "nat", "int", "false", "true", "null",
- "function", "predicate", "copredicate", "free",
- "in", "forall", "exists",
- "seq", "set", "map", "multiset", "array", "array2", "array3",
- "match", "case",
- "fresh", "old", "choose", "where", "calc"
- );
-
- StringLiteral s = new StringLiteral("String", "'", StringFlags.AllowsDoubledQuote);
-
- Terminal dot = ToTerm(".", "dot");
- Terminal less = ToTerm("<");
- Terminal greater = ToTerm(">");
- Terminal arrow = ToTerm("=>");
- Terminal LBracket = ToTerm("[");
- Terminal RBracket = ToTerm("]");
- Terminal LParen = ToTerm("(");
- Terminal RParen = ToTerm(")");
- Terminal RCurly = ToTerm("}");
- Terminal LCurly = ToTerm("{");
- Terminal LMb = ToTerm("<[");
- Terminal RMb = ToTerm("]>");
- Terminal comma = ToTerm(",");
- Terminal semicolon = ToTerm(";");
- Terminal colon = ToTerm(":");
-
- #endregion
-
- #region 2. Non-terminals
- #region 2.1 Expressions
- NonTerminal expression = new NonTerminal("Expr");
- NonTerminal BinOp = new NonTerminal("BinOp");
- NonTerminal LUnOp = new NonTerminal("LUnOp");
- NonTerminal RUnOp = new NonTerminal("RUnOp");
-
- NonTerminal ArrayConstructor = new NonTerminal("ArrayConstructor");
- NonTerminal MObjectConstructor = new NonTerminal("MObjectConstructor");
- NonTerminal MObjectList = new NonTerminal("MObjectList");
- #endregion
-
- #region 2.2 QualifiedName
- //Expression List: expr1, expr2, expr3, ..
- NonTerminal expressionList = new NonTerminal("ExprList");
- NonTerminal identList = new NonTerminal("identList");
- //A name in form: a.b.c().d[1,2].e ....
- NonTerminal NewStmt = new NonTerminal("NewStmt");
- NonTerminal NewArrStmt = new NonTerminal("NewArrStmt");
- NonTerminal QualifiedName = new NonTerminal("QualifiedName");
- NonTerminal GenericsPostfix = new NonTerminal("GenericsPostfix");
- NonTerminal ArrayExpression = new NonTerminal("ArrayExpression");
- NonTerminal FunctionExpression = new NonTerminal("FunctionExpression");
- NonTerminal selectExpr = new NonTerminal("selectExpr");
- #endregion
-
- #region 2.3 Statement
- NonTerminal Condition = new NonTerminal("Condition");
-
- NonTerminal Statement = new NonTerminal("Statement");
- NonTerminal Statements = new NonTerminal("Statements");
-
- //Block
- NonTerminal blockStatement = new NonTerminal("CompoundStatement");
- #endregion
-
- #region 2.4 Program and Functions
- NonTerminal Prog = new NonTerminal("Prog");
- NonTerminal anything = new NonTerminal("anything"); // temporary hack
- NonTerminal declaration = new NonTerminal("declaration");
- NonTerminal classDecl = new NonTerminal("class decl");
- NonTerminal memberDecl = new NonTerminal("member decl");
- NonTerminal fieldDecl = new NonTerminal("field declaration");
- NonTerminal idType = new NonTerminal("identifier type");
- NonTerminal typeDecl = new NonTerminal("type reference");
- NonTerminal methodDecl = new NonTerminal("method declaration");
- NonTerminal formalParameters = new NonTerminal("formals");
- NonTerminal methodSpec = new NonTerminal("method spec");
- NonTerminal formalsList = new NonTerminal("ParamaterListOpt");
- NonTerminal functionDecl = new NonTerminal("function declaration");
- NonTerminal predicateDecl = new NonTerminal("predicate declaration");
- NonTerminal invariantDecl = new NonTerminal("invariant declaration");
- NonTerminal Semi = new NonTerminal("semi");
- NonTerminal Rhs = new NonTerminal("right-hand side");
- NonTerminal FieldInit = new NonTerminal("field init");
- NonTerminal FieldInits = new NonTerminal("field inits");
- NonTerminal installBounds = new NonTerminal("installBounds");
- NonTerminal localVarStmt = new NonTerminal("localVarStmt");
- NonTerminal evalstate = new NonTerminal("evalstate");
- NonTerminal channelDecl = new NonTerminal("channel declaration");
- NonTerminal loopSpec = new NonTerminal("loop specification");
- NonTerminal rdPermArg = new NonTerminal("rdPermArg");
- #endregion
-
- #endregion
-
- #region 3. BNF rules
-
- Semi.Rule = semicolon;
-
- #region 3.1 Expressions
- selectExpr.Rule = (ToTerm("this") + ".").Q() + QualifiedName;
- evalstate.Rule =
- ident + ToTerm(".") +
- (ToTerm("acquire")
- | "release"
- | "fork" + FunctionExpression
- )
- ;
- rdPermArg.Rule = ToTerm("*") | expression;
-
- expression.Rule = ToTerm("true")
- | "false"
- | "null"
- | "maxlock"
- | "lockbottom"
- | "this"
- | "result"
- | s
- | n
- | QualifiedName
- // The following is needed: to parse "A<B ..." either as comparison or as beginning of GenericsPostfix
- | QualifiedName + less + expression
- //| QualifiedName + less + QualifiedName + greater
- //| NewStmt
- | NewArrStmt
- | ArrayExpression
- | FunctionExpression
- | ArrayConstructor
- | MObjectConstructor
- | expression + BinOp + expression
- | LUnOp + expression
- | expression + RUnOp
- | LMb + declaration.Star() + RMb
- | LParen + expression + RParen
- | ToTerm("unfolding") + expression + "in" + expression
- | ToTerm("acc") + "(" + selectExpr + (("," + expression) | Empty) + ")"
- | ToTerm("old") + "(" + expression + ")"
- | ToTerm("eval") + "(" + evalstate + "," + expression + ")"
- | ToTerm("credit") + "(" + expression + "," + expression + ")"
- | ToTerm("credit") + "(" + expression + ")"
- | expression + PreferShiftHere() + "?" + expression + ":" + expression
- | ToTerm("rd") +
- (ToTerm("holds") + "(" + expression + ")"
- | "(" + selectExpr + rdPermArg.Q() + ")"
- )
-
- ;
- expressionList.Rule = MakePlusRule(expressionList, comma, expression);
- identList.Rule = MakePlusRule(identList, comma, ident);
- NewStmt.Rule = "new" + QualifiedName + GenericsPostfix.Q() + LParen + expressionList.Q() + RParen;
- NewArrStmt.Rule = "new" + QualifiedName + GenericsPostfix.Q() + LBracket + expressionList.Q() + RBracket;
- BinOp.Rule = ToTerm("+") | "-" | "*" | "/" | "%" | "^" | "&" | "|"
- | "&&" | "||" | "==" | "!=" | greater | less
- | ">=" | "<=" | "is"
- | "=" | "+=" | "-="
- | "."
- | "==>" | "<==>" | "<<"
- | "=" // this is for datatype declarations, not an operator
- ;
-
- LUnOp.Rule = ToTerm("-") | "~" | "!";
- RUnOp.Rule = ToTerm("++") | "--";
-
- ArrayConstructor.Rule = LBracket + expressionList + RBracket;
- MObjectConstructor.Rule = LBracket + ident + arrow + expression + MObjectList.Star() + RBracket;
- MObjectList.Rule = comma + ident + arrow + expression;
- #endregion
-
- #region 3.2 QualifiedName
- ArrayExpression.Rule = QualifiedName + LBracket + expressionList + RBracket;
- FunctionExpression.Rule = QualifiedName + LParen + expressionList.Q() + RParen;
-
- QualifiedName.Rule = ident | QualifiedName + dot + ident;
-
-
- GenericsPostfix.Rule = less + QualifiedName + greater;
-
- //ExprList.Rule = Expr.Plus(comma);
- #endregion
-
- #region 3.3 Statement
- Condition.Rule = LParen + expression + RParen;
- installBounds.Rule
- = "installBounds"
- //= ToTerm("between") + expressionList + "and" + expressionList
- //| "below" + expressionList
- //| "below" + expressionList + "above" + expressionList
- //| "above" + expressionList
- //| "above" + expressionList + "below" + expressionList
- ;
- FieldInit.Rule
- = ident + ":=" + expression
- ;
- FieldInits.Rule = MakeStarRule(FieldInits, ToTerm(","), FieldInit);
- Rhs.Rule
- = ToTerm("new") + ident
- | ToTerm("new") + ident + "{" + FieldInits + "}"
- | ToTerm("new") + ident + installBounds
- | ToTerm("new") + ident + "{" + FieldInits + "}" + installBounds
- | expression
- ;
- localVarStmt.Rule
- = idType + ":=" + Rhs + Semi
- | idType + Semi
- ;
- loopSpec.Rule
- = ToTerm("invariant") + expression + Semi
- | "lockchange" + expressionList + Semi
- ;
-
-
-
- Statement.Rule = Semi
- | "if" + Condition + Statement
- | "if" + Condition + Statement + PreferShiftHere() + "else" + Statement
- | "while" + Condition + loopSpec.Star() + Statement
- | "for" + LParen + expression.Q() + Semi + expression.Q() + Semi + expression.Q() + RParen + Statement
- | blockStatement
- | expression + Semi
- | "break" + Semi
- | QualifiedName + ":=" + Rhs
-
- | "var" + localVarStmt
-
- | "assert" + expression + Semi
- | "assume" + expression + Semi
-
- ;
- Statements.Rule = MakeStarRule(Statements, null, Statement);
- blockStatement.Rule = LCurly + Statements + RCurly;
-
-
- #endregion
-
- #region 3.4 Prog
- Prog.Rule = anything.Star() + Eof;
-
- anything.Rule
- = ToTerm("class")
- | "ghost"
- | "static"
- | "var"
- | "method"
- | "constructor"
- | "datatype"
- | "codatatype"
- | "type"
- | "iterator"
- | "assert"
- | "assume"
- | "new"
- | "this"
- | "object"
- | "refines"
- | "module"
- | "import"
- | "default"
- | "opened"
- | "as"
- | "if"
- | "then"
- | "else"
- | "while"
- | "invariant"
- | "break"
- | "label"
- | "return"
- | "yield"
- | "parallel"
- | "calc"
- | "print"
- | "returns"
- | "yields"
- | "requires"
- | "ensures"
- | "modifies"
- | "reads"
- | "decreases"
- | "bool"
- | "nat"
- | "int"
- | "false"
- | "true"
- | "null"
- | "function"
- | "predicate"
- | "copredicate"
- | "free"
- | "in"
- | "forall"
- | "exists"
- | "seq"
- | "set"
- | "map"
- | "multiset"
- | "array"
- | "array2"
- | "array3"
- | "match"
- | "case"
- | "fresh"
- | "old"
- | "choose"
- | "where"
- | ident
- | "}"
- | "{"
- | "("
- | ")"
- | "["
- | "]"
- | ","
- | ":"
- | ";"
- | "=" // this is for datatype declarations, not an operator
- | "."
- | "`"
- | "=="
- | "!="
- | "<"
- | "<="
- | ">="
- | ">"
- | "=>"
- | ":="
- | "+"
- | "-"
- | "*"
- | "/"
- | "%"
- | "!!"
- | "|"
- | "!"
- | "&&"
- | "||"
- | "==>"
- | "<==>"
- | "#"
- | n
- | stringLiteral
- ;
-
- Terminal Comment = new CommentTerminal("Comment", "/*", "*/");
- NonGrammarTerminals.Add(Comment);
- Terminal LineComment = new CommentTerminal("LineComment", "//", "\n");
- NonGrammarTerminals.Add(LineComment);
- #endregion
- #endregion
-
- #region 4. Set starting symbol
- this.Root = Prog; // Set grammar root
- #endregion
-
- #region 5. Operators precedence
- // not used
- #endregion
-
- #region 6. Punctuation symbols
- RegisterPunctuation("(", ")", "[", "]", "{", "}", ",", ";");
- #endregion
- }
- }
-}
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/Guids.cs b/Util/VS2010/Dafny/DafnyLanguageService/Guids.cs
deleted file mode 100644
index 61ea05d4..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/Guids.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-
-namespace Demo
-{
- static class GuidList
- {
- public const string guidIronyLanguageServiceString = "1F9687D0-937C-428E-ACFF-A7622A14100C";
- public const string guidIronyLanguageServicePkgString = "F85E7515-4CA6-42A5-86E0-D2312AE91D23";
- public const string guidIronyLanguageServiceCmdSetString = "68251AE3-0205-4FC9-8B12-D4C3EA9F8D6C";
-
- public static readonly Guid guidIronyLanguageServiceCmdSet = new Guid(guidIronyLanguageServiceCmdSetString);
- };
-} \ No newline at end of file
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/Integration/AuthoringScope.cs b/Util/VS2010/Dafny/DafnyLanguageService/Integration/AuthoringScope.cs
deleted file mode 100644
index 9a49dbe4..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/Integration/AuthoringScope.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.TextManager.Interop;
-using Microsoft.VisualStudio.Package;
-
-namespace Demo
-{
- public class AuthoringScope : Microsoft.VisualStudio.Package.AuthoringScope
- {
- public AuthoringScope(object parseResult)
- {
- this.parseResult = parseResult;
-
- // how should this be set?
- this.resolver = new Resolver();
- }
-
- object parseResult;
- IASTResolver resolver;
-
- // ParseReason.QuickInfo
- public override string GetDataTipText(int line, int col, out TextSpan span)
- {
- span = new TextSpan();
- return null;
- }
-
- // ParseReason.CompleteWord
- // ParseReason.DisplayMemberList
- // ParseReason.MemberSelect
- // ParseReason.MemberSelectAndHilightBraces
- public override Microsoft.VisualStudio.Package.Declarations GetDeclarations(IVsTextView view, int line, int col, TokenInfo info, ParseReason reason)
- {
- IList<Declaration> declarations;
- switch (reason)
- {
- case ParseReason.CompleteWord:
- declarations = resolver.FindCompletions(parseResult, line, col);
- break;
- case ParseReason.DisplayMemberList:
- case ParseReason.MemberSelect:
- case ParseReason.MemberSelectAndHighlightBraces:
- declarations = resolver.FindMembers(parseResult, line, col);
- break;
- default:
- throw new ArgumentException("reason");
- }
-
- return new Declarations(declarations);
- }
-
- // ParseReason.GetMethods
- public override Microsoft.VisualStudio.Package.Methods GetMethods(int line, int col, string name)
- {
- return new Methods(resolver.FindMethods(parseResult, line, col, name));
- }
-
- // ParseReason.Goto
- public override string Goto(VSConstants.VSStd97CmdID cmd, IVsTextView textView, int line, int col, out TextSpan span)
- {
- span = new TextSpan();
- return null;
- }
- }
-} \ No newline at end of file
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/Integration/Configuration.cs b/Util/VS2010/Dafny/DafnyLanguageService/Integration/Configuration.cs
deleted file mode 100644
index f7412393..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/Integration/Configuration.cs
+++ /dev/null
@@ -1,116 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Microsoft.VisualStudio.Package;
-using Microsoft.VisualStudio.TextManager.Interop;
-
-namespace Demo
-{
- public static partial class Configuration
- {
- public static Grammar Grammar = new Grammar();
- static List<Microsoft.VisualStudio.TextManager.Interop.IVsColorableItem> colorableItems = new List<Microsoft.VisualStudio.TextManager.Interop.IVsColorableItem>();
-
- public static IList<Microsoft.VisualStudio.TextManager.Interop.IVsColorableItem> ColorableItems
- {
- get { return colorableItems; }
- }
-
- public static TokenColor CreateColor(string name, COLORINDEX foreground, COLORINDEX background)
- {
- return CreateColor(name, foreground, background, false, false);
- }
-
- public static TokenColor CreateColor(string name, COLORINDEX foreground, COLORINDEX background, bool bold, bool strikethrough)
- {
- colorableItems.Add(new ColorableItem(name, foreground, background, bold, strikethrough));
- return (TokenColor)colorableItems.Count;
- }
-
- public static void ColorToken(string tokenName, TokenType type, TokenColor color, TokenTriggers trigger)
- {
- definitions[tokenName] = new TokenDefinition(type, color, trigger);
- }
-
- public static TokenDefinition GetDefinition(string tokenName)
- {
- TokenDefinition result;
- return definitions.TryGetValue(tokenName, out result) ? result : defaultDefinition;
- }
-
- private static TokenDefinition defaultDefinition = new TokenDefinition(TokenType.Text, TokenColor.Text, TokenTriggers.None);
- private static Dictionary<string, TokenDefinition> definitions = new Dictionary<string, TokenDefinition>();
-
- public struct TokenDefinition
- {
- public TokenDefinition(TokenType type, TokenColor color, TokenTriggers triggers)
- {
- this.TokenType = type;
- this.TokenColor = color;
- this.TokenTriggers = triggers;
- }
-
- public TokenType TokenType;
- public TokenColor TokenColor;
- public TokenTriggers TokenTriggers;
- }
- }
-
- public class ColorableItem : Microsoft.VisualStudio.TextManager.Interop.IVsColorableItem
- {
- private string displayName;
- private COLORINDEX background;
- private COLORINDEX foreground;
- private uint fontFlags = (uint)FONTFLAGS.FF_DEFAULT;
-
- public ColorableItem(string displayName, COLORINDEX foreground, COLORINDEX background, bool bold, bool strikethrough)
- {
- this.displayName = displayName;
- this.background = background;
- this.foreground = foreground;
-
- if (bold)
- this.fontFlags = this.fontFlags | (uint)FONTFLAGS.FF_BOLD;
- if (strikethrough)
- this.fontFlags = this.fontFlags | (uint)FONTFLAGS.FF_STRIKETHROUGH;
- }
-
- #region IVsColorableItem Members
- public int GetDefaultColors(COLORINDEX[] piForeground, COLORINDEX[] piBackground)
- {
- if (null == piForeground)
- {
- throw new ArgumentNullException("piForeground");
- }
- if (0 == piForeground.Length)
- {
- throw new ArgumentOutOfRangeException("piForeground");
- }
- piForeground[0] = foreground;
-
- if (null == piBackground)
- {
- throw new ArgumentNullException("piBackground");
- }
- if (0 == piBackground.Length)
- {
- throw new ArgumentOutOfRangeException("piBackground");
- }
- piBackground[0] = background;
-
- return Microsoft.VisualStudio.VSConstants.S_OK;
- }
-
- public int GetDefaultFontFlags(out uint pdwFontFlags)
- {
- pdwFontFlags = this.fontFlags;
- return Microsoft.VisualStudio.VSConstants.S_OK;
- }
-
- public int GetDisplayName(out string pbstrName)
- {
- pbstrName = displayName;
- return Microsoft.VisualStudio.VSConstants.S_OK;
- }
- #endregion
- }
-} \ No newline at end of file
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/Integration/Declaration.cs b/Util/VS2010/Dafny/DafnyLanguageService/Integration/Declaration.cs
deleted file mode 100644
index c0fda5ca..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/Integration/Declaration.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace Demo
-{
- public struct Declaration : IComparable<Declaration>
- {
- public Declaration(string description, string displayText, int glyph, string name)
- {
- this.Description = description;
- this.DisplayText = displayText;
- this.Glyph = glyph;
- this.Name = name;
- }
-
- public string Description;
- public string DisplayText;
- public int Glyph;
- public string Name;
-
- #region IComparable<Declaration> Members
-
- public int CompareTo(Declaration other)
- {
- return DisplayText.CompareTo(other.DisplayText);
- }
-
- #endregion
- }
-} \ No newline at end of file
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/Integration/Declarations.cs b/Util/VS2010/Dafny/DafnyLanguageService/Integration/Declarations.cs
deleted file mode 100644
index 98a411ce..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/Integration/Declarations.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-/***************************************************************************
-
-Copyright (c) Microsoft Corporation. All rights reserved.
-This code is licensed under the Visual Studio SDK license terms.
-THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
-ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
-IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
-PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
-
-***************************************************************************/
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Microsoft.VisualStudio.TextManager.Interop;
-using Microsoft.VisualStudio.Package;
-
-namespace Demo
-{
- public class Declarations : Microsoft.VisualStudio.Package.Declarations
- {
- IList<Declaration> declarations;
- public Declarations(IList<Declaration> declarations)
- {
- this.declarations = declarations;
- }
-
- public override int GetCount()
- {
- return declarations.Count;
- }
-
- public override string GetDescription(int index)
- {
- return declarations[index].Description;
- }
-
- public override string GetDisplayText(int index)
- {
- return declarations[index].DisplayText;
- }
-
- public override int GetGlyph(int index)
- {
- return declarations[index].Glyph;
- }
-
- public override string GetName(int index)
- {
- if (index >= 0)
- return declarations[index].Name;
-
- return null;
- }
- }
-} \ No newline at end of file
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/Integration/IASTResolver.cs b/Util/VS2010/Dafny/DafnyLanguageService/Integration/IASTResolver.cs
deleted file mode 100644
index 8de1a454..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/Integration/IASTResolver.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace Demo
-{
- interface IASTResolver
- {
- IList<Declaration> FindCompletions(object result, int line, int col);
- IList<Declaration> FindMembers(object result, int line, int col);
- string FindQuickInfo(object result, int line, int col);
- IList<Method> FindMethods(object result, int line, int col, string name);
- }
-} \ No newline at end of file
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/Integration/IronyLanguageService.cs b/Util/VS2010/Dafny/DafnyLanguageService/Integration/IronyLanguageService.cs
deleted file mode 100644
index ce43e6e4..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/Integration/IronyLanguageService.cs
+++ /dev/null
@@ -1,373 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.TextManager.Interop;
-using Microsoft.VisualStudio.Package;
-
-using Irony.Parsing;
-using Irony.Ast;
-
-using System.IO;
-
-namespace Demo
-{
- public class IronyLanguageService : Microsoft.VisualStudio.Package.LanguageService
- {
- private Grammar grammar;
- private Parser parser;
- private ParsingContext context;
-
- public IronyLanguageService()
- {
- grammar = new Grammar();
- parser = new Parser(Configuration.Grammar);
- context = new ParsingContext(parser);
- }
-
-
- #region Custom Colors
- public override int GetColorableItem(int index, out IVsColorableItem item)
- {
- if (index <= Configuration.ColorableItems.Count)
- {
- item = Configuration.ColorableItems[index - 1];
- return Microsoft.VisualStudio.VSConstants.S_OK;
- }
- else
- {
- throw new ArgumentNullException("index");
- }
- }
-
- public override int GetItemCount(out int count)
- {
- count = Configuration.ColorableItems.Count;
- return Microsoft.VisualStudio.VSConstants.S_OK;
- }
- #endregion
-
- #region MPF Accessor and Factory specialisation
- private LanguagePreferences preferences;
- public override LanguagePreferences GetLanguagePreferences()
- {
- if (this.preferences == null)
- {
- this.preferences = new LanguagePreferences(this.Site,
- typeof(IronyLanguageService).GUID,
- this.Name);
- this.preferences.Init();
- }
-
- return this.preferences;
- }
-
- public override Microsoft.VisualStudio.Package.Source CreateSource(IVsTextLines buffer)
- {
- return new Source(this, buffer, this.GetColorizer(buffer));
- }
-
- private IScanner scanner;
- public override IScanner GetScanner(IVsTextLines buffer)
- {
- if (scanner == null)
- this.scanner = new LineScanner(grammar);
-
- return this.scanner;
- }
- #endregion
-
- public override void OnIdle(bool periodic)
- {
- // from IronPythonLanguage sample
- // this appears to be necessary to get a parse request with ParseReason = Check?
- Source src = (Source)GetSource(this.LastActiveTextView);
- if (src != null && src.LastParseTime >= Int32.MaxValue >> 12)
- {
- src.LastParseTime = 0;
- }
- base.OnIdle(periodic);
- }
-
- public override Microsoft.VisualStudio.Package.AuthoringScope ParseSource(ParseRequest req)
- {
- Debug.Print("ParseSource at ({0}:{1}), reason {2}", req.Line, req.Col, req.Reason);
- Source source = (Source)this.GetSource(req.FileName);
- switch (req.Reason)
- {
- case ParseReason.Check:
- // This is where you perform your syntax highlighting.
- // Parse entire source as given in req.Text.
- // Store results in the AuthoringScope object.
- var parsed = parser.Parse(req.Text, req.FileName);
- var root = parsed.Root;
- if (root != null) {
-
- AstNode node = (AstNode)root.AstNode;
- source.ParseResult = node;
- }
-
- // Used for brace matching.
- TokenStack braces = parser.Context.OpenBraces;
- foreach (Token brace in braces) {
- if (brace.OtherBrace == null) continue;
- TextSpan openBrace = new TextSpan();
- openBrace.iStartLine = brace.Location.Line;
- openBrace.iStartIndex = brace.Location.Column;
- openBrace.iEndLine = brace.Location.Line;
- openBrace.iEndIndex = openBrace.iStartIndex + brace.Length;
-
- TextSpan closeBrace = new TextSpan();
- closeBrace.iStartLine = brace.OtherBrace.Location.Line;
- closeBrace.iStartIndex = brace.OtherBrace.Location.Column;
- closeBrace.iEndLine = brace.OtherBrace.Location.Line;
- closeBrace.iEndIndex = closeBrace.iStartIndex + brace.OtherBrace.Length;
-
- if (source.Braces == null) {
- source.Braces = new List<TextSpan[]>();
- }
- source.Braces.Add(new TextSpan[2] { openBrace, closeBrace });
- }
-
- if (parser.Context.CurrentParseTree.ParserMessages.Count > 0) {
- foreach (ParserMessage error in parser.Context.CurrentParseTree.ParserMessages) {
- TextSpan span = new TextSpan();
- span.iStartLine = span.iEndLine = error.Location.Line - 1;
- span.iStartIndex = error.Location.Column;
- span.iEndIndex = error.Location.Position;
- req.Sink.AddError(req.FileName, error.Message, span, Severity.Error);
- }
- } else { // parse looks okay, send it to Dafny.
- if (!File.Exists(@"C:\tmp\StartDafny.bat")) {
- AddErrorBecauseOfToolProblems(req, @"Can't find C:\tmp\StartDafny.bat");
- } else {
-
- // From: http://dotnetperls.com/process-redirect-standard-output
- // (Also, see: http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.redirectstandardoutput.aspx)
- //
- // Setup the process with the ProcessStartInfo class.
- //
- ProcessStartInfo start = new ProcessStartInfo();
- start.FileName = @"cmd.exe";
- start.Arguments = @"/c C:\tmp\StartDafny.bat"; // Specify exe name.
- start.UseShellExecute = false;
- start.RedirectStandardInput = true;
- start.RedirectStandardOutput = true;
- start.CreateNoWindow = true;
- //start.WindowStyle = ProcessWindowStyle.Minimized; // need this or else you see the window pop up
- //
- // Start the process.
- //
- using (Process process = Process.Start(start)) {
- //
- // Push the file contents to the new process
- //
- StreamWriter myStreamWriter = process.StandardInput;
- myStreamWriter.WriteLine(req.Text);
- myStreamWriter.Close();
- //
- // Read in all the text from the process with the StreamReader.
- //
- using (StreamReader reader = process.StandardOutput) {
- //string result = reader.ReadToEnd();
- //Console.Write(result);
-
- for (string line = reader.ReadLine(); line != null; line = reader.ReadLine()) {
- // the lines of interest have the form "filename(line,col): some_error_label: error_message"
- // where "some_error_label" is "Error" or "syntax error" or "Error BP5003" or "Related location"
- if (line.Equals("")) continue;
- if (line.StartsWith("Dafny program verifier finished with"))
- {
- if (line.Contains("time out"))
- {
- AddErrorBecauseOfToolProblems(req, "Verification timed out.");
- }
- else
- {
- if (!line.Contains("inconclusive") && !line.Contains("out of memory"))
- {
- if (line.Contains(" 0 errors"))
- AddMessage(req, "Verification successful.");
- }
- else
- {
- AddErrorBecauseOfToolProblems(req, "Internal verification fault.");
- }
- }
- break;
- }
- string message;
- int n = line.IndexOf("): ", 2); // we start at 2, to avoid problems with "C:\..."
- if (n == -1) {
- continue;
- } else {
- int m = line.IndexOf(": ", n + 3);
- if (m == -1) {
- continue;
- }
- message = line.Substring(m + 2);
- }
- line = line.Substring(0, n); // line now has the form "filename(line,col"
-
- n = line.LastIndexOf(',');
- if (n == -1) { continue; }
- var colString = line.Substring(n + 1);
- line = line.Substring(0, n); // line now has the form "filename(line"
-
- n = line.LastIndexOf('(');
- if (n == -1) { continue; }
- var lineString = line.Substring(n + 1);
-
- try {
- TextSpan span = new TextSpan();
- span.iStartLine = span.iEndLine = Int32.Parse(lineString) - 1;
- span.iStartIndex = Int32.Parse(colString) - 1;
- span.iEndIndex = span.iStartIndex + 5; // hack
- req.Sink.AddError(req.FileName, message, span, Severity.Error);
- } catch (System.FormatException) {
- continue;
- } catch (System.OverflowException) {
- continue;
- }
- }
- }
- }
- }
- }
-
- break;
-
- case ParseReason.DisplayMemberList:
- // Parse the line specified in req.Line for the two
- // tokens just before req.Col to obtain the identifier
- // and the member connector symbol.
- // Examine existing parse tree for members of the identifer
- // and return a list of members in your version of the
- // Declarations class as stored in the AuthoringScope
- // object.
- break;
-
- case ParseReason.MethodTip:
- // Parse the line specified in req.Line for the token
- // just before req.Col to obtain the name of the method
- // being entered.
- // Examine the existing parse tree for all method signatures
- // with the same name and return a list of those signatures
- // in your version of the Methods class as stored in the
- // AuthoringScope object.
- break;
-
- case ParseReason.HighlightBraces:
- case ParseReason.MemberSelectAndHighlightBraces:
- if (source.Braces != null)
- {
- foreach (TextSpan[] brace in source.Braces)
- {
- if (brace.Length == 2)
- req.Sink.MatchPair(brace[0], brace[1], 1);
- else if (brace.Length >= 3)
- req.Sink.MatchTriple(brace[0], brace[1], brace[2], 1);
- }
- }
- break;
- }
-
- return new AuthoringScope(source.ParseResult);
- }
-
- private static void AddErrorBecauseOfToolProblems(ParseRequest req, string msg)
- {
- TextSpan span = new TextSpan();
- span.iStartLine = span.iEndLine = 0;
- span.iStartIndex = 0;
- span.iEndIndex = 0;
- req.Sink.AddError(req.FileName, msg, span, Severity.Error);
- }
- private static void AddMessage(ParseRequest req, string msg)
- {
- TextSpan span = new TextSpan();
- span.iStartLine = span.iEndLine = 0;
- span.iStartIndex = 0;
- span.iEndIndex = 1;
- req.Sink.AddError(req.FileName, msg, span, Severity.Hint);
- }
-
- /// <summary>
- /// Called to determine if the given location can have a breakpoint applied to it.
- /// </summary>
- /// <param name="buffer">The IVsTextBuffer object containing the source file.</param>
- /// <param name="line">The line number where the breakpoint is to be set.</param>
- /// <param name="col">The offset into the line where the breakpoint is to be set.</param>
- /// <param name="pCodeSpan">
- /// Returns the TextSpan giving the extent of the code affected by the breakpoint if the
- /// breakpoint can be set.
- /// </param>
- /// <returns>
- /// If successful, returns S_OK; otherwise returns S_FALSE if there is no code at the given
- /// position or returns an error code (the validation is deferred until the debug engine is loaded).
- /// </returns>
- /// <remarks>
- /// <para>
- /// CAUTION: Even if you do not intend to support the ValidateBreakpointLocation but your language
- /// does support breakpoints, you must override the ValidateBreakpointLocation method and return a
- /// span that contains the specified line and column; otherwise, breakpoints cannot be set anywhere
- /// except line 1. You can return E_NOTIMPL to indicate that you do not otherwise support this
- /// method but the span must always be set. The example shows how this can be done.
- /// </para>
- /// <para>
- /// Since the language service parses the code, it generally knows what is considered code and what
- /// is not. Normally, the debug engine is loaded and the pending breakpoints are bound to the source. It is at this time the breakpoint location is validated. This method is a fast way to determine if a breakpoint can be set at a particular location without loading the debug engine.
- /// </para>
- /// <para>
- /// You can implement this method to call the ParseSource method with the parse reason of CodeSpan.
- /// The parser examines the specified location and returns a span identifying the code at that
- /// location. If there is code at the location, the span identifying that code should be passed to
- /// your implementation of the CodeSpan method in your version of the AuthoringSink class. Then your
- /// implementation of the ValidateBreakpointLocation method retrieves that span from your version of
- /// the AuthoringSink class and returns that span in the pCodeSpan argument.
- /// </para>
- /// <para>
- /// The base method returns E_NOTIMPL.
- /// </para>
- /// </remarks>
- public override int ValidateBreakpointLocation(IVsTextBuffer buffer, int line, int col, TextSpan[] pCodeSpan)
- {
- // TODO: Add code to not allow breakpoints to be placed on non-code lines.
- // TODO: Refactor to allow breakpoint locations to span multiple lines.
- if (pCodeSpan != null)
- {
- pCodeSpan[0].iStartLine = line;
- pCodeSpan[0].iStartIndex = col;
- pCodeSpan[0].iEndLine = line;
- pCodeSpan[0].iEndIndex = col;
- if (buffer != null)
- {
- int length;
- buffer.GetLengthOfLine(line, out length);
- pCodeSpan[0].iStartIndex = 0;
- pCodeSpan[0].iEndIndex = length;
- }
- return VSConstants.S_OK;
- }
- else
- {
- return VSConstants.S_FALSE;
- }
- }
-
- public override ViewFilter CreateViewFilter(CodeWindowManager mgr, IVsTextView newView)
- {
- return new IronyViewFilter(mgr, newView);
- }
-
- public override string Name
- {
- get { return Configuration.Name; }
- }
-
- public override string GetFormatFilterList()
- {
- return Configuration.FormatList;
- }
- }
-}
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/Integration/IronyViewFilter.cs b/Util/VS2010/Dafny/DafnyLanguageService/Integration/IronyViewFilter.cs
deleted file mode 100644
index 55c3509e..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/Integration/IronyViewFilter.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.VisualStudio.Package;
-using Microsoft.VisualStudio.TextManager.Interop;
-
-using VsCommands2K = Microsoft.VisualStudio.VSConstants.VSStd2KCmdID;
-
-namespace Demo
-{
- public class IronyViewFilter : ViewFilter
- {
- public IronyViewFilter(CodeWindowManager mgr, IVsTextView view)
- : base(mgr, view)
- {
-
- }
-
- public override void HandlePostExec(ref Guid guidCmdGroup, uint nCmdId, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut, bool bufferWasChanged)
- {
- if (guidCmdGroup == typeof(VsCommands2K).GUID)
- {
- VsCommands2K cmd = (VsCommands2K)nCmdId;
- switch (cmd)
- {
- case VsCommands2K.UP:
- case VsCommands2K.UP_EXT:
- case VsCommands2K.UP_EXT_COL:
- case VsCommands2K.DOWN:
- case VsCommands2K.DOWN_EXT:
- case VsCommands2K.DOWN_EXT_COL:
- Source.OnCommand(TextView, cmd, '\0');
- return;
- }
- }
-
-
- base.HandlePostExec(ref guidCmdGroup, nCmdId, nCmdexecopt, pvaIn, pvaOut, bufferWasChanged);
- }
- }
-}
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/Integration/LineScanner.cs b/Util/VS2010/Dafny/DafnyLanguageService/Integration/LineScanner.cs
deleted file mode 100644
index 966e9c43..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/Integration/LineScanner.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-using System;
-using Microsoft.VisualStudio.Package;
-using Irony.Parsing;
-
-namespace Demo
-{
- public class LineScanner : IScanner
- {
- private Parser parser;
-
- public LineScanner(Grammar grammar)
- {
- this.parser = new Parser(grammar);
- this.parser.Context.Mode = ParseMode.VsLineScan;
- }
-
- public bool ScanTokenAndProvideInfoAboutIt(TokenInfo tokenInfo, ref int state)
- {
- // Reads each token in a source line and performs syntax coloring. It will continue to
- // be called for the source until false is returned.
- Token token = parser.Scanner.VsReadToken(ref state);
-
- // !EOL and !EOF
- if (token != null && token.Terminal != Grammar.CurrentGrammar.Eof && token.Category != TokenCategory.Error)
- {
- tokenInfo.StartIndex = token.Location.Position;
- tokenInfo.EndIndex = tokenInfo.StartIndex + token.Length - 1;
- if (token.EditorInfo != null) {
- tokenInfo.Color = (Microsoft.VisualStudio.Package.TokenColor)token.EditorInfo.Color;
- tokenInfo.Type = (Microsoft.VisualStudio.Package.TokenType)token.EditorInfo.Type;
- }
-
- if (token.KeyTerm != null && token.KeyTerm.EditorInfo != null)
- {
- tokenInfo.Trigger =
- (Microsoft.VisualStudio.Package.TokenTriggers)token.KeyTerm.EditorInfo.Triggers;
- }
- else
- {
- if (token.EditorInfo != null) {
- tokenInfo.Trigger =
- (Microsoft.VisualStudio.Package.TokenTriggers)token.EditorInfo.Triggers;
- }
- }
-
- return true;
- }
-
- return false;
- }
-
- public void SetSource(string source, int offset)
- {
- // Stores line of source to be used by ScanTokenAndProvideInfoAboutIt.
- parser.Scanner.VsSetSource(source, offset);
- }
- }
-}
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/Integration/Method.cs b/Util/VS2010/Dafny/DafnyLanguageService/Integration/Method.cs
deleted file mode 100644
index c5071612..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/Integration/Method.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace Demo
-{
- public struct Method
- {
- public string Name;
- public string Description;
- public string Type;
- public IList<Parameter> Parameters;
- }
-
- public struct Parameter
- {
- public string Name;
- public string Display;
- public string Description;
- }
-} \ No newline at end of file
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/Integration/Methods.cs b/Util/VS2010/Dafny/DafnyLanguageService/Integration/Methods.cs
deleted file mode 100644
index 1d7c124f..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/Integration/Methods.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Microsoft.VisualStudio.TextManager.Interop;
-using Microsoft.VisualStudio.Package;
-
-namespace Demo
-{
- public class Methods : Microsoft.VisualStudio.Package.Methods
- {
- IList<Method> methods;
- public Methods(IList<Method> methods)
- {
- this.methods = methods;
- }
-
- public override int GetCount()
- {
- return methods.Count;
- }
-
- public override string GetName(int index)
- {
- return methods[index].Name;
- }
-
- public override string GetDescription(int index)
- {
- return methods[index].Description;
- }
-
- public override string GetType(int index)
- {
- return methods[index].Type;
- }
-
- public override int GetParameterCount(int index)
- {
- return (methods[index].Parameters == null) ? 0 : methods[index].Parameters.Count;
- }
-
- public override void GetParameterInfo(int index, int paramIndex, out string name, out string display, out string description)
- {
- Parameter parameter = methods[index].Parameters[paramIndex];
- name = parameter.Name;
- display = parameter.Display;
- description = parameter.Description;
- }
- }
-} \ No newline at end of file
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/Integration/Package.cs b/Util/VS2010/Dafny/DafnyLanguageService/Integration/Package.cs
deleted file mode 100644
index dc1244d6..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/Integration/Package.cs
+++ /dev/null
@@ -1,130 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Runtime.InteropServices;
-using Microsoft.VisualStudio.OLE.Interop;
-using MPF = Microsoft.VisualStudio.Package;
-using System.ComponentModel.Design;
-
-namespace Demo
-{
- public class IronyPackage : Microsoft.VisualStudio.Shell.Package, IOleComponent
- {
- uint componentID = 0;
- public IronyPackage()
- {
- ServiceCreatorCallback callback = new ServiceCreatorCallback(
- delegate(IServiceContainer container, Type serviceType)
- {
- if (typeof(IronyLanguageService) == serviceType)
- {
- IronyLanguageService language = new IronyLanguageService();
- language.SetSite(this);
-
- // register for idle time callbacks
- IOleComponentManager mgr = GetService(typeof(SOleComponentManager)) as IOleComponentManager;
- if (componentID == 0 && mgr != null)
- {
- OLECRINFO[] crinfo = new OLECRINFO[1];
- crinfo[0].cbSize = (uint)Marshal.SizeOf(typeof(OLECRINFO));
- crinfo[0].grfcrf = (uint)_OLECRF.olecrfNeedIdleTime |
- (uint)_OLECRF.olecrfNeedPeriodicIdleTime;
- crinfo[0].grfcadvf = (uint)_OLECADVF.olecadvfModal |
- (uint)_OLECADVF.olecadvfRedrawOff |
- (uint)_OLECADVF.olecadvfWarningsOff;
- crinfo[0].uIdleTimeInterval = 300;
- int hr = mgr.FRegisterComponent(this, crinfo, out componentID);
- }
-
- return language;
- }
- else
- {
- return null;
- }
- });
-
- // proffer the LanguageService
- (this as IServiceContainer).AddService(typeof(IronyLanguageService), callback, true);
- }
-
- protected override void Dispose(bool disposing)
- {
- try
- {
- if (componentID != 0)
- {
- IOleComponentManager mgr = GetService(typeof(SOleComponentManager)) as IOleComponentManager;
- if (mgr != null)
- {
- mgr.FRevokeComponent(componentID);
- }
- componentID = 0;
- }
- }
- finally
- {
- base.Dispose(disposing);
- }
- }
-
- #region IOleComponent Members
- public int FContinueMessageLoop(uint uReason, IntPtr pvLoopData, MSG[] pMsgPeeked)
- {
- return 1;
- }
-
- public int FDoIdle(uint grfidlef)
- {
- IronyLanguageService ls = GetService(typeof(IronyLanguageService)) as IronyLanguageService;
-
- if (ls != null)
- {
- ls.OnIdle((grfidlef & (uint)_OLEIDLEF.oleidlefPeriodic) != 0);
- }
-
- return 0;
- }
-
- public int FPreTranslateMessage(MSG[] pMsg)
- {
- return 0;
- }
-
- public int FQueryTerminate(int fPromptUser)
- {
- return 1;
- }
-
- public int FReserved1(uint dwReserved, uint message, IntPtr wParam, IntPtr lParam)
- {
- return 1;
- }
-
- public IntPtr HwndGetWindow(uint dwWhich, uint dwReserved)
- {
- return IntPtr.Zero;
- }
-
- public void OnActivationChange(IOleComponent pic, int fSameComponent, OLECRINFO[] pcrinfo, int fHostIsActivating, OLECHOSTINFO[] pchostinfo, uint dwReserved)
- {
- }
-
- public void OnAppActivate(int fActive, uint dwOtherThreadID)
- {
- }
-
- public void OnEnterState(uint uStateID, int fEnter)
- {
- }
-
- public void OnLoseActivation()
- {
- }
-
- public void Terminate()
- {
- }
- #endregion
- }
-} \ No newline at end of file
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/Integration/Resolver.cs b/Util/VS2010/Dafny/DafnyLanguageService/Integration/Resolver.cs
deleted file mode 100644
index 9f6ddeba..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/Integration/Resolver.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Irony.Parsing;
-
-namespace Demo
-{
- public class Resolver : Demo.IASTResolver
- {
- #region IASTResolver Members
-
-
- public IList<Demo.Declaration> FindCompletions(object result, int line, int col)
- {
- // Used for intellisense.
- List<Demo.Declaration> declarations = new List<Demo.Declaration>();
-
- // Add keywords defined by grammar
- foreach (KeyTerm key in Configuration.Grammar.KeyTerms.Values)
- {
- if(key.OptionIsSet(TermOptions.IsKeyword))
- {
- declarations.Add(new Declaration("", key.Name, 206, key.Name));
- }
- }
-
- declarations.Sort();
- return declarations;
- }
-
- public IList<Demo.Declaration> FindMembers(object result, int line, int col)
- {
- List<Demo.Declaration> members = new List<Demo.Declaration>();
-
- return members;
- }
-
- public string FindQuickInfo(object result, int line, int col)
- {
- return "unknown";
- }
-
- public IList<Demo.Method> FindMethods(object result, int line, int col, string name)
- {
- return new List<Demo.Method>();
- }
-
- #endregion
- }
-}
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/Integration/Source.cs b/Util/VS2010/Dafny/DafnyLanguageService/Integration/Source.cs
deleted file mode 100644
index 418bec01..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/Integration/Source.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-/***************************************************************************
-
-Copyright (c) Microsoft Corporation. All rights reserved.
-This code is licensed under the Visual Studio SDK license terms.
-THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
-ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
-IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
-PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
-
-***************************************************************************/
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Microsoft.VisualStudio.TextManager.Interop;
-using Microsoft.VisualStudio.Package;
-
-namespace Demo
-{
- public class Source : Microsoft.VisualStudio.Package.Source
- {
- public Source(LanguageService service, IVsTextLines textLines, Colorizer colorizer)
- : base(service, textLines, colorizer)
- {
- }
-
- private object parseResult;
- public object ParseResult
- {
- get { return parseResult; }
- set { parseResult = value; }
- }
-
- private IList<TextSpan[]> braces;
- public IList<TextSpan[]> Braces
- {
- get { return braces; }
- set { braces = value; }
- }
- }
-} \ No newline at end of file
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/IronyLanguageServicePackage.cs b/Util/VS2010/Dafny/DafnyLanguageService/IronyLanguageServicePackage.cs
deleted file mode 100644
index 29371f91..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/IronyLanguageServicePackage.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-// VsPkg.cs : Implementation of IronyLanguageService
-//
-
-using System;
-using System.Diagnostics;
-using System.Globalization;
-using System.Runtime.InteropServices;
-using System.ComponentModel.Design;
-using Microsoft.Win32;
-using Microsoft.VisualStudio.Shell.Interop;
-using Microsoft.VisualStudio.OLE.Interop;
-using Microsoft.VisualStudio.Shell;
-
-namespace Demo
-{
- /// <summary>
- /// This is the class that implements the package exposed by this assembly.
- ///
- /// The minimum requirement for a class to be considered a valid package for Visual Studio
- /// is to implement the IVsPackage interface and register itself with the shell.
- /// This package uses the helper classes defined inside the Managed Package Framework (MPF)
- /// to do it: it derives from the Package class that provides the implementation of the
- /// IVsPackage interface and uses the registration attributes defined in the framework to
- /// register itself and its components with the shell.
- /// </summary>
- // This attribute tells the registration utility (regpkg.exe) that this class needs
- // to be registered as package.
- [PackageRegistration(UseManagedResourcesOnly = true)]
- // A Visual Studio component can be registered under different regitry roots; for instance
- // when you debug your package you want to register it in the experimental hive. This
- // attribute specifies the registry root to use if no one is provided to regpkg.exe with
- // the /root switch.
- [DefaultRegistryRoot("Software\\Microsoft\\VisualStudio\\10.0Exp")]
- // This attribute is used to register the informations needed to show the this package
- // in the Help/About dialog of Visual Studio.
- [InstalledProductRegistration(/*false,*/ "#110", "#112", "1.0", IconResourceID = 400)]
- // This attribute will make your language service accessible by other packages installed.
- [ProvideService(typeof(IronyLanguageService))]
- // This attribute(s) associates file extensions with your language service.
- [ProvideLanguageExtension(typeof(IronyLanguageService), ".dfy")]
-
- // This attributes informs Visual Studio that this package provides a langauge service and
- // which features are implemented.
- [ProvideLanguageService(typeof(IronyLanguageService), Configuration.Name, 0,
- CodeSense = true,
- EnableCommenting = true,
- MatchBraces = true,
- MatchBracesAtCaret = true,
- ShowMatchingBrace = true,
- AutoOutlining = true)]
- // In order be loaded inside Visual Studio in a machine that has not the VS SDK installed,
- // package needs to have a valid load key (it can be requested at
- // http://msdn.microsoft.com/vstudio/extend/). This attributes tells the shell that this
- // package has a load key embedded in its resources.
- [ProvideLoadKey("Standard", "1.0", "Dafny", "Demo", 104)]
- [Guid(GuidList.guidIronyLanguageServicePkgString)]
- public sealed class DafnyLanguageService : IronyPackage
- {
- /// <summary>
- /// Default constructor of the package.
- /// Inside this method you can place any initialization code that does not require
- /// any Visual Studio service because at this point the package object is created but
- /// not sited yet inside Visual Studio environment. The place to do all the other
- /// initialization is the Initialize method.
- /// </summary>
- public DafnyLanguageService()
- {
- Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering constructor for: {0}", this.ToString()));
- }
-
-
-
- /////////////////////////////////////////////////////////////////////////////
- // Overriden Package Implementation
- #region Package Members
-
- /// <summary>
- /// Initialization of the package; this method is called right after the package is sited, so this is the place
- /// where you can put all the initilaization code that rely on services provided by VisualStudio.
- /// </summary>
- protected override void Initialize()
- {
- Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString()));
- base.Initialize();
-
- }
- #endregion
-
- }
-}
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/Key.snk b/Util/VS2010/Dafny/DafnyLanguageService/Key.snk
deleted file mode 100644
index f80a4ceb..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/Key.snk
+++ /dev/null
Binary files differ
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/Properties/AssemblyInfo.cs b/Util/VS2010/Dafny/DafnyLanguageService/Properties/AssemblyInfo.cs
deleted file mode 100644
index 118d4488..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System;
-using System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Package Name")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Company")]
-[assembly: AssemblyProduct("Package Name")]
-[assembly: AssemblyCopyright("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-[assembly: ComVisible(false)]
-[assembly: CLSCompliant(false)]
-[assembly: NeutralResourcesLanguage("en-US")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
-
-
-
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/Resources.Designer.cs b/Util/VS2010/Dafny/DafnyLanguageService/Resources.Designer.cs
deleted file mode 100644
index 0ca81303..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/Resources.Designer.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:4.0.21006.1
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace Demo {
- using System;
-
-
- /// <summary>
- /// A strongly-typed resource class, for looking up localized strings, etc.
- /// </summary>
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources() {
- }
-
- /// <summary>
- /// Returns the cached ResourceManager instance used by this class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Demo.DafnyLanguageService.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
- }
-}
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/Resources.resx b/Util/VS2010/Dafny/DafnyLanguageService/Resources.resx
deleted file mode 100644
index 03fef612..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/Resources.resx
+++ /dev/null
@@ -1,130 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- VS SDK Notes: This resx file contains the resources that will be consumed directly by your package.
- For example, if you chose to create a tool window, there is a resource with ID 'CanNotCreateWindow'. This
- is used in VsPkg.cs to determine the string to show the user if there is an error when attempting to create
- the tool window.
-
- Resources that are accessed directly from your package *by Visual Studio* are stored in the VSPackage.resx
- file.
--->
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-</root> \ No newline at end of file
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/Resources/Irony.dll b/Util/VS2010/Dafny/DafnyLanguageService/Resources/Irony.dll
deleted file mode 100644
index e2021a72..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/Resources/Irony.dll
+++ /dev/null
Binary files differ
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/VSPackage.resx b/Util/VS2010/Dafny/DafnyLanguageService/VSPackage.resx
deleted file mode 100644
index 68782536..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/VSPackage.resx
+++ /dev/null
@@ -1,129 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="104" xml:space="preserve">
- <value>Paste PLK Here</value>
- </data>
- <data name="110" xml:space="preserve">
- <value>Dafny</value>
- </data>
- <data name="112" xml:space="preserve">
- <value>Dafny Programming Language</value>
- </data>
-</root> \ No newline at end of file
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/source.extension.vsixmanifest b/Util/VS2010/Dafny/DafnyLanguageService/source.extension.vsixmanifest
deleted file mode 100644
index 58e160cd..00000000
--- a/Util/VS2010/Dafny/DafnyLanguageService/source.extension.vsixmanifest
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010">
-
- <Identifier Id="DafnyService.MicrosoftResearch.A38156F6-63DF-4E3C-8D23-07D3DE0D3388">
- <Name>DafnyService</Name>
- <Author>Microsoft Research</Author>
- <Version>1.0</Version>
- <Description>Information about my package</Description>
- <Locale>1033</Locale>
- <!--<InstalledByMSI>false</InstalledByMSI>-->
- <SupportedProducts>
- <VisualStudio Version="10.0">
- <Edition>Pro</Edition>
- <Edition>VST_All</Edition>
- </VisualStudio>
- </SupportedProducts>
- <SupportedFrameworkRuntimeEdition MinVersion="2.0" MaxVersion="4.0" />
- </Identifier>
-
- <References/>
-
- <Content>
- <VsPackage>
- DafnyService.pkgdef
- </VsPackage>
- </Content>
-</Vsix>
diff --git a/Util/VS2010/Dafny/StartDafny.bat b/Util/VS2010/Dafny/StartDafny.bat
deleted file mode 100644
index 71dc149a..00000000
--- a/Util/VS2010/Dafny/StartDafny.bat
+++ /dev/null
@@ -1,10 +0,0 @@
-@echo off
-echo ---------- Starting ------------ < nul >> c:\tmp\doo.out
-time < nul >> c:\tmp\doo.out
-echo. < nul >> c:\tmp\doo.out
-
-"c:\boogie\Binaries\Dafny.exe" -nologo stdin.dfy -compile:0 -timeLimit:10 %* 2>> c:\tmp\doo.out
-
-time < nul >> c:\tmp\doo.out
-echo. < nul >> c:\tmp\doo.out
-echo ---------- Done ------------ < nul >> c:\tmp\doo.out
diff --git a/Util/VS2010/DafnyExtension/DafnyExtension.sln b/Util/VS2010/DafnyExtension/DafnyExtension.sln
deleted file mode 100644
index fd450cc8..00000000
--- a/Util/VS2010/DafnyExtension/DafnyExtension.sln
+++ /dev/null
@@ -1,20 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DafnyExtension", "DafnyExtension\DafnyExtension.csproj", "{6E9A5E14-0763-471C-A129-80A879D9E7BA}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {6E9A5E14-0763-471C-A129-80A879D9E7BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6E9A5E14-0763-471C-A129-80A879D9E7BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6E9A5E14-0763-471C-A129-80A879D9E7BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6E9A5E14-0763-471C-A129-80A879D9E7BA}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Util/VS2010/DafnyExtension/DafnyExtension/BraceMatching.cs b/Util/VS2010/DafnyExtension/DafnyExtension/BraceMatching.cs
deleted file mode 100644
index 44b1affe..00000000
--- a/Util/VS2010/DafnyExtension/DafnyExtension/BraceMatching.cs
+++ /dev/null
@@ -1,253 +0,0 @@
-using System;
-using System.Linq;
-using System.Collections.Generic;
-using System.ComponentModel.Composition;
-using Microsoft.VisualStudio.Text;
-using Microsoft.VisualStudio.Text.Editor;
-using Microsoft.VisualStudio.Text.Tagging;
-using Microsoft.VisualStudio.Utilities;
-
-namespace DafnyLanguage
-{
- [Export(typeof(IViewTaggerProvider))]
- [ContentType("dafny")]
- [TagType(typeof(TextMarkerTag))]
- internal class BraceMatchingTaggerProvider : IViewTaggerProvider
- {
- [Import]
- internal IBufferTagAggregatorFactoryService AggregatorFactory = null;
-
- public ITagger<T> CreateTagger<T>(ITextView textView, ITextBuffer buffer) where T : ITag {
- if (textView == null)
- return null;
-
- //provide highlighting only on the top-level buffer
- if (textView.TextBuffer != buffer)
- return null;
-
- ITagAggregator<DafnyTokenTag> tagAggregator = AggregatorFactory.CreateTagAggregator<DafnyTokenTag>(buffer);
- return new BraceMatchingTagger(textView, buffer, tagAggregator) as ITagger<T>;
- }
- }
-
- internal abstract class TokenBasedTagger
- {
- ITagAggregator<DafnyTokenTag> _aggregator;
-
- internal TokenBasedTagger(ITagAggregator<DafnyTokenTag> tagAggregator) {
- _aggregator = tagAggregator;
- }
-
- public bool InsideComment(SnapshotPoint pt) {
- SnapshotSpan span = new SnapshotSpan(pt, 1);
- foreach (var tagSpan in this._aggregator.GetTags(span)) {
- switch (tagSpan.Tag.Kind) {
- case DafnyTokenKinds.Comment:
- case DafnyTokenKinds.String:
- foreach (var s in tagSpan.Span.GetSpans(pt.Snapshot)) {
- if (s.Contains(span))
- return true;
- }
- break;
- default:
- break;
- }
- }
- return false;
- }
- }
-
- internal class BraceMatchingTagger : TokenBasedTagger, ITagger<TextMarkerTag>
- {
- ITextView View { get; set; }
- ITextBuffer SourceBuffer { get; set; }
- SnapshotPoint? CurrentChar { get; set; }
- private char[] openBraces;
- private char[] closeBraces;
-
- static TextMarkerTag Blue = new TextMarkerTag("blue");
-
- internal BraceMatchingTagger(ITextView view, ITextBuffer sourceBuffer, ITagAggregator<DafnyTokenTag> tagAggregator)
- : base(tagAggregator)
- {
- //here the keys are the open braces, and the values are the close braces
- openBraces = new char[] { '(', '{', '[' };
- closeBraces = new char[] { ')', '}', ']' };
- this.View = view;
- this.SourceBuffer = sourceBuffer;
- this.CurrentChar = null;
-
- this.View.Caret.PositionChanged += CaretPositionChanged;
- this.View.LayoutChanged += ViewLayoutChanged;
- }
-
- public event EventHandler<SnapshotSpanEventArgs> TagsChanged;
-
- void ViewLayoutChanged(object sender, TextViewLayoutChangedEventArgs e) {
- if (e.NewSnapshot != e.OldSnapshot) //make sure that there has really been a change
- {
- UpdateAtCaretPosition(View.Caret.Position);
- }
- }
-
- void CaretPositionChanged(object sender, CaretPositionChangedEventArgs e) {
- UpdateAtCaretPosition(e.NewPosition);
- }
-
- void UpdateAtCaretPosition(CaretPosition caretPosition) {
- CurrentChar = caretPosition.Point.GetPoint(SourceBuffer, caretPosition.Affinity);
-
- if (!CurrentChar.HasValue)
- return;
-
- var chngd = TagsChanged;
- if (chngd != null)
- chngd(this, new SnapshotSpanEventArgs(new SnapshotSpan(SourceBuffer.CurrentSnapshot, 0, SourceBuffer.CurrentSnapshot.Length)));
- }
-
- public IEnumerable<ITagSpan<TextMarkerTag>> GetTags(NormalizedSnapshotSpanCollection spans) {
- if (spans.Count == 0) //there is no content in the buffer
- yield break;
-
- //don't do anything if the current SnapshotPoint is not initialized
- if (!CurrentChar.HasValue)
- yield break;
-
- //hold on to a snapshot of the current character
- SnapshotPoint currentChar = CurrentChar.Value;
-
- //if the requested snapshot isn't the same as the one the brace is on, translate our spans to the expected snapshot
- if (spans[0].Snapshot != currentChar.Snapshot) {
- currentChar = currentChar.TranslateTo(spans[0].Snapshot, PointTrackingMode.Positive);
- }
-
- if (currentChar.Position < spans[0].Snapshot.Length) {
- // Check if the current character is an open brace
- char ch = currentChar.GetChar();
- char closeCh;
- if (MatchBrace(currentChar, ch, true, out closeCh)) {
- SnapshotSpan pairSpan;
- if (FindMatchingCloseChar(currentChar, ch, closeCh, View.TextViewLines.Count, out pairSpan)) {
- yield return new TagSpan<TextMarkerTag>(new SnapshotSpan(currentChar, 1), Blue);
- yield return new TagSpan<TextMarkerTag>(pairSpan, Blue);
- }
- }
- }
-
- if (0 < currentChar.Position) {
- // Check if the previous character is a close brace (note, caret may be between a close brace and an open brace, in which case we'll tag two pairs)
- SnapshotPoint prevChar = currentChar - 1;
- char ch = prevChar.GetChar();
- char openCh;
- if (MatchBrace(prevChar, ch, false, out openCh)) {
- SnapshotSpan pairSpan;
- if (FindMatchingOpenChar(prevChar, openCh, ch, View.TextViewLines.Count, out pairSpan)) {
- yield return new TagSpan<TextMarkerTag>(new SnapshotSpan(prevChar, 1), Blue);
- yield return new TagSpan<TextMarkerTag>(pairSpan, Blue);
- }
- }
- }
- }
-
- private bool MatchBrace(SnapshotPoint pt, char query, bool sourceIsOpen, out char match) {
- if (!InsideComment(pt)) {
- char[] source = sourceIsOpen ? openBraces : closeBraces;
- int i = 0;
- foreach (char ch in source) {
- if (ch == query) {
- char[] dest = sourceIsOpen ? closeBraces : openBraces;
- match = dest[i];
- return true;
- }
- i++;
- }
- }
- match = query; // satisfy compiler
- return false;
- }
-
- private bool FindMatchingCloseChar(SnapshotPoint startPoint, char open, char close, int linesViewed, out SnapshotSpan pairSpan) {
- ITextSnapshotLine line = startPoint.GetContainingLine();
- int lineNumber = line.LineNumber;
- int offset = startPoint.Position - line.Start.Position + 1;
-
- int lineNumberLimit = Math.Min(startPoint.Snapshot.LineCount, lineNumber + linesViewed);
-
- int openCount = 0;
- while (true) {
- string lineText = line.GetText();
-
- //walk the entire line
- for (; offset < line.Length; offset++) {
- char currentChar = lineText[offset];
- if (currentChar == open || currentChar == close) {
- if (!InsideComment(new SnapshotPoint(line.Snapshot, line.Start.Position + offset))) {
- if (currentChar == open) {
- openCount++;
- } else if (0 < openCount) {
- openCount--;
- } else {
- //found the matching close
- pairSpan = new SnapshotSpan(startPoint.Snapshot, line.Start + offset, 1);
- return true;
- }
- }
- }
- }
-
- //move on to the next line
- lineNumber++;
- if (lineNumberLimit <= lineNumber)
- break;
-
- line = line.Snapshot.GetLineFromLineNumber(lineNumber);
- offset = 0;
- }
-
- pairSpan = new SnapshotSpan(startPoint, startPoint); // satisfy the compiler
- return false;
- }
-
- private bool FindMatchingOpenChar(SnapshotPoint startPoint, char open, char close, int linesViewed, out SnapshotSpan pairSpan) {
- ITextSnapshotLine line = startPoint.GetContainingLine();
- int lineNumber = line.LineNumber;
- int offset = startPoint.Position - line.Start.Position - 1; //move the offset to the character before this one
-
- int lineNumberLimit = Math.Max(0, lineNumber - linesViewed);
-
- int closeCount = 0;
- while (true) {
- string lineText = line.GetText();
-
- //walk the entire line
- for (; 0 <= offset; offset--) {
- char currentChar = lineText[offset];
- if (currentChar == open || currentChar == close) {
- if (!InsideComment(new SnapshotPoint(line.Snapshot, line.Start.Position + offset))) {
- if (currentChar == close) {
- closeCount++;
- } else if (0 < closeCount) {
- closeCount--;
- } else {
- // We've found the open character
- pairSpan = new SnapshotSpan(line.Start + offset, 1); //we just want the character itself
- return true;
- }
- }
- }
- }
-
- // Move to the previous line
- lineNumber--;
- if (lineNumber < lineNumberLimit)
- break;
-
- line = line.Snapshot.GetLineFromLineNumber(lineNumber);
- offset = line.Length - 1;
- }
-
- pairSpan = new SnapshotSpan(startPoint, startPoint); // satisfy the compiler
- return false;
- }
- }
-}
diff --git a/Util/VS2010/DafnyExtension/DafnyExtension/BufferIdleEventUtil.cs b/Util/VS2010/DafnyExtension/DafnyExtension/BufferIdleEventUtil.cs
deleted file mode 100644
index 1aea1385..00000000
--- a/Util/VS2010/DafnyExtension/DafnyExtension/BufferIdleEventUtil.cs
+++ /dev/null
@@ -1,155 +0,0 @@
-//***************************************************************************
-// Copyright © 2010 Microsoft Corporation. All Rights Reserved.
-// This code released under the terms of the
-// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)
-//***************************************************************************
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.VisualStudio.Text;
-using System.Windows.Threading;
-
-namespace DafnyLanguage
-{
- /// <summary>
- /// Handy reusable utility to listen for change events on the associated buffer, but
- /// only pass these along to a set of listeners when the user stops typing for a half second
- /// </summary>
- static class BufferIdleEventUtil
- {
- static object bufferListenersKey = new object();
- static object bufferTimerKey = new object();
-
- #region Public interface
-
- public static bool AddBufferIdleEventListener(ITextBuffer buffer, EventHandler handler)
- {
- HashSet<EventHandler> listenersForBuffer;
- if (!TryGetBufferListeners(buffer, out listenersForBuffer))
- listenersForBuffer = ConnectToBuffer(buffer);
-
- if (listenersForBuffer.Contains(handler))
- return false;
-
- listenersForBuffer.Add(handler);
-
- return true;
- }
-
- public static bool RemoveBufferIdleEventListener(ITextBuffer buffer, EventHandler handler)
- {
- HashSet<EventHandler> listenersForBuffer;
- if (!TryGetBufferListeners(buffer, out listenersForBuffer))
- return false;
-
- if (!listenersForBuffer.Contains(handler))
- return false;
-
- listenersForBuffer.Remove(handler);
-
- if (listenersForBuffer.Count == 0)
- DisconnectFromBuffer(buffer);
-
- return true;
- }
-
- #endregion
-
- #region Helpers
-
- static bool TryGetBufferListeners(ITextBuffer buffer, out HashSet<EventHandler> listeners)
- {
- return buffer.Properties.TryGetProperty(bufferListenersKey, out listeners);
- }
-
- static void ClearBufferListeners(ITextBuffer buffer)
- {
- buffer.Properties.RemoveProperty(bufferListenersKey);
- }
-
- static bool TryGetBufferTimer(ITextBuffer buffer, out DispatcherTimer timer)
- {
- return buffer.Properties.TryGetProperty(bufferTimerKey, out timer);
- }
-
- static void ClearBufferTimer(ITextBuffer buffer)
- {
- DispatcherTimer timer;
- if (TryGetBufferTimer(buffer, out timer))
- {
- if (timer != null)
- timer.Stop();
- buffer.Properties.RemoveProperty(bufferTimerKey);
- }
- }
-
- static void DisconnectFromBuffer(ITextBuffer buffer)
- {
- buffer.Changed -= BufferChanged;
-
- ClearBufferListeners(buffer);
- ClearBufferTimer(buffer);
-
- buffer.Properties.RemoveProperty(bufferListenersKey);
- }
-
- static HashSet<EventHandler> ConnectToBuffer(ITextBuffer buffer)
- {
- buffer.Changed += BufferChanged;
-
- RestartTimerForBuffer(buffer);
-
- HashSet<EventHandler> listenersForBuffer = new HashSet<EventHandler>();
- buffer.Properties[bufferListenersKey] = listenersForBuffer;
-
- return listenersForBuffer;
- }
-
- static void RestartTimerForBuffer(ITextBuffer buffer)
- {
- DispatcherTimer timer;
-
- if (TryGetBufferTimer(buffer, out timer))
- {
- timer.Stop();
- }
- else
- {
- timer = new DispatcherTimer(DispatcherPriority.ApplicationIdle)
- {
- Interval = TimeSpan.FromMilliseconds(500)
- };
-
- timer.Tick += (s, e) =>
- {
- ClearBufferTimer(buffer);
-
- HashSet<EventHandler> handlers;
- if (TryGetBufferListeners(buffer, out handlers))
- {
- foreach (var handler in handlers)
- {
- handler(buffer, new EventArgs());
- }
- }
- };
-
- buffer.Properties[bufferTimerKey] = timer;
- }
-
- timer.Start();
- }
-
- static void BufferChanged(object sender, TextContentChangedEventArgs e)
- {
- ITextBuffer buffer = sender as ITextBuffer;
- if (buffer == null)
- return;
-
- RestartTimerForBuffer(buffer);
- }
-
- #endregion
- }
-}
diff --git a/Util/VS2010/DafnyExtension/DafnyExtension/ClassificationTagger.cs b/Util/VS2010/DafnyExtension/DafnyExtension/ClassificationTagger.cs
deleted file mode 100644
index 09835ac9..00000000
--- a/Util/VS2010/DafnyExtension/DafnyExtension/ClassificationTagger.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.Composition;
-using System.Windows.Media;
-using Microsoft.VisualStudio.Text;
-using Microsoft.VisualStudio.Text.Classification;
-using Microsoft.VisualStudio.Text.Editor;
-using Microsoft.VisualStudio.Text.Tagging;
-using Microsoft.VisualStudio.Utilities;
-
-
-namespace DafnyLanguage
-{
- [Export(typeof(ITaggerProvider))]
- [ContentType("dafny")]
- [TagType(typeof(ClassificationTag))]
- internal sealed class DafnyClassifierProvider : ITaggerProvider
- {
- [Import]
- internal IBufferTagAggregatorFactoryService AggregatorFactory = null;
-
- [Import]
- internal IClassificationTypeRegistryService ClassificationTypeRegistry = null;
-
- [Import]
- internal Microsoft.VisualStudio.Language.StandardClassification.IStandardClassificationService Standards = null;
-
- public ITagger<T> CreateTagger<T>(ITextBuffer buffer) where T : ITag {
- ITagAggregator<DafnyTokenTag> tagAggregator = AggregatorFactory.CreateTagAggregator<DafnyTokenTag>(buffer);
- return new DafnyClassifier(buffer, tagAggregator, ClassificationTypeRegistry, Standards) as ITagger<T>;
- }
- }
-
- internal sealed class DafnyClassifier : ITagger<ClassificationTag>
- {
- ITextBuffer _buffer;
- ITagAggregator<DafnyTokenTag> _aggregator;
- IDictionary<DafnyTokenKinds, IClassificationType> _typeMap;
-
- internal DafnyClassifier(ITextBuffer buffer,
- ITagAggregator<DafnyTokenTag> tagAggregator,
- IClassificationTypeRegistryService typeService, Microsoft.VisualStudio.Language.StandardClassification.IStandardClassificationService standards) {
- _buffer = buffer;
- _aggregator = tagAggregator;
- _aggregator.TagsChanged += new EventHandler<TagsChangedEventArgs>(_aggregator_TagsChanged);
- // use built-in classification types:
- _typeMap = new Dictionary<DafnyTokenKinds, IClassificationType>();
- _typeMap[DafnyTokenKinds.Keyword] = standards.Keyword;
- _typeMap[DafnyTokenKinds.Number] = standards.NumberLiteral;
- _typeMap[DafnyTokenKinds.String] = standards.StringLiteral;
- _typeMap[DafnyTokenKinds.Comment] = standards.Comment;
- _typeMap[DafnyTokenKinds.VariableIdentifier] = standards.Identifier;
- _typeMap[DafnyTokenKinds.VariableIdentifierDefinition] = typeService.GetClassificationType("Dafny identifier");
- }
-
- public event EventHandler<SnapshotSpanEventArgs> TagsChanged;
-
- public IEnumerable<ITagSpan<ClassificationTag>> GetTags(NormalizedSnapshotSpanCollection spans) {
- if (spans.Count == 0) yield break;
- var snapshot = spans[0].Snapshot;
- foreach (var tagSpan in this._aggregator.GetTags(spans)) {
- IClassificationType t = _typeMap[tagSpan.Tag.Kind];
- foreach (SnapshotSpan s in tagSpan.Span.GetSpans(snapshot)) {
- yield return new TagSpan<ClassificationTag>(s, new ClassificationTag(t));
- }
- }
- }
-
- void _aggregator_TagsChanged(object sender, TagsChangedEventArgs e) {
- var chng = TagsChanged;
- if (chng != null) {
- NormalizedSnapshotSpanCollection spans = e.Span.GetSpans(_buffer.CurrentSnapshot);
- if (spans.Count > 0) {
- SnapshotSpan span = new SnapshotSpan(spans[0].Start, spans[spans.Count - 1].End);
- chng(this, new SnapshotSpanEventArgs(span));
- }
- }
- }
- }
-
- /// <summary>
- /// Defines an editor format for user-defined type.
- /// </summary>
- [Export(typeof(EditorFormatDefinition))]
- [ClassificationType(ClassificationTypeNames = "Dafny identifier")]
- [Name("Dafny identifier")]
- [UserVisible(true)]
- //set the priority to be after the default classifiers
- [Order(Before = Priority.Default)]
- internal sealed class DafnyTypeFormat : ClassificationFormatDefinition
- {
- public DafnyTypeFormat() {
- this.DisplayName = "Dafny identifier"; //human readable version of the name
- this.ForegroundColor = Colors.CornflowerBlue;
- }
- }
-
- internal static class ClassificationDefinition
- {
- /// <summary>
- /// Defines the "ordinary" classification type.
- /// </summary>
- [Export(typeof(ClassificationTypeDefinition))]
- [Name("Dafny identifier")]
- internal static ClassificationTypeDefinition UserType = null;
- }
-}
diff --git a/Util/VS2010/DafnyExtension/DafnyExtension/ContentType.cs b/Util/VS2010/DafnyExtension/DafnyExtension/ContentType.cs
deleted file mode 100644
index d8487f74..00000000
--- a/Util/VS2010/DafnyExtension/DafnyExtension/ContentType.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System.ComponentModel.Composition;
-using Microsoft.VisualStudio.Utilities;
-
-namespace DafnyLanguage
-{
- class DafnyContentType
- {
- [Export]
- [Name("dafny")]
- [BaseDefinition("code")]
- internal static ContentTypeDefinition ContentType = null;
-
- [Export]
- [FileExtension(".dfy")]
- [ContentType("dafny")]
- internal static FileExtensionToContentTypeDefinition FileType = null;
- }
-}
diff --git a/Util/VS2010/DafnyExtension/DafnyExtension/DafnyDriver.cs b/Util/VS2010/DafnyExtension/DafnyExtension/DafnyDriver.cs
deleted file mode 100644
index 39829bb0..00000000
--- a/Util/VS2010/DafnyExtension/DafnyExtension/DafnyDriver.cs
+++ /dev/null
@@ -1,419 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.IO;
-using System.Diagnostics;
-using System.Diagnostics.Contracts;
-// Here come the Dafny/Boogie specific imports
-//using PureCollections;
-using Bpl = Microsoft.Boogie;
-using Dafny = Microsoft.Dafny;
-using Microsoft.Boogie.AbstractInterpretation;
-using VC;
-// using AI = Microsoft.AbstractInterpretationFramework;
-
-
-namespace DafnyLanguage
-{
- class DafnyDriver
- {
- readonly string _programText;
- readonly string _filename;
- Dafny.Program _program;
- List<DafnyError> _errors = new List<DafnyError>();
- public List<DafnyError> Errors { get { return _errors; } }
-
- public DafnyDriver(string programText, string filename) {
- _programText = programText;
- _filename = filename;
- }
-
- void RecordError(int line, int col, ErrorCategory cat, string msg) {
- _errors.Add(new DafnyError(line, col, cat, msg));
- }
-
- static DafnyDriver() {
- Initialize();
- }
-
- static void Initialize() {
- if (Dafny.DafnyOptions.O == null) {
- var options = new Dafny.DafnyOptions();
- options.ProverKillTime = 10;
- options.ErrorTrace = 0;
- Dafny.DafnyOptions.Install(options);
- options.ApplyDefaultOptions();
- }
- }
-
- public Dafny.Program ProcessResolution() {
- if (!ParseAndTypeCheck()) {
- return null;
- }
- return _program;
- }
-
- bool ParseAndTypeCheck() {
- Dafny.ModuleDecl module = new Dafny.LiteralModuleDecl(new Dafny.DefaultModuleDecl(), null);
- Dafny.BuiltIns builtIns = new Dafny.BuiltIns();
- int errorCount = Dafny.Parser.Parse(_programText, _filename, module, builtIns, new VSErrors(this));
- if (errorCount != 0)
- return false;
- Dafny.Program program = new Dafny.Program(_filename, module, builtIns);
-
- Dafny.Resolver r = new VSResolver(program, this);
- r.ResolveProgram(program);
- if (r.ErrorCount != 0)
- return false;
-
- _program = program;
- return true; // success
- }
-
- class VSErrors : Dafny.Errors
- {
- DafnyDriver dd;
- public VSErrors(DafnyDriver dd) {
- this.dd = dd;
- }
- public override void SynErr(string filename, int line, int col, string msg) {
- dd.RecordError(line - 1, col - 1, ErrorCategory.ParseError, msg);
- count++;
- }
- public override void SemErr(string filename, int line, int col, string msg) {
- dd.RecordError(line - 1, col - 1, ErrorCategory.ResolveError, msg);
- count++;
- }
- public override void Warning(string filename, int line, int col, string msg) {
- dd.RecordError(line - 1, col - 1, ErrorCategory.ParseWarning, msg);
- }
- }
-
- class VSResolver : Dafny.Resolver
- {
- DafnyDriver dd;
- public VSResolver(Dafny.Program program, DafnyDriver dd)
- : base(program) {
- this.dd = dd;
- }
- public override void Error(Bpl.IToken tok, string msg, params object[] args) {
- string s = string.Format(msg, args);
- dd.RecordError(tok.line - 1, tok.col - 1, ErrorCategory.ResolveError, s);
- ErrorCount++;
- }
- }
-
- public static bool Verify(Dafny.Program dafnyProgram, ErrorReporterDelegate er) {
- Dafny.Translator translator = new Dafny.Translator();
- Bpl.Program boogieProgram = translator.Translate(dafnyProgram);
-
- PipelineOutcome oc = BoogiePipeline(boogieProgram, er);
- switch (oc) {
- case PipelineOutcome.Done:
- case PipelineOutcome.VerificationCompleted:
- // TODO: This would be the place to proceed to compile the program, if desired
- return true;
- case PipelineOutcome.FatalError:
- default:
- return false;
- }
- }
-
- enum PipelineOutcome { Done, ResolutionError, TypeCheckingError, ResolvedAndTypeChecked, FatalError, VerificationCompleted }
-
- /// <summary>
- /// Resolve, type check, infer invariants for, and verify the given Boogie program.
- /// The intention is that this Boogie program has been produced by translation from something
- /// else. Hence, any resolution errors and type checking errors are due to errors in
- /// the translation.
- /// </summary>
- static PipelineOutcome BoogiePipeline(Bpl.Program/*!*/ program, ErrorReporterDelegate er) {
- Contract.Requires(program != null);
-
- PipelineOutcome oc = BoogieResolveAndTypecheck(program);
- if (oc == PipelineOutcome.ResolvedAndTypeChecked) {
- EliminateDeadVariablesAndInline(program);
- return BoogieInferAndVerify(program, er);
- }
- return oc;
- }
-
- static void EliminateDeadVariablesAndInline(Bpl.Program program) {
- Contract.Requires(program != null);
- // Eliminate dead variables
- Microsoft.Boogie.UnusedVarEliminator.Eliminate(program);
-
- // Collect mod sets
- if (Bpl.CommandLineOptions.Clo.DoModSetAnalysis) {
- Microsoft.Boogie.ModSetCollector.DoModSetAnalysis(program);
- }
-
- // Coalesce blocks
- if (Bpl.CommandLineOptions.Clo.CoalesceBlocks) {
- Microsoft.Boogie.BlockCoalescer.CoalesceBlocks(program);
- }
-
- // Inline
- var TopLevelDeclarations = program.TopLevelDeclarations;
-
- if (Bpl.CommandLineOptions.Clo.ProcedureInlining != Bpl.CommandLineOptions.Inlining.None) {
- bool inline = false;
- foreach (var d in TopLevelDeclarations) {
- if (d.FindExprAttribute("inline") != null) {
- inline = true;
- }
- }
- if (inline && Bpl.CommandLineOptions.Clo.StratifiedInlining == 0) {
- foreach (var d in TopLevelDeclarations) {
- var impl = d as Bpl.Implementation;
- if (impl != null) {
- impl.OriginalBlocks = impl.Blocks;
- impl.OriginalLocVars = impl.LocVars;
- }
- }
- foreach (var d in TopLevelDeclarations) {
- var impl = d as Bpl.Implementation;
- if (impl != null && !impl.SkipVerification) {
- Bpl.Inliner.ProcessImplementation(program, impl);
- }
- }
- foreach (var d in TopLevelDeclarations) {
- var impl = d as Bpl.Implementation;
- if (impl != null) {
- impl.OriginalBlocks = null;
- impl.OriginalLocVars = null;
- }
- }
- }
- }
- }
-
- /// <summary>
- /// Resolves and type checks the given Boogie program.
- /// Returns:
- /// - Done if no errors occurred, and command line specified no resolution or no type checking.
- /// - ResolutionError if a resolution error occurred
- /// - TypeCheckingError if a type checking error occurred
- /// - ResolvedAndTypeChecked if both resolution and type checking succeeded
- /// </summary>
- static PipelineOutcome BoogieResolveAndTypecheck(Bpl.Program program) {
- Contract.Requires(program != null);
- // ---------- Resolve ------------------------------------------------------------
- int errorCount = program.Resolve();
- if (errorCount != 0) {
- return PipelineOutcome.ResolutionError;
- }
-
- // ---------- Type check ------------------------------------------------------------
- errorCount = program.Typecheck();
- if (errorCount != 0) {
- return PipelineOutcome.TypeCheckingError;
- }
-
- return PipelineOutcome.ResolvedAndTypeChecked;
- }
-
- /// <summary>
- /// Given a resolved and type checked Boogie program, infers invariants for the program
- /// and then attempts to verify it. Returns:
- /// - Done if command line specified no verification
- /// - FatalError if a fatal error occurred
- /// - VerificationCompleted if inference and verification completed, in which the out
- /// parameters contain meaningful values
- /// </summary>
- static PipelineOutcome BoogieInferAndVerify(Bpl.Program program, ErrorReporterDelegate er) {
- Contract.Requires(program != null);
-
- // ---------- Infer invariants --------------------------------------------------------
-
- // Abstract interpretation -> Always use (at least) intervals, if not specified otherwise (e.g. with the "/noinfer" switch)
- if (Bpl.CommandLineOptions.Clo.UseAbstractInterpretation) {
- if (Bpl.CommandLineOptions.Clo.Ai.J_Intervals || Bpl.CommandLineOptions.Clo.Ai.J_Trivial) {
- Microsoft.Boogie.AbstractInterpretation.NativeAbstractInterpretation.RunAbstractInterpretation(program);
- } else {
- // use /infer:j as the default
- Bpl.CommandLineOptions.Clo.Ai.J_Intervals = true;
- Microsoft.Boogie.AbstractInterpretation.NativeAbstractInterpretation.RunAbstractInterpretation(program);
- }
- }
-
- if (Bpl.CommandLineOptions.Clo.LoopUnrollCount != -1) {
- program.UnrollLoops(Bpl.CommandLineOptions.Clo.LoopUnrollCount);
- }
-
- if (Bpl.CommandLineOptions.Clo.ExpandLambdas) {
- Bpl.LambdaHelper.ExpandLambdas(program);
- //PrintBplFile ("-", program, true);
- }
-
- // ---------- Verify ------------------------------------------------------------
-
- if (!Bpl.CommandLineOptions.Clo.Verify) { return PipelineOutcome.Done; }
-
- #region Verify each implementation
-
- ConditionGeneration vcgen = null;
- try {
- vcgen = new VCGen(program, Bpl.CommandLineOptions.Clo.SimplifyLogFilePath, Bpl.CommandLineOptions.Clo.SimplifyLogFileAppend);
- } catch (Bpl.ProverException) {
- return PipelineOutcome.FatalError;
- }
-
- var decls = program.TopLevelDeclarations.ToArray();
- foreach (var decl in decls) {
- Contract.Assert(decl != null);
- Bpl.Implementation impl = decl as Bpl.Implementation;
- if (impl != null && Bpl.CommandLineOptions.Clo.UserWantsToCheckRoutine(impl.Name) && !impl.SkipVerification) {
- List<Bpl.Counterexample>/*?*/ errors;
-
- ConditionGeneration.Outcome outcome;
- int prevAssertionCount = vcgen.CumulativeAssertionCount;
- try {
- outcome = vcgen.VerifyImplementation(impl, out errors);
- } catch (VCGenException) {
- errors = null;
- outcome = VCGen.Outcome.Inconclusive;
- } catch (Bpl.UnexpectedProverOutputException) {
- errors = null;
- outcome = VCGen.Outcome.Inconclusive;
- }
-
- switch (outcome) {
- default:
- Contract.Assert(false); throw new Exception(); // unexpected outcome
- case VCGen.Outcome.Correct:
- break;
- case VCGen.Outcome.TimedOut:
- er(new DafnyErrorInformation(impl.tok, "Verification timed out (" + impl.Name + ")"));
- break;
- case VCGen.Outcome.OutOfMemory:
- er(new DafnyErrorInformation(impl.tok, "Verification out of memory (" + impl.Name + ")"));
- break;
- case VCGen.Outcome.Inconclusive:
- er(new DafnyErrorInformation(impl.tok, "Verification inconclusive (" + impl.Name + ")"));
- break;
- case VCGen.Outcome.Errors:
- Contract.Assert(errors != null); // guaranteed by postcondition of VerifyImplementation
-
- errors.Sort(new Bpl.CounterexampleComparer());
- foreach (var error in errors) {
- DafnyErrorInformation errorInfo;
-
- if (error is Bpl.CallCounterexample) {
- var err = (Bpl.CallCounterexample)error;
- errorInfo = new DafnyErrorInformation(err.FailingCall.tok, err.FailingCall.ErrorData as string ?? "A precondition for this call might not hold.");
- errorInfo.AddAuxInfo(err.FailingRequires.tok, err.FailingRequires.ErrorData as string ?? "Related location: This is the precondition that might not hold.");
-
- } else if (error is Bpl.ReturnCounterexample) {
- var err = (Bpl.ReturnCounterexample)error;
- errorInfo = new DafnyErrorInformation(err.FailingReturn.tok, "A postcondition might not hold on this return path.");
- errorInfo.AddAuxInfo(err.FailingEnsures.tok, err.FailingEnsures.ErrorData as string ?? "Related location: This is the postcondition that might not hold.");
- errorInfo.AddAuxInfo(err.FailingEnsures.Attributes);
-
- } else { // error is AssertCounterexample
- var err = (Bpl.AssertCounterexample)error;
- if (err.FailingAssert is Bpl.LoopInitAssertCmd) {
- errorInfo = new DafnyErrorInformation(err.FailingAssert.tok, "This loop invariant might not hold on entry.");
- } else if (err.FailingAssert is Bpl.LoopInvMaintainedAssertCmd) {
- // this assertion is a loop invariant which is not maintained
- errorInfo = new DafnyErrorInformation(err.FailingAssert.tok, "This loop invariant might not be maintained by the loop.");
- } else {
- string msg = err.FailingAssert.ErrorData as string;
- if (msg == null) {
- msg = "This assertion might not hold.";
- }
- errorInfo = new DafnyErrorInformation(err.FailingAssert.tok, msg);
- errorInfo.AddAuxInfo(err.FailingAssert.Attributes);
- }
- }
- if (Bpl.CommandLineOptions.Clo.ErrorTrace > 0) {
- foreach (Bpl.Block b in error.Trace) {
- // for ErrorTrace == 1 restrict the output;
- // do not print tokens with -17:-4 as their location because they have been
- // introduced in the translation and do not give any useful feedback to the user
- if (!(Bpl.CommandLineOptions.Clo.ErrorTrace == 1 && b.tok.line == -17 && b.tok.col == -4) &&
- b.tok.line != 0 && b.tok.col != 0) {
- errorInfo.AddAuxInfo(b.tok, "Execution trace: " + b.Label);
- }
- }
- }
- // if (Bpl.CommandLineOptions.Clo.ModelViewFile != null) {
- // error.PrintModel();
- // }
- er(errorInfo);
- }
- break;
- }
- }
- }
- vcgen.Close();
- Bpl.CommandLineOptions.Clo.TheProverFactory.Close();
-
- #endregion
-
- return PipelineOutcome.VerificationCompleted;
- }
-
- public delegate void ErrorReporterDelegate(DafnyErrorInformation errInfo);
-
- public class DafnyErrorInformation
- {
- public readonly Bpl.IToken Tok;
- public readonly string Msg;
- public readonly List<DafnyErrorAuxInfo> Aux = new List<DafnyErrorAuxInfo>();
-
- public class DafnyErrorAuxInfo
- {
- public readonly Bpl.IToken Tok;
- public readonly string Msg;
- public DafnyErrorAuxInfo(Bpl.IToken tok, string msg) {
- Tok = tok;
- Msg = CleanUp(msg);
- }
- }
-
- public DafnyErrorInformation(Bpl.IToken tok, string msg) {
- Contract.Requires(tok != null);
- Contract.Requires(1 <= tok.line && 1 <= tok.col);
- Contract.Requires(msg != null);
- Tok = tok;
- Msg = CleanUp(msg);
- AddNestingsAsAux(tok);
- }
- public void AddAuxInfo(Bpl.IToken tok, string msg) {
- Contract.Requires(tok != null);
- Contract.Requires(1 <= tok.line && 1 <= tok.col);
- Contract.Requires(msg != null);
- Aux.Add(new DafnyErrorAuxInfo(tok, msg));
- AddNestingsAsAux(tok);
- }
- void AddNestingsAsAux(Bpl.IToken tok) {
- while (tok is Dafny.NestedToken) {
- var nt = (Dafny.NestedToken)tok;
- tok = nt.Inner;
- Aux.Add(new DafnyErrorAuxInfo(tok, "Related location"));
- }
- }
- public void AddAuxInfo(Bpl.QKeyValue attr) {
- while (attr != null) {
- if (attr.Key == "msg" && attr.Params.Count == 1 && attr.tok.line != 0 && attr.tok.col != 0) {
- var str = attr.Params[0] as string;
- if (str != null) {
- AddAuxInfo(attr.tok, str);
- }
- }
- attr = attr.Next;
- }
- }
-
- public static string CleanUp(string msg) {
- if (msg.ToLower().StartsWith("error: ")) {
- return msg.Substring(7);
- } else {
- return msg;
- }
- }
- }
- }
-}
diff --git a/Util/VS2010/DafnyExtension/DafnyExtension/DafnyExtension.csproj b/Util/VS2010/DafnyExtension/DafnyExtension/DafnyExtension.csproj
deleted file mode 100644
index 2580c396..00000000
--- a/Util/VS2010/DafnyExtension/DafnyExtension/DafnyExtension.csproj
+++ /dev/null
@@ -1,191 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>10.0.20305</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <ProjectGuid>{6E9A5E14-0763-471C-A129-80A879D9E7BA}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>DafnyLanguage</RootNamespace>
- <AssemblyName>DafnyLanguageService</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <GeneratePkgDefFile>false</GeneratePkgDefFile>
- <MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- <OldToolsVersion>4.0</OldToolsVersion>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="AbsInt, Version=2.0.0.0, Culture=neutral, PublicKeyToken=736440c9b414ea16, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\..\Binaries\AbsInt.dll</HintPath>
- </Reference>
- <Reference Include="AIFramework, Version=2.0.0.0, Culture=neutral, PublicKeyToken=736440c9b414ea16, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\..\Binaries\AIFramework.dll</HintPath>
- </Reference>
- <Reference Include="Basetypes, Version=2.0.0.0, Culture=neutral, PublicKeyToken=736440c9b414ea16, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\..\Binaries\Basetypes.dll</HintPath>
- </Reference>
- <Reference Include="CodeContractsExtender, Version=2.0.0.0, Culture=neutral, PublicKeyToken=736440c9b414ea16, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\..\Binaries\CodeContractsExtender.dll</HintPath>
- </Reference>
- <Reference Include="Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=736440c9b414ea16, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\..\Binaries\Core.dll</HintPath>
- </Reference>
- <Reference Include="DafnyPipeline, Version=2.0.0.0, Culture=neutral, PublicKeyToken=736440c9b414ea16, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\..\Binaries\DafnyPipeline.dll</HintPath>
- </Reference>
- <Reference Include="Graph">
- <HintPath>..\..\..\..\Binaries\Graph.dll</HintPath>
- </Reference>
- <Reference Include="Houdini">
- <HintPath>..\..\..\..\Binaries\Houdini.dll</HintPath>
- </Reference>
- <Reference Include="Model">
- <HintPath>..\..\..\..\Binaries\Model.dll</HintPath>
- </Reference>
- <Reference Include="ParserHelper">
- <HintPath>..\..\..\..\Binaries\ParserHelper.dll</HintPath>
- </Reference>
- <Reference Include="Provers.Z3">
- <HintPath>..\..\..\..\Binaries\Provers.Z3.dll</HintPath>
- </Reference>
- <Reference Include="Provers.SMTLib">
- <HintPath>..\..\..\..\Binaries\Provers.SMTLib.dll</HintPath>
- </Reference>
- <Reference Include="VCExpr">
- <HintPath>..\..\..\..\Binaries\VCExpr.dll</HintPath>
- </Reference>
- <Reference Include="VCGeneration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=736440c9b414ea16, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\..\Binaries\VCGeneration.dll</HintPath>
- </Reference>
- <Reference Include="EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <EmbedInteropTypes>False</EmbedInteropTypes>
- </Reference>
- <Reference Include="Microsoft.VisualStudio.CoreUtility">
- <Private>False</Private>
- </Reference>
- <Reference Include="Microsoft.VisualStudio.Editor, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
- <Reference Include="Microsoft.VisualStudio.Language.Intellisense, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
- <Reference Include="Microsoft.VisualStudio.Language.StandardClassification, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
- <Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- <Reference Include="Microsoft.VisualStudio.Shell, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
- <Private>False</Private>
- </Reference>
- <Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
- <Reference Include="Microsoft.VisualStudio.Shell.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- <Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
- <EmbedInteropTypes>True</EmbedInteropTypes>
- </Reference>
- <Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- <Reference Include="Microsoft.VisualStudio.Text.Data">
- <Private>False</Private>
- </Reference>
- <Reference Include="Microsoft.VisualStudio.Text.Logic">
- <Private>False</Private>
- </Reference>
- <Reference Include="Microsoft.VisualStudio.Text.UI">
- <Private>False</Private>
- </Reference>
- <Reference Include="Microsoft.VisualStudio.Text.UI.Wpf">
- <Private>False</Private>
- </Reference>
- <Reference Include="Microsoft.VisualStudio.TextManager.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- <Reference Include="PresentationCore" />
- <Reference Include="PresentationFramework" />
- <Reference Include="System" />
- <Reference Include="Microsoft.CSharp" />
- <Reference Include="System.ComponentModel.Composition" />
- <Reference Include="System.Core" />
- <Reference Include="System.Data.DataSetExtensions" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- <Reference Include="System.Xaml" />
- <Reference Include="WindowsBase" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="BufferIdleEventUtil.cs" />
- <Compile Include="HoverText.cs" />
- <Compile Include="IdentifierTagger.cs" />
- <Compile Include="ProgressMargin.cs" />
- <Compile Include="OutliningTagger.cs" />
- <Compile Include="ResolverTagger.cs" />
- <Compile Include="DafnyDriver.cs" />
- <Compile Include="ContentType.cs" />
- <Compile Include="BraceMatching.cs" />
- <Compile Include="WordHighlighter.cs" />
- <Compile Include="ErrorTagger.cs" />
- <Compile Include="TokenTagger.cs" />
- <Compile Include="ClassificationTagger.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="DafnyPrelude.bpl">
- <IncludeInVSIX>true</IncludeInVSIX>
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
- <None Include="source.extension.vsixmanifest">
- <SubType>Designer</SubType>
- </None>
- <Content Include="UnivBackPred2.smt2">
- <IncludeInVSIX>true</IncludeInVSIX>
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
- </ItemGroup>
- <ItemGroup>
- <WCFMetadata Include="Service References\" />
- </ItemGroup>
- <PropertyGroup>
- <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
- <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
- </PropertyGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
- <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\VSSDK\Microsoft.VsSDK.targets" Condition="false" />
- <PropertyGroup>
- <PostBuildEvent>cd</PostBuildEvent>
- <PostBuildEvent>
- </PostBuildEvent>
- </PropertyGroup>
- <PropertyGroup>
- <PreBuildEvent>copy ..\..\..\..\..\..\Binaries\DafnyPrelude.bpl $(ProjectDir)
-copy ..\..\..\..\..\..\Binaries\UnivBackPred2.smt2 $(ProjectDir)</PreBuildEvent>
- </PropertyGroup>
- <!-- 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> \ No newline at end of file
diff --git a/Util/VS2010/DafnyExtension/DafnyExtension/ErrorTagger.cs b/Util/VS2010/DafnyExtension/DafnyExtension/ErrorTagger.cs
deleted file mode 100644
index efd755d8..00000000
--- a/Util/VS2010/DafnyExtension/DafnyExtension/ErrorTagger.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-//***************************************************************************
-// Copyright © 2010 Microsoft Corporation. All Rights Reserved.
-// This code released under the terms of the
-// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)
-//***************************************************************************
-using EnvDTE;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.ComponentModel.Composition;
-using System.Windows.Threading;
-using Microsoft.VisualStudio.Shell;
-using Microsoft.VisualStudio.Shell.Interop;
-using Microsoft.VisualStudio.Text;
-using Microsoft.VisualStudio.Text.Classification;
-using Microsoft.VisualStudio.Text.Editor;
-using Microsoft.VisualStudio.Text.Tagging;
-using Microsoft.VisualStudio.Text.Projection;
-using Microsoft.VisualStudio.Utilities;
-
-namespace DafnyLanguage
-{
- [Export(typeof(ITaggerProvider))]
- [ContentType("dafny")]
- [TagType(typeof(ErrorTag))]
- internal sealed class ErrorTaggerProvider : ITaggerProvider
- {
- [Import]
- internal IBufferTagAggregatorFactoryService AggregatorFactory = null;
-
- public ITagger<T> CreateTagger<T>(ITextBuffer buffer) where T : ITag {
- ITagAggregator<DafnyResolverTag> tagAggregator = AggregatorFactory.CreateTagAggregator<DafnyResolverTag>(buffer);
- // create a single tagger for each buffer.
- Func<ITagger<T>> sc = delegate() { return new ErrorTagger(buffer, tagAggregator) as ITagger<T>; };
- return buffer.Properties.GetOrCreateSingletonProperty<ITagger<T>>(sc);
- }
- }
-
- /// <summary>
- /// Translate PkgDefTokenTags into ErrorTags and Error List items
- /// </summary>
- internal sealed class ErrorTagger : ITagger<ErrorTag>
- {
- ITextBuffer _buffer;
- ITagAggregator<DafnyResolverTag> _aggregator;
-
- internal ErrorTagger(ITextBuffer buffer, ITagAggregator<DafnyResolverTag> tagAggregator) {
- _buffer = buffer;
- _aggregator = tagAggregator;
- _aggregator.TagsChanged += new EventHandler<TagsChangedEventArgs>(_aggregator_TagsChanged);
- }
-
- /// <summary>
- /// Find the Error tokens in the set of all tokens and create an ErrorTag for each
- /// </summary>
- public IEnumerable<ITagSpan<ErrorTag>> GetTags(NormalizedSnapshotSpanCollection spans) {
- if (spans.Count == 0) yield break;
- var snapshot = spans[0].Snapshot;
- foreach (var tagSpan in this._aggregator.GetTags(spans)) {
- DafnyResolverTag t = tagSpan.Tag;
- DafnyErrorResolverTag et = t as DafnyErrorResolverTag;
- if (et != null) {
- foreach (SnapshotSpan s in tagSpan.Span.GetSpans(snapshot)) {
- yield return new TagSpan<ErrorTag>(s, new ErrorTag(et.Typ, et.Msg));
- }
- }
- }
- }
-
- // the Classifier tagger is translating buffer change events into TagsChanged events, so we don't have to
- public event EventHandler<SnapshotSpanEventArgs> TagsChanged;
-
- void _aggregator_TagsChanged(object sender, TagsChangedEventArgs e) {
- var chng = TagsChanged;
- if (chng != null) {
- NormalizedSnapshotSpanCollection spans = e.Span.GetSpans(_buffer.CurrentSnapshot);
- if (spans.Count > 0) {
- SnapshotSpan span = new SnapshotSpan(spans[0].Start, spans[spans.Count - 1].End);
- chng(this, new SnapshotSpanEventArgs(span));
- }
- }
- }
- }
-}
diff --git a/Util/VS2010/DafnyExtension/DafnyExtension/HoverText.cs b/Util/VS2010/DafnyExtension/DafnyExtension/HoverText.cs
deleted file mode 100644
index be806f5b..00000000
--- a/Util/VS2010/DafnyExtension/DafnyExtension/HoverText.cs
+++ /dev/null
@@ -1,126 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows.Input;
-using Microsoft.VisualStudio.Language.Intellisense;
-using System.Collections.ObjectModel;
-using Microsoft.VisualStudio.Text;
-using Microsoft.VisualStudio.Text.Editor;
-using Microsoft.VisualStudio.Text.Tagging;
-using System.ComponentModel.Composition;
-using Microsoft.VisualStudio.Utilities;
-using System.Diagnostics.Contracts;
-
-
-namespace DafnyLanguage
-{
- [Export(typeof(IQuickInfoSourceProvider))]
- [ContentType("dafny")]
- [Name("Dafny QuickInfo")]
- class OokQuickInfoSourceProvider : IQuickInfoSourceProvider
- {
- [Import]
- IBufferTagAggregatorFactoryService aggService = null;
-
- public IQuickInfoSource TryCreateQuickInfoSource(ITextBuffer textBuffer) {
- return new DafnyQuickInfoSource(textBuffer, aggService.CreateTagAggregator<DafnyTokenTag>(textBuffer));
- }
- }
-
- class DafnyQuickInfoSource : IQuickInfoSource
- {
- private ITagAggregator<DafnyTokenTag> _aggregator;
- private ITextBuffer _buffer;
-
- public DafnyQuickInfoSource(ITextBuffer buffer, ITagAggregator<DafnyTokenTag> aggregator) {
- _aggregator = aggregator;
- _buffer = buffer;
- }
-
- public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> quickInfoContent, out ITrackingSpan applicableToSpan) {
- applicableToSpan = null;
-
- var triggerPoint = (SnapshotPoint)session.GetTriggerPoint(_buffer.CurrentSnapshot);
- if (triggerPoint == null)
- return;
-
- foreach (IMappingTagSpan<DafnyTokenTag> curTag in _aggregator.GetTags(new SnapshotSpan(triggerPoint, triggerPoint))) {
- var s = curTag.Tag.HoverText;
- if (s != null) {
- var tagSpan = curTag.Span.GetSpans(_buffer).First();
- applicableToSpan = _buffer.CurrentSnapshot.CreateTrackingSpan(tagSpan, SpanTrackingMode.EdgeExclusive);
- quickInfoContent.Add(s);
- }
- }
- }
- public void Dispose() {
- }
- }
- // --------------------------------- QuickInfo controller ------------------------------------------
-
- [Export(typeof(IIntellisenseControllerProvider))]
- [Name("Dafny QuickInfo controller")]
- [ContentType("dafny")]
- class DafnyQuickInfoControllerProvider : IIntellisenseControllerProvider
- {
- [Import]
- internal IQuickInfoBroker QuickInfoBroker { get; set; }
-
- public IIntellisenseController TryCreateIntellisenseController(ITextView textView, IList<ITextBuffer> subjectBuffers) {
- return new DafnyQuickInfoController(textView, subjectBuffers, this);
- }
- }
-
- class DafnyQuickInfoController : IIntellisenseController
- {
- private ITextView _textView;
- private IList<ITextBuffer> _subjectBuffers;
- private DafnyQuickInfoControllerProvider _componentContext;
-
- private IQuickInfoSession _session;
-
- internal DafnyQuickInfoController(ITextView textView, IList<ITextBuffer> subjectBuffers, DafnyQuickInfoControllerProvider componentContext) {
- _textView = textView;
- _subjectBuffers = subjectBuffers;
- _componentContext = componentContext;
-
- _textView.MouseHover += this.OnTextViewMouseHover;
- }
-
- public void ConnectSubjectBuffer(ITextBuffer subjectBuffer) {
- }
-
- public void DisconnectSubjectBuffer(ITextBuffer subjectBuffer) {
- }
-
- public void Detach(ITextView textView) {
- if (_textView == textView) {
- _textView.MouseHover -= OnTextViewMouseHover;
- _textView = null;
- }
- }
-
- void OnTextViewMouseHover(object sender, MouseHoverEventArgs e) {
- SnapshotPoint? point = GetMousePosition(new SnapshotPoint(_textView.TextSnapshot, e.Position));
-
- if (point != null) {
- ITrackingPoint triggerPoint = point.Value.Snapshot.CreateTrackingPoint(point.Value.Position, PointTrackingMode.Positive);
-
- // Find the broker for this buffer
- if (!_componentContext.QuickInfoBroker.IsQuickInfoActive(_textView)) {
- _session = _componentContext.QuickInfoBroker.CreateQuickInfoSession(_textView, triggerPoint, true);
- _session.Start();
- }
- }
- }
-
- SnapshotPoint? GetMousePosition(SnapshotPoint topPosition) {
- return _textView.BufferGraph.MapDownToFirstMatch(
- topPosition,
- PointTrackingMode.Positive,
- snapshot => _subjectBuffers.Contains(snapshot.TextBuffer),
- PositionAffinity.Predecessor);
- }
- }
-}
diff --git a/Util/VS2010/DafnyExtension/DafnyExtension/IdentifierTagger.cs b/Util/VS2010/DafnyExtension/DafnyExtension/IdentifierTagger.cs
deleted file mode 100644
index 5ecc8dc2..00000000
--- a/Util/VS2010/DafnyExtension/DafnyExtension/IdentifierTagger.cs
+++ /dev/null
@@ -1,344 +0,0 @@
-//***************************************************************************
-// Copyright © 2010 Microsoft Corporation. All Rights Reserved.
-// This code released under the terms of the
-// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)
-//***************************************************************************
-using EnvDTE;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.ComponentModel.Composition;
-using System.Windows.Threading;
-using Microsoft.VisualStudio.Shell;
-using Microsoft.VisualStudio.Shell.Interop;
-using Microsoft.VisualStudio.Text;
-using Microsoft.VisualStudio.Text.Classification;
-using Microsoft.VisualStudio.Text.Editor;
-using Microsoft.VisualStudio.Text.Tagging;
-using Microsoft.VisualStudio.Text.Projection;
-using Microsoft.VisualStudio.Utilities;
-using System.Diagnostics.Contracts;
-using Bpl = Microsoft.Boogie;
-using Microsoft.Dafny;
-
-namespace DafnyLanguage
-{
- [Export(typeof(ITaggerProvider))]
- [ContentType("dafny")]
- [TagType(typeof(DafnyTokenTag))]
- internal sealed class IdentifierTaggerProvider : ITaggerProvider
- {
- [Import]
- internal IBufferTagAggregatorFactoryService AggregatorFactory = null;
-
- public ITagger<T> CreateTagger<T>(ITextBuffer buffer) where T : ITag {
- ITagAggregator<DafnyResolverTag> tagAggregator = AggregatorFactory.CreateTagAggregator<DafnyResolverTag>(buffer);
- // create a single tagger for each buffer.
- Func<ITagger<T>> sc = delegate() { return new IdentifierTagger(buffer, tagAggregator) as ITagger<T>; };
- return buffer.Properties.GetOrCreateSingletonProperty<ITagger<T>>(sc);
- }
- }
-
- /// <summary>
- /// Translate DafnyResolverTag's into IOutliningRegionTag's
- /// </summary>
- internal sealed class IdentifierTagger : ITagger<DafnyTokenTag>
- {
- ITextBuffer _buffer;
- ITextSnapshot _snapshot; // the most recent snapshot of _buffer that we have been informed about
- Microsoft.Dafny.Program _program; // the program parsed from _snapshot
- List<IdRegion> _regions = new List<IdRegion>(); // the regions generated from _program
- ITagAggregator<DafnyResolverTag> _aggregator;
-
- internal IdentifierTagger(ITextBuffer buffer, ITagAggregator<DafnyResolverTag> tagAggregator) {
- _buffer = buffer;
- _snapshot = _buffer.CurrentSnapshot;
- _aggregator = tagAggregator;
- _aggregator.TagsChanged += new EventHandler<TagsChangedEventArgs>(_aggregator_TagsChanged);
- }
-
- /// <summary>
- /// Find the Error tokens in the set of all tokens and create an ErrorTag for each
- /// </summary>
- public IEnumerable<ITagSpan<DafnyTokenTag>> GetTags(NormalizedSnapshotSpanCollection spans) {
- if (spans.Count == 0) yield break;
- // (A NormalizedSnapshotSpanCollection contains spans that all come from the same snapshot.)
- // The spans are ordered by the .Start component, and the collection contains no adjacent or abutting spans.
- // Hence, to find a span that includes all the ones in "spans", we only need to look at the .Start for the
- // first spand and the .End of the last span:
- var startPoint = spans[0].Start;
- var endPoint = spans[spans.Count - 1].End;
-
- // Note, (startPoint,endPoint) are points in the spans for which we're being asked to provide tags. We need to translate
- // these back into the most recent snapshot that we've computed regions for, namely _snapshot.
- var entire = new SnapshotSpan(startPoint, endPoint).TranslateTo(_snapshot, SpanTrackingMode.EdgeExclusive);
- int start = entire.Start;
- int end = entire.End;
- foreach (var r in _regions) {
- if (0 <= r.Length && r.Start <= end && start <= r.Start + r.Length) {
- DafnyTokenKinds kind;
- switch (r.Kind) {
- case IdRegion.OccurrenceKind.Use:
- kind = DafnyTokenKinds.VariableIdentifier; break;
- case IdRegion.OccurrenceKind.Definition:
- kind = DafnyTokenKinds.VariableIdentifierDefinition; break;
- case IdRegion.OccurrenceKind.WildDefinition:
- kind = DafnyTokenKinds.Keyword; break;
- default:
- Contract.Assert(false); // unexpected OccurrenceKind
- goto case IdRegion.OccurrenceKind.Use; // to please compiler
- }
- yield return new TagSpan<DafnyTokenTag>(
- new SnapshotSpan(_snapshot, r.Start, r.Length),
- new DafnyTokenTag(kind, r.HoverText));
- }
- }
- }
-
- // the Classifier tagger is translating buffer change events into TagsChanged events, so we don't have to
- public event EventHandler<SnapshotSpanEventArgs> TagsChanged;
-
- void _aggregator_TagsChanged(object sender, TagsChangedEventArgs e) {
- var r = sender as ResolverTagger;
- if (r != null) {
- ITextSnapshot snap;
- Microsoft.Dafny.Program prog;
- lock (this) {
- snap = r._snapshot;
- prog = r._program;
- }
- if (prog != null) {
- if (!ComputeIdentifierRegions(prog, snap))
- return; // no new regions
-
- var chng = TagsChanged;
- if (chng != null) {
- NormalizedSnapshotSpanCollection spans = e.Span.GetSpans(_buffer.CurrentSnapshot);
- if (spans.Count > 0) {
- SnapshotSpan span = new SnapshotSpan(spans[0].Start, spans[spans.Count - 1].End);
- chng(this, new SnapshotSpanEventArgs(span));
- }
- }
- }
- }
- }
-
- bool ComputeIdentifierRegions(Microsoft.Dafny.Program program, ITextSnapshot snapshot) {
- Contract.Requires(snapshot != null);
-
- if (program == _program)
- return false; // no new regions
-
- List<IdRegion> newRegions = new List<IdRegion>();
-
- foreach (var module in program.Modules) {
- foreach (var d in module.TopLevelDecls) {
- if (d is DatatypeDecl) {
- var dt = (DatatypeDecl)d;
- foreach (var ctor in dt.Ctors) {
- foreach (var dtor in ctor.Destructors) {
- if (dtor != null) {
- IdRegion.Add(newRegions, dtor.tok, dtor, null, "destructor", true, module);
- }
- }
- }
- } else if (d is ClassDecl) {
- var cl = (ClassDecl)d;
- foreach (var member in cl.Members) {
- if (member is Function) {
- var f = (Function)member;
- foreach (var p in f.Formals) {
- IdRegion.Add(newRegions, p.tok, p, true, module);
- }
- f.Req.ForEach(e => ExprRegions(e, newRegions, module));
- f.Reads.ForEach(fe => FrameExprRegions(fe, newRegions, true, module));
- f.Ens.ForEach(e => ExprRegions(e, newRegions, module));
- f.Decreases.Expressions.ForEach(e => ExprRegions(e, newRegions, module));
- if (f.Body != null) {
- ExprRegions(f.Body, newRegions, module);
- }
- } else if (member is Method) {
- var m = (Method)member;
- foreach (var p in m.Ins) {
- IdRegion.Add(newRegions, p.tok, p, true, module);
- }
- foreach (var p in m.Outs) {
- IdRegion.Add(newRegions, p.tok, p, true, module);
- }
- m.Req.ForEach(e => ExprRegions(e.E, newRegions, module));
- m.Mod.Expressions.ForEach(fe => FrameExprRegions(fe, newRegions, true, module));
- m.Ens.ForEach(e => ExprRegions(e.E, newRegions, module));
- m.Decreases.Expressions.ForEach(e => ExprRegions(e, newRegions, module));
- if (m.Body != null) {
- StatementRegions(m.Body, newRegions, module);
- }
- } else if (member is Field) {
- var fld = (Field)member;
- IdRegion.Add(newRegions, fld.tok, fld, null, "field", true, module);
- }
- }
- }
- }
- }
- _snapshot = snapshot;
- _regions = newRegions;
- _program = program;
- return true;
- }
-
- static void FrameExprRegions(FrameExpression fe, List<IdRegion> regions, bool descendIntoExpressions, ModuleDefinition module) {
- Contract.Requires(fe != null);
- Contract.Requires(regions != null);
- if (descendIntoExpressions) {
- ExprRegions(fe.E, regions, module);
- }
- if (fe.Field != null) {
- Microsoft.Dafny.Type showType = null; // TODO: if we had the instantiated type of this field, that would have been nice to use here (but the Resolver currently does not compute or store the instantiated type for a FrameExpression)
- IdRegion.Add(regions, fe.tok, fe.Field, showType, "field", false, module);
- }
- }
-
- static void ExprRegions(Microsoft.Dafny.Expression expr, List<IdRegion> regions, ModuleDefinition module) {
- Contract.Requires(expr != null);
- Contract.Requires(regions != null);
- if (expr is IdentifierExpr) {
- var e = (IdentifierExpr)expr;
- IdRegion.Add(regions, e.tok, e.Var, false, module);
- } else if (expr is FieldSelectExpr) {
- var e = (FieldSelectExpr)expr;
- IdRegion.Add(regions, e.tok, e.Field, e.Type, "field", false, module);
- } else if (expr is ComprehensionExpr) {
- var e = (ComprehensionExpr)expr;
- foreach (var bv in e.BoundVars) {
- IdRegion.Add(regions, bv.tok, bv, true, module);
- }
- } else if (expr is MatchExpr) {
- var e = (MatchExpr)expr;
- foreach (var kase in e.Cases) {
- kase.Arguments.ForEach(bv => IdRegion.Add(regions, bv.tok, bv, true, module));
- }
- } else if (expr is ChainingExpression) {
- var e = (ChainingExpression)expr;
- // Do the subexpressions only once (that is, avoid the duplication that occurs in the desugared form of the ChainingExpression)
- e.Operands.ForEach(ee => ExprRegions(ee, regions, module));
- return; // return here, so as to avoid doing the subexpressions below
- }
- foreach (var ee in expr.SubExpressions) {
- ExprRegions(ee, regions, module);
- }
- }
-
- static void StatementRegions(Statement stmt, List<IdRegion> regions, ModuleDefinition module) {
- Contract.Requires(stmt != null);
- Contract.Requires(regions != null);
- if (stmt is VarDeclStmt) {
- var s = (VarDeclStmt)stmt;
- // Add the variables here, once, and then go directly to the RHS's (without letting the sub-statements re-do the LHS's)
- foreach (var lhs in s.Lhss) {
- IdRegion.Add(regions, lhs.Tok, lhs, true, module);
- }
- if (s.Update == null) {
- // the VarDeclStmt has no associated assignment
- } else if (s.Update is UpdateStmt) {
- var upd = (UpdateStmt)s.Update;
- foreach (var rhs in upd.Rhss) {
- foreach (var ee in rhs.SubExpressions) {
- ExprRegions(ee, regions, module);
- }
- }
- } else {
- var upd = (AssignSuchThatStmt)s.Update;
- ExprRegions(upd.Expr, regions, module);
- }
- // we're done, so don't do the sub-statements/expressions again
- return;
- } else if (stmt is VarDecl) {
- var s = (VarDecl)stmt;
- IdRegion.Add(regions, s.Tok, s, true, module);
- } else if (stmt is ParallelStmt) {
- var s = (ParallelStmt)stmt;
- s.BoundVars.ForEach(bv => IdRegion.Add(regions, bv.tok, bv, true, module));
- } else if (stmt is MatchStmt) {
- var s = (MatchStmt)stmt;
- foreach (var kase in s.Cases) {
- kase.Arguments.ForEach(bv => IdRegion.Add(regions, bv.tok, bv, true, module));
- }
- } else if (stmt is LoopStmt) {
- var s = (LoopStmt)stmt;
- if (s.Mod.Expressions != null) {
- s.Mod.Expressions.ForEach(fe => FrameExprRegions(fe, regions, false, module));
- }
- }
- foreach (var ee in stmt.SubExpressions) {
- ExprRegions(ee, regions, module);
- }
- foreach (var ss in stmt.SubStatements) {
- StatementRegions(ss, regions, module);
- }
- }
-
- class IdRegion
- {
- public readonly int Start;
- public readonly int Length;
- public readonly string HoverText;
- public enum OccurrenceKind { Use, Definition, WildDefinition }
- public readonly OccurrenceKind Kind;
-
- static bool SurfaceSyntaxToken(Bpl.IToken tok) {
- Contract.Requires(tok != null);
- return !(tok is TokenWrapper);
- }
-
- public static void Add(List<IdRegion> regions, Bpl.IToken tok, IVariable v, bool isDefinition, ModuleDefinition context) {
- Contract.Requires(regions != null);
- Contract.Requires(tok != null);
- Contract.Requires(v != null);
- if (SurfaceSyntaxToken(tok)) {
- regions.Add(new IdRegion(tok, v, isDefinition, context));
- }
- }
- public static void Add(List<IdRegion> regions, Bpl.IToken tok, Field decl, Microsoft.Dafny.Type showType, string kind, bool isDefinition, ModuleDefinition context) {
- Contract.Requires(regions != null);
- Contract.Requires(tok != null);
- Contract.Requires(decl != null);
- Contract.Requires(kind != null);
- if (SurfaceSyntaxToken(tok)) {
- regions.Add(new IdRegion(tok, decl, showType, kind, isDefinition, context));
- }
- }
-
- private IdRegion(Bpl.IToken tok, IVariable v, bool isDefinition, ModuleDefinition context) {
- Contract.Requires(tok != null);
- Contract.Requires(v != null);
- Start = tok.pos;
- Length = v.DisplayName.Length;
- string kind;
- if (v is VarDecl) {
- kind = "local variable";
- } else if (v is BoundVar) {
- kind = "bound variable";
- } else {
- var formal = (Formal)v;
- kind = formal.InParam ? "in-parameter" : "out-parameter";
- }
- HoverText = string.Format("({2}{3}) {0}: {1}", v.DisplayName, v.Type.TypeName(context), v.IsGhost ? "ghost " : "", kind);
- Kind = !isDefinition ? OccurrenceKind.Use : VarDecl.HasWildcardName(v) ? OccurrenceKind.WildDefinition : OccurrenceKind.Definition;
- }
- private IdRegion(Bpl.IToken tok, Field decl, Microsoft.Dafny.Type showType, string kind, bool isDefinition, ModuleDefinition context) {
- Contract.Requires(tok != null);
- Contract.Requires(decl != null);
- Contract.Requires(kind != null);
- if (showType == null) {
- showType = decl.Type;
- }
- Start = tok.pos;
- Length = decl.Name.Length;
- HoverText = string.Format("({2}{3}) {0}: {1}", decl.FullNameInContext(context), showType.TypeName(context), decl.IsGhost ? "ghost " : "", kind);
- Kind = !isDefinition ? OccurrenceKind.Use : OccurrenceKind.Definition;
- }
- }
- }
-
-}
diff --git a/Util/VS2010/DafnyExtension/DafnyExtension/OutliningTagger.cs b/Util/VS2010/DafnyExtension/DafnyExtension/OutliningTagger.cs
deleted file mode 100644
index a47cdba7..00000000
--- a/Util/VS2010/DafnyExtension/DafnyExtension/OutliningTagger.cs
+++ /dev/null
@@ -1,185 +0,0 @@
-//***************************************************************************
-// Copyright © 2010 Microsoft Corporation. All Rights Reserved.
-// This code released under the terms of the
-// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)
-//***************************************************************************
-using EnvDTE;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.ComponentModel.Composition;
-using System.Windows.Threading;
-using Microsoft.VisualStudio.Shell;
-using Microsoft.VisualStudio.Shell.Interop;
-using Microsoft.VisualStudio.Text;
-using Microsoft.VisualStudio.Text.Classification;
-using Microsoft.VisualStudio.Text.Editor;
-using Microsoft.VisualStudio.Text.Tagging;
-using Microsoft.VisualStudio.Text.Projection;
-using Microsoft.VisualStudio.Utilities;
-using System.Diagnostics.Contracts;
-using Bpl = Microsoft.Boogie;
-using Dafny = Microsoft.Dafny;
-
-namespace DafnyLanguage
-{
- [Export(typeof(ITaggerProvider))]
- [ContentType("dafny")]
- [TagType(typeof(IOutliningRegionTag))]
- internal sealed class OutliningTaggerProvider : ITaggerProvider
- {
- [Import]
- internal IBufferTagAggregatorFactoryService AggregatorFactory = null;
-
- public ITagger<T> CreateTagger<T>(ITextBuffer buffer) where T : ITag {
- ITagAggregator<DafnyResolverTag> tagAggregator = AggregatorFactory.CreateTagAggregator<DafnyResolverTag>(buffer);
- // create a single tagger for each buffer.
- Func<ITagger<T>> sc = delegate() { return new OutliningTagger(buffer, tagAggregator) as ITagger<T>; };
- return buffer.Properties.GetOrCreateSingletonProperty<ITagger<T>>(sc);
- }
- }
-
- /// <summary>
- /// Translate DafnyResolverTag's into IOutliningRegionTag's
- /// </summary>
- internal sealed class OutliningTagger : ITagger<IOutliningRegionTag>
- {
- ITextBuffer _buffer;
- ITextSnapshot _snapshot; // the most recent snapshot of _buffer that we have been informed about
- Dafny.Program _program; // the program parsed from _snapshot
- List<ORegion> _regions = new List<ORegion>(); // the regions generated from _program
- ITagAggregator<DafnyResolverTag> _aggregator;
-
- internal OutliningTagger(ITextBuffer buffer, ITagAggregator<DafnyResolverTag> tagAggregator) {
- _buffer = buffer;
- _snapshot = _buffer.CurrentSnapshot;
- _aggregator = tagAggregator;
- _aggregator.TagsChanged += new EventHandler<TagsChangedEventArgs>(_aggregator_TagsChanged);
- }
-
- /// <summary>
- /// Find the Error tokens in the set of all tokens and create an ErrorTag for each
- /// </summary>
- public IEnumerable<ITagSpan<IOutliningRegionTag>> GetTags(NormalizedSnapshotSpanCollection spans) {
- if (spans.Count == 0) yield break;
- // (A NormalizedSnapshotSpanCollection contains spans that all come from the same snapshot.)
- // The spans are ordered by the .Start component, and the collection contains no adjacent or abutting spans.
- // Hence, to find a span that includes all the ones in "spans", we only need to look at the .Start for the
- // first spand and the .End of the last span:
- var startPoint = spans[0].Start;
- var endPoint = spans[spans.Count - 1].End;
-
- // Note, (startPoint,endPoint) are points in the spans for which we're being asked to provide tags. We need to translate
- // these back into the most recent snapshot that we've computed regions for, namely _snapshot.
- var entire = new SnapshotSpan(startPoint, endPoint).TranslateTo(_snapshot, SpanTrackingMode.EdgeExclusive);
- int start = entire.Start;
- int end = entire.End;
- if (start == end) yield break;
-
- foreach (var r in _regions) {
- if (0 <= r.Length && r.Start <= end && start <= r.Start + r.Length) {
- yield return new TagSpan<OutliningRegionTag>(
- new SnapshotSpan(_snapshot, r.Start, r.Length),
- new OutliningRegionTag(false, false, "...", r.HoverText));
- }
- }
- }
-
- // the Classifier tagger is translating buffer change events into TagsChanged events, so we don't have to
- public event EventHandler<SnapshotSpanEventArgs> TagsChanged;
-
- void _aggregator_TagsChanged(object sender, TagsChangedEventArgs e) {
- var r = sender as ResolverTagger;
- if (r != null) {
- ITextSnapshot snap;
- Microsoft.Dafny.Program prog;
- lock (this) {
- snap = r._snapshot;
- prog = r._program;
- }
- if (prog != null) {
- if (!ComputeOutliningRegions(prog, snap))
- return; // no new regions
-
- var chng = TagsChanged;
- if (chng != null) {
- NormalizedSnapshotSpanCollection spans = e.Span.GetSpans(_buffer.CurrentSnapshot);
- if (spans.Count > 0) {
- SnapshotSpan span = new SnapshotSpan(spans[0].Start, spans[spans.Count - 1].End);
- chng(this, new SnapshotSpanEventArgs(span));
- }
- }
- }
- }
- }
-
- bool ComputeOutliningRegions(Dafny.Program program, ITextSnapshot snapshot) {
- Contract.Requires(snapshot != null);
-
- if (program == _program)
- return false; // no new regions
-
- List<ORegion> newRegions = new List<ORegion>();
-
- foreach (var module in program.Modules) {
- if (!module.IsDefaultModule) {
- newRegions.Add(new ORegion(module, "module"));
- }
- foreach (Dafny.TopLevelDecl d in module.TopLevelDecls) {
- if (!HasBodyTokens(d) && !(d is Dafny.ClassDecl)) {
- continue;
- }
- if (d is Dafny.ArbitraryTypeDecl) {
- newRegions.Add(new ORegion(d, "type"));
- } else if (d is Dafny.CoDatatypeDecl) {
- newRegions.Add(new ORegion(d, "codatatype"));
- } else if (d is Dafny.DatatypeDecl) {
- newRegions.Add(new ORegion(d, "datatype"));
- } else if (d is Dafny.ModuleDecl) {
- // do nothing here, since the outer loop handles modules
- } else {
- Dafny.ClassDecl cl = (Dafny.ClassDecl)d;
- if (!cl.IsDefaultClass) {
- newRegions.Add(new ORegion(cl, "class"));
- }
- // do the class members (in particular, functions and methods)
- foreach (Dafny.MemberDecl m in cl.Members) {
- if (!HasBodyTokens(m)) {
- continue;
- }
- if (m is Dafny.Function && ((Dafny.Function)m).Body != null) {
- newRegions.Add(new ORegion(m, m is Dafny.CoPredicate ? "copredicate" : m is Dafny.Predicate ? "predicate" : "function"));
- } else if (m is Dafny.Method && ((Dafny.Method)m).Body != null) {
- newRegions.Add(new ORegion(m, m is Dafny.Constructor ? "constructor" : "method"));
- }
- }
- }
- }
- }
- _snapshot = snapshot;
- _regions = newRegions;
- _program = program;
- return true;
- }
-
- bool HasBodyTokens(Dafny.Declaration decl) {
- Contract.Requires(decl != null);
- return decl.BodyStartTok != Bpl.Token.NoToken && decl.BodyEndTok != Bpl.Token.NoToken;
- }
-
- class ORegion
- {
- public readonly int Start;
- public readonly int Length;
- public readonly string HoverText;
- public ORegion(Dafny.Declaration decl, string kind) {
- int startPosition = decl.BodyStartTok.pos + 1; // skip the open-curly brace itself
- int length = decl.BodyEndTok.pos - startPosition;
- Start = startPosition;
- Length = length;
- HoverText = string.Format("body of {0} {1}", kind, decl.Name);
- }
- }
- }
-}
diff --git a/Util/VS2010/DafnyExtension/DafnyExtension/ProgressMargin.cs b/Util/VS2010/DafnyExtension/DafnyExtension/ProgressMargin.cs
deleted file mode 100644
index 7fdf38a6..00000000
--- a/Util/VS2010/DafnyExtension/DafnyExtension/ProgressMargin.cs
+++ /dev/null
@@ -1,260 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using System.Windows.Threading;
-using System.Windows;
-using System.Windows.Shapes;
-using System.Windows.Media;
-using System.Windows.Controls;
-using System.ComponentModel.Composition;
-using Microsoft.VisualStudio.Text;
-using Microsoft.VisualStudio.Text.Editor;
-using Microsoft.VisualStudio.Text.Formatting;
-using Microsoft.VisualStudio.Text.Tagging;
-using Microsoft.VisualStudio.Text.Classification;
-using Microsoft.VisualStudio.Shell;
-using Microsoft.VisualStudio.Utilities;
-using System.Diagnostics.Contracts;
-using Dafny = Microsoft.Dafny;
-using Bpl = Microsoft.Boogie;
-
-
-namespace DafnyLanguage
-{
- #region UI stuff
- internal class ProgressMarginGlyphFactory : IGlyphFactory
- {
- public UIElement GenerateGlyph(IWpfTextViewLine line, IGlyphTag tag) {
- var dtag = tag as ProgressGlyphTag;
- if (dtag == null) {
- return null;
- }
-
- System.Windows.Shapes.Rectangle sh = new Rectangle() {
- Fill = dtag.Val == 0 ? Brushes.Violet : Brushes.DarkOrange,
- Height = 18.0,
- Width = 3.0
- };
- return sh;
- }
- }
-
- [Export(typeof(IGlyphFactoryProvider))]
- [Name("ProgressMarginGlyph")]
- [Order(After = "TokenTagger")]
- [ContentType("dafny")]
- [TagType(typeof(ProgressGlyphTag))]
- internal sealed class ProgressMarginGlyphFactoryProvider : IGlyphFactoryProvider
- {
- public IGlyphFactory GetGlyphFactory(IWpfTextView view, IWpfTextViewMargin margin) {
- return new ProgressMarginGlyphFactory();
- }
- }
-
- internal class ProgressGlyphTag : IGlyphTag
- {
- public readonly int Val;
- public ProgressGlyphTag(int val) {
- Val = val;
- }
- }
- #endregion
-
- [Export(typeof(ITaggerProvider))]
- [ContentType("dafny")]
- [TagType(typeof(ProgressGlyphTag))]
- class ProgressTaggerProvider : ITaggerProvider
- {
- [Import]
- internal IBufferTagAggregatorFactoryService AggregatorFactory = null;
-
- [Import(typeof(Microsoft.VisualStudio.Shell.SVsServiceProvider))]
- internal IServiceProvider _serviceProvider = null;
-
- public ITagger<T> CreateTagger<T>(ITextBuffer buffer) where T : ITag {
- ITagAggregator<DafnyResolverTag> tagAggregator = AggregatorFactory.CreateTagAggregator<DafnyResolverTag>(buffer);
- // create a single tagger for each buffer.
- Func<ITagger<T>> sc = delegate() { return new ProgressTagger(buffer, _serviceProvider, tagAggregator) as ITagger<T>; };
- return buffer.Properties.GetOrCreateSingletonProperty<ITagger<T>>(sc);
- }
- }
-
- internal class ProgressTagger : ITagger<ProgressGlyphTag>
- {
- ErrorListProvider _errorProvider;
- ITextBuffer _buffer;
-
- readonly DispatcherTimer timer;
-
- public ProgressTagger(ITextBuffer buffer, IServiceProvider serviceProvider, ITagAggregator<DafnyResolverTag> tagAggregator) {
- _buffer = buffer;
- _errorProvider = new ErrorListProvider(serviceProvider);
-
- timer = new DispatcherTimer(DispatcherPriority.ApplicationIdle);
- timer.Interval = TimeSpan.FromMilliseconds(500);
- timer.Tick += new EventHandler(UponIdle);
-
- tagAggregator.TagsChanged += new EventHandler<TagsChangedEventArgs>(_aggregator_TagsChanged);
- buffer.Changed += new EventHandler<TextContentChangedEventArgs>(buffer_Changed);
- bufferChangesPostVerificationStart.Add(new SnapshotSpan(buffer.CurrentSnapshot, 0, buffer.CurrentSnapshot.Length));
- }
-
- public void Dispose() {
- }
-
- // The following fields and the contents of the following two lists are protected by the lock "this".
- List<SnapshotSpan> bufferChangesPreVerificationStart = new List<SnapshotSpan>(); // buffer changes after the last completed verification and before the currently running verification
- List<SnapshotSpan> bufferChangesPostVerificationStart = new List<SnapshotSpan>(); // buffer changes since the start of the currently running verification
-
- void buffer_Changed(object sender, TextContentChangedEventArgs e) {
- lock (this) {
- foreach (var change in e.Changes) {
- var startLine = e.After.GetLineFromPosition(change.NewPosition);
- var endLine = e.After.GetLineFromPosition(change.NewEnd);
- bufferChangesPostVerificationStart.Add(new SnapshotSpan(startLine.Start, endLine.End));
- }
- }
- }
-
- // The next field is protected by "this"
- ResolverTagger resolver;
- // Keep track of the most recent resolution results.
- void _aggregator_TagsChanged(object sender, TagsChangedEventArgs e) {
- var r = sender as ResolverTagger;
- if (r != null) {
- lock (this) {
- resolver = r;
- }
- timer.Stop();
- timer.Start();
- }
- }
-
- bool verificationInProgress; // this field is protected by "this". Invariant: !verificationInProgress ==> bufferChangesPreVerificationStart.Count == 0
- /// <summary>
- /// This method is invoked when the user has been idle for a little while.
- /// Note, "sender" and "args" are allowed to be passed in as null--they are not used by this method.
- /// </summary>
- public void UponIdle(object sender, EventArgs args) {
- Dafny.Program prog;
- ITextSnapshot snap;
- ResolverTagger r;
- lock (this) {
- if (verificationInProgress) {
- // This UponIdle message came at an inopportune time--we've already kicked off a verification.
- // Just back off.
- return;
- }
-
- if (resolver == null) return;
- lock (resolver) {
- prog = resolver._program;
- snap = resolver._snapshot;
- }
- r = resolver;
- resolver = null;
- if (prog == null) return;
- // We have a successfully resolved program to verify
-
- var resolvedVersion = snap.Version.VersionNumber;
- if (bufferChangesPostVerificationStart.Count == 0) {
- // Nothing new to verify. No reason to start a new verification.
- return;
- } else if (!bufferChangesPostVerificationStart.TrueForAll(span => span.Snapshot.Version.VersionNumber <= resolvedVersion)) {
- // There have been buffer changes since the program that was resolved. Do nothing here,
- // and instead just await the next resolved program.
- return;
- }
-
- // at this time, we're committed to running the verifier
- verificationInProgress = true;
-
- // Change orange progress markers into yellow ones
- Contract.Assert(bufferChangesPreVerificationStart.Count == 0); // follows from monitor invariant
- var empty = bufferChangesPreVerificationStart;
- bufferChangesPreVerificationStart = bufferChangesPostVerificationStart;
- bufferChangesPostVerificationStart = empty;
- // Notify to-whom-it-may-concern about the changes we just made
- var chng = TagsChanged;
- if (chng != null) {
- chng(this, new SnapshotSpanEventArgs(new SnapshotSpan(snap, 0, snap.Length)));
- }
-
- }
- new Thread(() => VerificationWorker(prog, snap, r)).Start();
- }
-
- /// <summary>
- /// Thread entry point.
- /// </summary>
- void VerificationWorker(Dafny.Program program, ITextSnapshot snapshot, ResolverTagger errorListHolder) {
- Contract.Requires(program != null);
- Contract.Requires(snapshot != null);
- Contract.Requires(errorListHolder != null);
-
- // Run the verifier
- var newErrors = new List<DafnyError>();
- try {
- bool success = DafnyDriver.Verify(program, errorInfo => {
- newErrors.Add(new DafnyError(errorInfo.Tok.line - 1, errorInfo.Tok.col - 1, ErrorCategory.VerificationError, errorInfo.Msg));
- foreach (var aux in errorInfo.Aux) {
- newErrors.Add(new DafnyError(aux.Tok.line - 1, aux.Tok.col - 1, ErrorCategory.AuxInformation, aux.Msg));
- }
- });
- if (!success) {
- newErrors.Add(new DafnyError(0, 0, ErrorCategory.InternalError, "verification process error"));
- }
- } catch (Exception e) {
- newErrors.Add(new DafnyError(0, 0, ErrorCategory.InternalError, "verification process error: " + e.Message));
- }
- errorListHolder.PopulateErrorList(newErrors, true, snapshot);
-
- lock (this) {
- bufferChangesPreVerificationStart.Clear();
- verificationInProgress = false;
- }
- // Notify to-whom-it-may-concern about the cleared pre-verification changes
- var chng = TagsChanged;
- if (chng != null) {
- chng(this, new SnapshotSpanEventArgs(new SnapshotSpan(snapshot, 0, snapshot.Length)));
- }
-
- // If new changes took place since we started the verification, we may need to kick off another verification
- // immediately.
- UponIdle(null, null);
- }
-
- public event EventHandler<SnapshotSpanEventArgs> TagsChanged;
- IEnumerable<ITagSpan<ProgressGlyphTag>> ITagger<ProgressGlyphTag>.GetTags(NormalizedSnapshotSpanCollection spans) {
- if (spans.Count == 0) yield break;
- var targetSnapshot = spans[0].Snapshot;
-
- List<SnapshotSpan> pre;
- List<SnapshotSpan> post;
- lock (this) {
- pre = bufferChangesPreVerificationStart;
- post = bufferChangesPostVerificationStart;
- }
-
- // If the requested snapshot isn't the same as the one our words are on, translate our spans to the expected snapshot
- NormalizedSnapshotSpanCollection chs;
- chs = new NormalizedSnapshotSpanCollection(Map(pre, span => span.TranslateTo(targetSnapshot, SpanTrackingMode.EdgeExclusive)));
- foreach (SnapshotSpan span in NormalizedSnapshotSpanCollection.Overlap(spans, chs)) {
- yield return new TagSpan<ProgressGlyphTag>(span, new ProgressGlyphTag(0));
- }
- chs = new NormalizedSnapshotSpanCollection(Map(post, span => span.TranslateTo(targetSnapshot, SpanTrackingMode.EdgeExclusive)));
- foreach (SnapshotSpan span in NormalizedSnapshotSpanCollection.Overlap(spans, chs)) {
- yield return new TagSpan<ProgressGlyphTag>(span, new ProgressGlyphTag(1));
- }
- }
-
- /// <summary>
- /// (Why the firetruck isn't an extension method like this already in the standard library?)
- /// </summary>
- public static IEnumerable<TOut> Map<TIn, TOut>(IEnumerable<TIn> coll, System.Func<TIn, TOut> fn) {
- foreach (var e in coll) {
- yield return fn(e);
- }
- }
- }
-}
diff --git a/Util/VS2010/DafnyExtension/DafnyExtension/Properties/AssemblyInfo.cs b/Util/VS2010/DafnyExtension/DafnyExtension/Properties/AssemblyInfo.cs
deleted file mode 100644
index b73b8410..00000000
--- a/Util/VS2010/DafnyExtension/DafnyExtension/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("EditorClassifier1")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("EditorClassifier1")]
-[assembly: AssemblyCopyright("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Util/VS2010/DafnyExtension/DafnyExtension/ResolverTagger.cs b/Util/VS2010/DafnyExtension/DafnyExtension/ResolverTagger.cs
deleted file mode 100644
index d1af6878..00000000
--- a/Util/VS2010/DafnyExtension/DafnyExtension/ResolverTagger.cs
+++ /dev/null
@@ -1,321 +0,0 @@
-//***************************************************************************
-// Copyright © 2010 Microsoft Corporation. All Rights Reserved.
-// This code released under the terms of the
-// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)
-//***************************************************************************
-using EnvDTE;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.ComponentModel.Composition;
-using System.Windows.Threading;
-using Microsoft.VisualStudio;
-using Microsoft.VisualStudio.Shell;
-using Microsoft.VisualStudio.Shell.Interop;
-using Microsoft.VisualStudio.Text;
-using Microsoft.VisualStudio.Text.Classification;
-using Microsoft.VisualStudio.Text.Editor;
-using Microsoft.VisualStudio.Text.Tagging;
-using Microsoft.VisualStudio.Text.Projection;
-using Microsoft.VisualStudio.TextManager.Interop;
-using Microsoft.VisualStudio.Utilities;
-using System.Diagnostics.Contracts;
-using Dafny = Microsoft.Dafny;
-
-namespace DafnyLanguage
-{
- [Export(typeof(ITaggerProvider))]
- [ContentType("dafny")]
- [TagType(typeof(DafnyResolverTag))]
- internal sealed class ResolverTaggerProvider : ITaggerProvider
- {
- [Import(typeof(Microsoft.VisualStudio.Shell.SVsServiceProvider))]
- internal IServiceProvider _serviceProvider = null;
-
- [Import]
- ITextDocumentFactoryService _textDocumentFactory = null;
-
- public ITagger<T> CreateTagger<T>(ITextBuffer buffer) where T : ITag {
- // create a single tagger for each buffer.
- Func<ITagger<T>> sc = delegate() { return new ResolverTagger(buffer, _serviceProvider, _textDocumentFactory) as ITagger<T>; };
- return buffer.Properties.GetOrCreateSingletonProperty<ITagger<T>>(sc);
- }
- }
-
- public abstract class DafnyResolverTag : ITag
- {
- }
- public class DafnyErrorResolverTag : DafnyResolverTag
- {
- public readonly string Typ;
- public readonly string Msg;
- public DafnyErrorResolverTag(string typ, string msg) {
- Typ = typ;
- Msg = msg;
- }
- }
- public class DafnySuccessResolverTag : DafnyResolverTag
- {
- public readonly Dafny.Program Program;
- public DafnySuccessResolverTag(Dafny.Program program) {
- Program = program;
- }
- }
-
- /// <summary>
- /// Translate PkgDefTokenTags into ErrorTags and Error List items
- /// </summary>
- internal sealed class ResolverTagger : ITagger<DafnyResolverTag>, IDisposable
- {
- ITextBuffer _buffer;
- ITextDocument _document;
- // The _snapshot and _program fields should be updated and read together, so they are protected by "this"
- public ITextSnapshot _snapshot; // may be null
- public Dafny.Program _program; // non-null only if the snapshot contains a Dafny program that type checks
- List<DafnyError> _resolutionErrors = new List<DafnyError>(); // if nonempty, then _snapshot is the snapshot from which the errors were produced
- List<DafnyError> _verificationErrors = new List<DafnyError>();
- ErrorListProvider _errorProvider;
-
- internal ResolverTagger(ITextBuffer buffer, IServiceProvider serviceProvider, ITextDocumentFactoryService textDocumentFactory) {
- _buffer = buffer;
- if (!textDocumentFactory.TryGetTextDocument(_buffer, out _document))
- _document = null;
- _snapshot = null; // this makes sure the next snapshot will look different
- _errorProvider = new ErrorListProvider(serviceProvider);
-
- BufferIdleEventUtil.AddBufferIdleEventListener(_buffer, ResolveBuffer);
- }
-
- public void Dispose() {
- if (_errorProvider != null) {
- try {
- _errorProvider.Tasks.Clear();
- } catch (InvalidOperationException) {
- // this may occur if the SVsServiceProvider somehow has been uninstalled before our Dispose method is called
- }
- _errorProvider.Dispose();
- }
- BufferIdleEventUtil.RemoveBufferIdleEventListener(_buffer, ResolveBuffer);
- }
-
- public IEnumerable<DafnyError> AllErrors() {
- foreach (var err in _resolutionErrors) {
- yield return err;
- }
- if (_resolutionErrors.Count != 0) {
- // we're done
- yield break;
- }
- foreach (var err in _verificationErrors) {
- yield return err;
- }
- }
-
- /// <summary>
- /// Find the Error tokens in the set of all tokens and create an ErrorTag for each
- /// </summary>
- public IEnumerable<ITagSpan<DafnyResolverTag>> GetTags(NormalizedSnapshotSpanCollection spans) {
- if (spans.Count == 0) yield break;
- var currentSnapshot = spans[0].Snapshot;
- foreach (var err in AllErrors()) {
- if (err.Category != ErrorCategory.ProcessError) {
- var span = err.Span().TranslateTo(currentSnapshot, SpanTrackingMode.EdgeExclusive);
- string ty; // the COLORs below indicate what I see on my machine
- switch (err.Category) {
- default: // unexpected category
- case ErrorCategory.ParseError:
- case ErrorCategory.ParseWarning:
- ty = "syntax error"; break; // COLOR: red
- case ErrorCategory.ResolveError:
- ty = "compiler error"; break; // COLOR: blue
- case ErrorCategory.VerificationError:
- ty = "error"; break; // COLOR: red
- case ErrorCategory.AuxInformation:
- ty = "other error"; break; // COLOR: purple red
- case ErrorCategory.InternalError:
- ty = "error"; break; // COLOR: red
- }
- yield return new TagSpan<DafnyResolverTag>(span, new DafnyErrorResolverTag(ty, err.Message));
- }
- }
-
- ITextSnapshot snap;
- Dafny.Program prog;
- lock (this) {
- snap = _snapshot;
- prog = _program;
- }
- if (prog != null) {
- yield return new TagSpan<DafnyResolverTag>(new SnapshotSpan(snap, 0, snap.Length), new DafnySuccessResolverTag(prog));
- }
- }
-
- public event EventHandler<SnapshotSpanEventArgs> TagsChanged;
-
- /// <summary>
- /// Calls the Dafny parser/resolver/type checker on the contents of the buffer, updates the Error List accordingly.
- /// </summary>
- void ResolveBuffer(object sender, EventArgs args) {
- ITextSnapshot snapshot = _buffer.CurrentSnapshot;
- if (snapshot == _snapshot)
- return; // we've already done this snapshot
- NormalizedSnapshotSpanCollection spans = new NormalizedSnapshotSpanCollection(new SnapshotSpan(snapshot, 0, snapshot.Length));
-
- var driver = new DafnyDriver(snapshot.GetText(), _document != null ? _document.FilePath : "<program>");
- List<DafnyError> newErrors;
- Dafny.Program program;
- try {
- program = driver.ProcessResolution();
- newErrors = driver.Errors;
- } catch (Exception e) {
- newErrors = new List<DafnyError>();
- newErrors.Add(new DafnyError(0, 0, ErrorCategory.InternalError, "internal Dafny error: " + e.Message));
- program = null;
- }
-
- lock (this) {
- _snapshot = snapshot;
- _program = program;
- }
- PopulateErrorList(newErrors, false, snapshot);
- }
-
- public void PopulateErrorList(List<DafnyError> newErrors, bool verificationErrors, ITextSnapshot snapshot) {
- Contract.Requires(newErrors != null);
- foreach (var err in newErrors) {
- err.FillInSnapshot(snapshot);
- }
- if (verificationErrors) {
- _verificationErrors = newErrors;
- } else {
- _resolutionErrors = newErrors;
- }
-
- _errorProvider.SuspendRefresh(); // reduce flickering
- _errorProvider.Tasks.Clear();
- foreach (var err in AllErrors()) {
- ErrorTask task = new ErrorTask() {
- Category = TaskCategory.BuildCompile,
- ErrorCategory = CategoryConversion(err.Category),
- Text = err.Message,
- Line = err.Line,
- Column = err.Column
- };
- if (_document != null) {
- task.Document = _document.FilePath;
- }
- if (err.Category != ErrorCategory.ProcessError && err.Category != ErrorCategory.InternalError) {
- task.Navigate += new EventHandler(NavigateHandler);
- }
- _errorProvider.Tasks.Add(task);
- }
- _errorProvider.ResumeRefresh();
- var chng = TagsChanged;
- if (chng != null)
- chng(this, new SnapshotSpanEventArgs(new SnapshotSpan(snapshot, 0, snapshot.Length)));
- }
-
- TaskErrorCategory CategoryConversion(ErrorCategory cat) {
- switch (cat) {
- case ErrorCategory.ParseError:
- case ErrorCategory.ResolveError:
- case ErrorCategory.VerificationError:
- case ErrorCategory.InternalError:
- return TaskErrorCategory.Error;
- case ErrorCategory.ParseWarning:
- return TaskErrorCategory.Warning;
- case ErrorCategory.AuxInformation:
- return TaskErrorCategory.Message;
- default:
- Contract.Assert(false); // unexpected category
- return TaskErrorCategory.Error; // please compiler
- }
- }
-
- void NavigateHandler(object sender, EventArgs arguments) {
- var task = sender as ErrorTask;
- if (task == null || task.Document == null)
- return;
-
- // This would have been the simple way of doing things:
- // _errorProvider.Navigate(error, new Guid(EnvDTE.Constants.vsViewKindCode));
- // Unfortunately, it doesn't work--it seems to ignore the column position. (Moreover, it wants 1-based
- // line/column numbers, whereas the Error Task pane wants 0-based line/column numbers.)
- // So, instead we do all the things that follow:
-
- var openDoc = Package.GetGlobalService(typeof(IVsUIShellOpenDocument)) as IVsUIShellOpenDocument;
- if (openDoc == null)
- return;
-
- IVsWindowFrame frame;
- Microsoft.VisualStudio.OLE.Interop.IServiceProvider sp;
- IVsUIHierarchy hier;
- uint itemid;
- Guid logicalView = VSConstants.LOGVIEWID_Code;
- if (Microsoft.VisualStudio.ErrorHandler.Failed(openDoc.OpenDocumentViaProject(task.Document, ref logicalView, out sp, out hier, out itemid, out frame)) || frame == null)
- return;
-
- object docData;
- Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(frame.GetProperty((int)__VSFPROPID.VSFPROPID_DocData, out docData));
-
- // Get the VsTextBuffer
- VsTextBuffer buffer = docData as VsTextBuffer;
- if (buffer == null) {
- IVsTextBufferProvider bufferProvider = docData as IVsTextBufferProvider;
- if (bufferProvider != null) {
- IVsTextLines lines;
- Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(bufferProvider.GetTextBuffer(out lines));
- buffer = lines as VsTextBuffer;
- if (buffer == null)
- return;
- }
- }
-
- VsTextManager textManager = Package.GetGlobalService(typeof(VsTextManagerClass)) as VsTextManager;
- if (textManager == null)
- return;
-
- // Finally, move the cursor
- Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(textManager.NavigateToLineAndColumn(buffer, ref logicalView, task.Line, task.Column, task.Line, task.Column));
- }
-
- }
-
- public enum ErrorCategory
- {
- ProcessError, ParseWarning, ParseError, ResolveError, VerificationError, AuxInformation, InternalError
- }
-
- internal class DafnyError
- {
- public readonly int Line; // 0 based
- public readonly int Column; // 0 based
- ITextSnapshot Snapshot; // filled in during the FillInSnapshot call
- public readonly ErrorCategory Category;
- public readonly string Message;
- /// <summary>
- /// "line" and "col" are expected to be 0-based
- /// </summary>
- public DafnyError(int line, int col, ErrorCategory cat, string msg) {
- Contract.Requires(0 <= line);
- Contract.Requires(0 <= col);
- Line = line;
- Column = col;
- Category = cat;
- Message = msg;
- }
-
- public void FillInSnapshot(ITextSnapshot snapshot) {
- Contract.Requires(snapshot != null);
- Snapshot = snapshot;
- }
- public SnapshotSpan Span() {
- Contract.Requires(Snapshot != null); // requires that Snapshot has been filled in
- var line = Snapshot.GetLineFromLineNumber(Line);
- Contract.Assume(Column <= line.Length); // this is really a precondition of the constructor + FillInSnapshot
- var length = Math.Min(line.Length - Column, 5);
- return new SnapshotSpan(line.Start + Column, length);
- }
- }
-}
diff --git a/Util/VS2010/DafnyExtension/DafnyExtension/TokenTagger.cs b/Util/VS2010/DafnyExtension/DafnyExtension/TokenTagger.cs
deleted file mode 100644
index 2f295429..00000000
--- a/Util/VS2010/DafnyExtension/DafnyExtension/TokenTagger.cs
+++ /dev/null
@@ -1,342 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.ComponentModel.Composition;
-using Microsoft.VisualStudio.Text;
-using Microsoft.VisualStudio.Text.Classification;
-using Microsoft.VisualStudio.Text.Editor;
-using Microsoft.VisualStudio.Text.Tagging;
-using Microsoft.VisualStudio.Utilities;
-using Dafny = Microsoft.Dafny;
-
-namespace DafnyLanguage
-{
- [Export(typeof(ITaggerProvider))]
- [ContentType("dafny")]
- [TagType(typeof(DafnyTokenTag))]
- internal sealed class DafnyTokenTagProvider : ITaggerProvider
- {
- public ITagger<T> CreateTagger<T>(ITextBuffer buffer) where T : ITag {
- return new DafnyTokenTagger(buffer) as ITagger<T>;
- }
- }
-
- public enum DafnyTokenKinds
- {
- Keyword, Number, String, Comment,
- VariableIdentifier, VariableIdentifierDefinition
- }
-
- public class DafnyTokenTag : ITag
- {
- public DafnyTokenKinds Kind { get; private set; }
- public string HoverText { get; private set; }
-
- public DafnyTokenTag(DafnyTokenKinds kind) {
- this.Kind = kind;
- }
-
- public DafnyTokenTag(DafnyTokenKinds kind, string hoverText) {
- this.Kind = kind;
- this.HoverText = hoverText;
- }
- }
-
- internal sealed class DafnyTokenTagger : ITagger<DafnyTokenTag>
- {
- ITextBuffer _buffer;
- ITextSnapshot _snapshot;
- List<DRegion> _regions;
-
- internal DafnyTokenTagger(ITextBuffer buffer) {
- _buffer = buffer;
- _snapshot = buffer.CurrentSnapshot;
- _regions = Rescan(_snapshot);
-
- _buffer.Changed += new EventHandler<TextContentChangedEventArgs>(ReparseFile);
- }
-
- public event EventHandler<SnapshotSpanEventArgs> TagsChanged;
-
- public IEnumerable<ITagSpan<DafnyTokenTag>> GetTags(NormalizedSnapshotSpanCollection spans) {
- if (spans.Count == 0)
- yield break;
-
- List<DRegion> currentRegions = _regions;
- ITextSnapshot currentSnapshot = _snapshot;
-
- // create a new SnapshotSpan for the entire region encompassed by the span collection
- SnapshotSpan entire = new SnapshotSpan(spans[0].Start, spans[spans.Count - 1].End).TranslateTo(currentSnapshot, SpanTrackingMode.EdgeExclusive);
-
- // return tags for any regions that fall within that span
- // BUGBUG: depending on how GetTags gets called (e.g., once for each line in the buffer), this may produce quadratic behavior
- foreach (var region in currentRegions) {
- if (entire.IntersectsWith(region.Span)) {
- yield return new TagSpan<DafnyTokenTag>(new SnapshotSpan(region.Start, region.End), new DafnyTokenTag(region.Kind));
- }
- }
- }
-
- /// <summary>
- /// Find all of the tag regions in the document (snapshot) and notify
- /// listeners of any that changed
- /// </summary>
- void ReparseFile(object sender, TextContentChangedEventArgs args) {
- ITextSnapshot snapshot = _buffer.CurrentSnapshot;
- if (snapshot == _snapshot)
- return; // we've already computed the regions for this snapshot
-
- // get all of the outline regions in the snapshot
- List<DRegion> newRegions = Rescan(snapshot);
-
- // determine the changed span, and send a changed event with the new spans
- List<SnapshotSpan> oldSpans = new List<SnapshotSpan>(_regions.Select(r =>
- r.Span.TranslateTo(snapshot, SpanTrackingMode.EdgeExclusive)));
-
- List<SnapshotSpan> newSpans = new List<SnapshotSpan>(newRegions.Select(r => r.Span));
-
- NormalizedSnapshotSpanCollection oldSpanCollection = new NormalizedSnapshotSpanCollection(oldSpans);
- NormalizedSnapshotSpanCollection newSpanCollection = new NormalizedSnapshotSpanCollection(newSpans);
-
- NormalizedSnapshotSpanCollection difference = SymmetricDifference(oldSpanCollection, newSpanCollection);
-
- // save the new baseline
- _snapshot = snapshot;
- _regions = newRegions;
-
- var chng = TagsChanged;
- if (chng != null) {
- foreach (var span in difference) {
- chng(this, new SnapshotSpanEventArgs(span));
- }
- }
- }
-
- NormalizedSnapshotSpanCollection SymmetricDifference(NormalizedSnapshotSpanCollection first, NormalizedSnapshotSpanCollection second) {
- return NormalizedSnapshotSpanCollection.Union(
- NormalizedSnapshotSpanCollection.Difference(first, second),
- NormalizedSnapshotSpanCollection.Difference(second, first));
- }
-
- private static List<DRegion> Rescan(ITextSnapshot newSnapshot) {
- List<DRegion> newRegions = new List<DRegion>();
-
- bool stillScanningLongComment = false;
- SnapshotPoint commentStart = new SnapshotPoint(); // used only when stillScanningLongComment
- SnapshotPoint commentEndAsWeKnowIt = new SnapshotPoint(); // used only when stillScanningLongComment
- foreach (ITextSnapshotLine line in newSnapshot.Lines) {
- string txt = line.GetText(); // the current line (without linebreak characters)
- int N = txt.Length; // length of the current line
- int cur = 0; // offset into the current line
-
- if (stillScanningLongComment) {
- if (ScanForEndOfComment(txt, ref cur)) {
- newRegions.Add(new DRegion(commentStart, new SnapshotPoint(newSnapshot, line.Start + cur), DafnyTokenKinds.Comment));
- stillScanningLongComment = false;
- } else {
- commentEndAsWeKnowIt = new SnapshotPoint(newSnapshot, line.Start + cur);
- }
- }
-
- // repeatedly get the remaining tokens from this line
- int end; // offset into the current line
- for (; ; cur = end) {
- // advance to the first character of a keyword or token
- DafnyTokenKinds ty = DafnyTokenKinds.Keyword;
- for (; ; cur++) {
- if (N <= cur) {
- // we've looked at everything in this line
- goto OUTER_CONTINUE;
- }
- char ch = txt[cur];
- if ('a' <= ch && ch <= 'z') break;
- if ('A' <= ch && ch <= 'Z') break;
- if ('0' <= ch && ch <= '9') { ty = DafnyTokenKinds.Number; break; }
- if (ch == '"') { ty = DafnyTokenKinds.String; break; }
- if (ch == '/') { ty = DafnyTokenKinds.Comment; break; }
- if (ch == '\'' || ch == '_' || ch == '?' || ch == '\\') break; // parts of identifiers
- }
-
- // advance to the end of the token
- end = cur + 1; // offset into the current line
- if (ty == DafnyTokenKinds.Number) {
- // scan the rest of this number
- for (; end < N; end++) {
- char ch = txt[end];
- if ('0' <= ch && ch <= '9') {
- } else break;
- }
- } else if (ty == DafnyTokenKinds.String) {
- // scan the rest of this string, but not past the end-of-line
- for (; end < N; end++) {
- char ch = txt[end];
- if (ch == '"') {
- end++; break;
- } else if (ch == '\\') {
- // escape sequence
- end++;
- if (end == N) { break; }
- ch = txt[end];
- if (ch == 'u') {
- end += 4;
- if (N <= end) { end = N; break; }
- }
- }
- }
- } else if (ty == DafnyTokenKinds.Comment) {
- if (end == N) continue; // this was not the start of a comment
- char ch = txt[end];
- if (ch == '/') {
- // a short comment
- end = N;
- } else if (ch == '*') {
- // a long comment; find the matching "*/"
- end++;
- commentStart = new SnapshotPoint(newSnapshot, line.Start + cur);
- if (ScanForEndOfComment(txt, ref end)) {
- newRegions.Add(new DRegion(commentStart, new SnapshotPoint(newSnapshot, line.Start + end), DafnyTokenKinds.Comment));
- } else {
- stillScanningLongComment = true;
- commentEndAsWeKnowIt = new SnapshotPoint(newSnapshot, line.Start + end);
- }
- continue;
- } else {
- // not a comment
- continue;
- }
- } else {
- int trailingDigits = 0;
- for (; end < N; end++) {
- char ch = txt[end];
- if ('a' <= ch && ch <= 'z') {
- trailingDigits = 0;
- } else if ('A' <= ch && ch <= 'Z') {
- trailingDigits = 0;
- } else if ('0' <= ch && ch <= '9') {
- trailingDigits++;
- } else if (ch == '\'' || ch == '_' || ch == '?' || ch == '\\') {
- trailingDigits = 0;
- } else break;
- }
- // we have a keyword or an identifier
- string s = txt.Substring(cur, end - cur);
- if (0 < trailingDigits && s.Length == 5 + trailingDigits && s.StartsWith("array") && s[5] != '0' && (trailingDigits != 1 || s[5] != '1')) {
- // this is a keyword (array2, array3, ...)
- } else {
- switch (s) {
- #region keywords
- case "allocated":
- case "array":
- case "as":
- case "assert":
- case "assume":
- case "bool":
- case "break":
- case "calc":
- case "case":
- case "choose":
- case "class":
- case "codatatype":
- case "constructor":
- case "copredicate":
- case "datatype":
- case "decreases":
- case "else":
- case "ensures":
- case "exists":
- case "false":
- case "forall":
- case "free":
- case "fresh":
- case "function":
- case "ghost":
- case "if":
- case "import":
- case "in":
- case "int":
- case "invariant":
- case "iterator":
- case "label":
- case "match":
- case "method":
- case "modifies":
- case "module":
- case "multiset":
- case "nat":
- case "new":
- case "null":
- case "object":
- case "old":
- case "opened":
- case "parallel":
- case "predicate":
- case "print":
- case "reads":
- case "refines":
- case "requires":
- case "result":
- case "return":
- case "returns":
- case "seq":
- case "set":
- case "static":
- case "then":
- case "this":
- case "true":
- case "type":
- case "var":
- case "while":
- case "yield":
- case "yields":
- #endregion
- break;
- default:
- continue; // it was an identifier
- }
- }
- }
-
- newRegions.Add(new DRegion(new SnapshotPoint(newSnapshot, line.Start + cur), new SnapshotPoint(newSnapshot, line.Start + end), ty));
- }
- OUTER_CONTINUE: ;
- }
-
- if (stillScanningLongComment) {
- newRegions.Add(new DRegion(commentStart, commentEndAsWeKnowIt, DafnyTokenKinds.Comment));
- }
-
- return newRegions;
- }
-
- private static bool ScanForEndOfComment(string txt, ref int end) {
- int N = txt.Length;
- for (; end < N; end++) {
- char ch = txt[end];
- if (ch == '*' && end + 1 < N) {
- ch = txt[end + 1];
- if (ch == '/') {
- end += 2;
- return true;
- }
- }
- }
- return false; // hit end-of-line without finding end-of-comment
- }
- }
-
- internal class DRegion
- {
- public SnapshotPoint Start { get; private set; }
- public SnapshotPoint End { get; private set; }
- public SnapshotSpan Span {
- get { return new SnapshotSpan(Start, End); }
- }
- public DafnyTokenKinds Kind { get; private set; }
-
- public DRegion(SnapshotPoint start, SnapshotPoint end, DafnyTokenKinds kind) {
- Start = start;
- End = end;
- Kind = kind;
- }
- }
-}
diff --git a/Util/VS2010/DafnyExtension/DafnyExtension/WordHighlighter.cs b/Util/VS2010/DafnyExtension/DafnyExtension/WordHighlighter.cs
deleted file mode 100644
index 03456c85..00000000
--- a/Util/VS2010/DafnyExtension/DafnyExtension/WordHighlighter.cs
+++ /dev/null
@@ -1,211 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.Composition;
-using System.Linq;
-using System.Threading;
-using System.Windows.Media;
-using Microsoft.VisualStudio.Text;
-using Microsoft.VisualStudio.Text.Classification;
-using Microsoft.VisualStudio.Text.Editor;
-using Microsoft.VisualStudio.Text.Operations;
-using Microsoft.VisualStudio.Text.Tagging;
-using Microsoft.VisualStudio.Utilities;
-
-namespace DafnyLanguage
-{
-#if LATER_MAYBE
- #region // (the current annoying) word highligher
- internal class HighlightWordTagger : ITagger<HighlightWordTag>
- {
- ITextView View { get; set; }
- ITextBuffer SourceBuffer { get; set; }
- ITextSearchService TextSearchService { get; set; }
- ITextStructureNavigator TextStructureNavigator { get; set; }
- NormalizedSnapshotSpanCollection WordSpans { get; set; }
- SnapshotSpan? CurrentWord { get; set; }
- SnapshotPoint RequestedPoint { get; set; }
- object updateLock = new object();
-
- public HighlightWordTagger(ITextView view, ITextBuffer sourceBuffer, ITextSearchService textSearchService,
- ITextStructureNavigator textStructureNavigator) {
- this.View = view;
- this.SourceBuffer = sourceBuffer;
- this.TextSearchService = textSearchService;
- this.TextStructureNavigator = textStructureNavigator;
- this.WordSpans = new NormalizedSnapshotSpanCollection();
- this.CurrentWord = null;
- this.View.Caret.PositionChanged += CaretPositionChanged;
- this.View.LayoutChanged += ViewLayoutChanged;
- }
-
- void ViewLayoutChanged(object sender, TextViewLayoutChangedEventArgs e) {
- // If a new snapshot wasn't generated, then skip this layout
- if (e.NewSnapshot != e.OldSnapshot) {
- UpdateAtCaretPosition(View.Caret.Position);
- }
- }
-
- void CaretPositionChanged(object sender, CaretPositionChangedEventArgs e) {
- UpdateAtCaretPosition(e.NewPosition);
- }
-
- public event EventHandler<SnapshotSpanEventArgs> TagsChanged;
-
- void UpdateAtCaretPosition(CaretPosition caretPosition) {
- SnapshotPoint? point = caretPosition.Point.GetPoint(SourceBuffer, caretPosition.Affinity);
-
- if (!point.HasValue)
- return;
-
- // If the new caret position is still within the current word (and on the same snapshot), we don't need to check it
- if (CurrentWord.HasValue
- && CurrentWord.Value.Snapshot == View.TextSnapshot
- && CurrentWord.Value.Start <= point.Value && point.Value <= CurrentWord.Value.End) {
- return;
- }
-
- RequestedPoint = point.Value;
- UpdateWordAdornments();
- }
-
- void UpdateWordAdornments() {
- SnapshotPoint currentRequest = RequestedPoint;
- List<SnapshotSpan> wordSpans = new List<SnapshotSpan>();
- //Find all words in the buffer like the one the caret is on
- TextExtent word = TextStructureNavigator.GetExtentOfWord(currentRequest);
- bool foundWord = true;
- //If we've selected something not worth highlighting, we might have missed a "word" by a little bit
- if (!WordExtentIsValid(currentRequest, word)) {
- //Before we retry, make sure it is worthwhile
- if (word.Span.Start != currentRequest
- || currentRequest == currentRequest.GetContainingLine().Start
- || char.IsWhiteSpace((currentRequest - 1).GetChar())) {
- foundWord = false;
- } else {
- // Try again, one character previous.
- //If the caret is at the end of a word, pick up the word.
- word = TextStructureNavigator.GetExtentOfWord(currentRequest - 1);
-
- //If the word still isn't valid, we're done
- if (!WordExtentIsValid(currentRequest, word))
- foundWord = false;
- }
- }
-
- if (!foundWord) {
- //If we couldn't find a word, clear out the existing markers
- SynchronousUpdate(currentRequest, new NormalizedSnapshotSpanCollection(), null);
- return;
- }
-
- SnapshotSpan currentWord = word.Span;
- //If this is the current word, and the caret moved within a word, we're done.
- if (CurrentWord.HasValue && currentWord == CurrentWord)
- return;
-
- //Find the new spans
- FindData findData = new FindData(currentWord.GetText(), currentWord.Snapshot);
- findData.FindOptions = FindOptions.WholeWord | FindOptions.MatchCase;
-
- wordSpans.AddRange(TextSearchService.FindAll(findData));
-
- //If another change hasn't happened, do a real update
- if (currentRequest == RequestedPoint)
- SynchronousUpdate(currentRequest, new NormalizedSnapshotSpanCollection(wordSpans), currentWord);
- }
-
- static bool WordExtentIsValid(SnapshotPoint currentRequest, TextExtent word) {
- return word.IsSignificant
- && currentRequest.Snapshot.GetText(word.Span).Any(c => char.IsLetter(c));
- }
-
- void SynchronousUpdate(SnapshotPoint currentRequest, NormalizedSnapshotSpanCollection newSpans, SnapshotSpan? newCurrentWord) {
- lock (updateLock) {
- if (currentRequest != RequestedPoint)
- return;
-
- WordSpans = newSpans;
- CurrentWord = newCurrentWord;
-
- var chngd = TagsChanged;
- if (chngd != null)
- chngd(this, new SnapshotSpanEventArgs(new SnapshotSpan(SourceBuffer.CurrentSnapshot, 0, SourceBuffer.CurrentSnapshot.Length)));
- }
- }
-
- public IEnumerable<ITagSpan<HighlightWordTag>> GetTags(NormalizedSnapshotSpanCollection spans) {
- if (CurrentWord == null)
- yield break;
-
- // Hold on to a "snapshot" of the word spans and current word, so that we maintain the same
- // collection throughout
- SnapshotSpan currentWord = CurrentWord.Value;
- NormalizedSnapshotSpanCollection wordSpans = WordSpans;
-
- if (spans.Count == 0 || WordSpans.Count == 0)
- yield break;
-
- // If the requested snapshot isn't the same as the one our words are on, translate our spans to the expected snapshot
- if (spans[0].Snapshot != wordSpans[0].Snapshot) {
- wordSpans = new NormalizedSnapshotSpanCollection(
- wordSpans.Select(span => span.TranslateTo(spans[0].Snapshot, SpanTrackingMode.EdgeExclusive)));
-
- currentWord = currentWord.TranslateTo(spans[0].Snapshot, SpanTrackingMode.EdgeExclusive);
- }
-
- // First, yield back the word the cursor is under (if it overlaps)
- // Note that we'll yield back the same word again in the wordspans collection;
- // the duplication here is expected.
- if (spans.OverlapsWith(new NormalizedSnapshotSpanCollection(currentWord)))
- yield return new TagSpan<HighlightWordTag>(currentWord, new HighlightWordTag());
-
- // Second, yield all the other words in the file
- foreach (SnapshotSpan span in NormalizedSnapshotSpanCollection.Overlap(spans, wordSpans)) {
- yield return new TagSpan<HighlightWordTag>(span, new HighlightWordTag());
- }
- }
- }
-
- internal class HighlightWordTag : TextMarkerTag
- {
- public HighlightWordTag() : base("MarkerFormatDefinition/HighlightWordFormatDefinition") { }
- }
-
- [Export(typeof(EditorFormatDefinition))]
- [Name("MarkerFormatDefinition/HighlightWordFormatDefinition")]
- [UserVisible(true)]
- internal class HighlightWordFormatDefinition : MarkerFormatDefinition
- {
- public HighlightWordFormatDefinition() {
- this.BackgroundColor = Colors.LightBlue;
- this.ForegroundColor = Colors.DarkBlue;
- this.DisplayName = "Highlight Word";
- this.ZOrder = 5;
- }
- }
-
- [Export(typeof(IViewTaggerProvider))]
- [ContentType("text")]
- [TagType(typeof(TextMarkerTag))]
- internal class HighlightWordTaggerProvider : IViewTaggerProvider
- {
- [Import]
- internal ITextSearchService TextSearchService { get; set; }
-
- [Import]
- internal ITextStructureNavigatorSelectorService TextStructureNavigatorSelector { get; set; }
-
- public ITagger<T> CreateTagger<T>(ITextView textView, ITextBuffer buffer) where T : ITag {
- //provide highlighting only on the top buffer
- if (textView.TextBuffer != buffer)
- return null;
-
- ITextStructureNavigator textStructureNavigator =
- TextStructureNavigatorSelector.GetTextStructureNavigator(buffer);
-
- return new HighlightWordTagger(textView, buffer, TextSearchService, textStructureNavigator) as ITagger<T>;
- }
- }
-#endregion
-#endif
-}
diff --git a/Util/VS2010/DafnyExtension/DafnyExtension/source.extension.vsixmanifest b/Util/VS2010/DafnyExtension/DafnyExtension/source.extension.vsixmanifest
deleted file mode 100644
index ef5c1cf5..00000000
--- a/Util/VS2010/DafnyExtension/DafnyExtension/source.extension.vsixmanifest
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010">
- <Identifier Id="DafnyLanguageMode.Microsoft.6c7ed99a-206a-4937-9e08-b389de175f68">
- <Name>DafnyLanguageMode</Name>
- <Author>Microsoft Research</Author>
- <Version>1.0</Version>
- <Description xml:space="preserve">This is a language mode for using the Dafny language inside Visual Studio.</Description>
- <Locale>1033</Locale>
- <SupportedProducts>
- <VisualStudio Version="10.0">
- <Edition>Pro</Edition>
- </VisualStudio>
- <VisualStudio Version="11.0">
- <Edition>Pro</Edition>
- </VisualStudio>
- </SupportedProducts>
- <SupportedFrameworkRuntimeEdition MinVersion="4.0" MaxVersion="4.0" />
- </Identifier>
- <References />
- <Content>
- <MefComponent>|%CurrentProject%|</MefComponent>
- <CustomExtension Type="Boogie">DafnyPrelude.bpl</CustomExtension>
- <CustomExtension Type="SMTLib 2">UnivBackPred2.smt2</CustomExtension>
- </Content>
-</Vsix>