Skip to content

Commit ddddd97

Browse files
committed
(C# 3) Add the Antlr3.Runtime.Visualizer project
[git-p4: depot-paths = "//depot/code/antlrcs/main/": change = 8936]
1 parent b57ee4c commit ddddd97

20 files changed

+1888
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>8.0.30703</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{2F59DA1C-A502-440C-ABE8-240BDE2D0664}</ProjectGuid>
9+
<OutputType>library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>Antlr3.Runtime.Visualizer</RootNamespace>
12+
<AssemblyName>Antlr3.Runtime.Visualizer</AssemblyName>
13+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
14+
<FileAlignment>512</FileAlignment>
15+
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
16+
<WarningLevel>4</WarningLevel>
17+
<SccProjectName>SAK</SccProjectName>
18+
<SccLocalPath>SAK</SccLocalPath>
19+
<SccAuxPath>SAK</SccAuxPath>
20+
<SccProvider>SAK</SccProvider>
21+
</PropertyGroup>
22+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
23+
<DebugSymbols>true</DebugSymbols>
24+
<DebugType>full</DebugType>
25+
<Optimize>false</Optimize>
26+
<OutputPath>bin\Debug\</OutputPath>
27+
<DefineConstants>DEBUG;TRACE</DefineConstants>
28+
<ErrorReport>prompt</ErrorReport>
29+
<WarningLevel>4</WarningLevel>
30+
</PropertyGroup>
31+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
32+
<DebugType>pdbonly</DebugType>
33+
<Optimize>true</Optimize>
34+
<OutputPath>bin\Release\</OutputPath>
35+
<DefineConstants>TRACE</DefineConstants>
36+
<ErrorReport>prompt</ErrorReport>
37+
<WarningLevel>4</WarningLevel>
38+
</PropertyGroup>
39+
<PropertyGroup>
40+
<SignAssembly>true</SignAssembly>
41+
</PropertyGroup>
42+
<PropertyGroup>
43+
<AssemblyOriginatorKeyFile>..\..\..\..\keys\antlr\Key.snk</AssemblyOriginatorKeyFile>
44+
</PropertyGroup>
45+
<ItemGroup>
46+
<Reference Include="System" />
47+
<Reference Include="System.Data" />
48+
<Reference Include="System.Drawing" />
49+
<Reference Include="System.Windows.Forms" />
50+
<Reference Include="System.Xml" />
51+
<Reference Include="System.Core" />
52+
<Reference Include="System.Xml.Linq" />
53+
<Reference Include="System.Data.DataSetExtensions" />
54+
<Reference Include="WindowsBase" />
55+
<Reference Include="PresentationCore" />
56+
<Reference Include="PresentationFramework" />
57+
<Reference Include="WindowsFormsIntegration" />
58+
</ItemGroup>
59+
<ItemGroup>
60+
<Compile Include="..\Antlr4.StringTemplate.Visualizer\Extensions\FlowDocumentExtensions.cs">
61+
<Link>Extensions\FlowDocumentExtensions.cs</Link>
62+
</Compile>
63+
<Compile Include="Interval.cs" />
64+
<Compile Include="RuntimeVisualizerExtensions.cs" />
65+
<Compile Include="TreeViewModel.cs" />
66+
<Compile Include="BaseTreeVisualizerForm.cs">
67+
<SubType>Form</SubType>
68+
</Compile>
69+
<Compile Include="BaseTreeVisualizerForm.Designer.cs">
70+
<DependentUpon>BaseTreeVisualizerForm.cs</DependentUpon>
71+
</Compile>
72+
<Compile Include="BaseTreeVisualizerViewControl.xaml.cs">
73+
<DependentUpon>BaseTreeVisualizerViewControl.xaml</DependentUpon>
74+
</Compile>
75+
<Compile Include="Properties\AssemblyInfo.cs">
76+
<SubType>Code</SubType>
77+
</Compile>
78+
<Compile Include="Properties\Resources.Designer.cs">
79+
<AutoGen>True</AutoGen>
80+
<DesignTime>True</DesignTime>
81+
<DependentUpon>Resources.resx</DependentUpon>
82+
</Compile>
83+
<Compile Include="Properties\Settings.Designer.cs">
84+
<AutoGen>True</AutoGen>
85+
<DependentUpon>Settings.settings</DependentUpon>
86+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
87+
</Compile>
88+
<Compile Include="TokenStreamVisualizerForm.cs">
89+
<SubType>Form</SubType>
90+
</Compile>
91+
<Compile Include="TokenStreamVisualizerForm.Designer.cs">
92+
<DependentUpon>TokenStreamVisualizerForm.cs</DependentUpon>
93+
</Compile>
94+
<Compile Include="TreeVisualizerViewModel.cs" />
95+
<EmbeddedResource Include="BaseTreeVisualizerForm.resx">
96+
<DependentUpon>BaseTreeVisualizerForm.cs</DependentUpon>
97+
</EmbeddedResource>
98+
<EmbeddedResource Include="Properties\Resources.resx">
99+
<Generator>ResXFileCodeGenerator</Generator>
100+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
101+
</EmbeddedResource>
102+
<EmbeddedResource Include="TokenStreamVisualizerForm.resx">
103+
<DependentUpon>TokenStreamVisualizerForm.cs</DependentUpon>
104+
</EmbeddedResource>
105+
<None Include="Properties\Settings.settings">
106+
<Generator>SettingsSingleFileGenerator</Generator>
107+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
108+
</None>
109+
<AppDesigner Include="Properties\" />
110+
</ItemGroup>
111+
<ItemGroup>
112+
<Page Include="BaseTreeVisualizerViewControl.xaml">
113+
<Generator>MSBuild:Compile</Generator>
114+
<SubType>Designer</SubType>
115+
</Page>
116+
</ItemGroup>
117+
<ItemGroup>
118+
<ProjectReference Include="..\..\..\antlr\antlr3-main\runtime\CSharp3\Sources\Antlr3.Runtime\Antlr3.Runtime.csproj">
119+
<Project>{8FDC0A87-9005-4D5A-AB75-E55CEB575559}</Project>
120+
<Name>Antlr3.Runtime</Name>
121+
</ProjectReference>
122+
</ItemGroup>
123+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
124+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
125+
Other similar extension points exist, see Microsoft.Common.targets.
126+
<Target Name="BeforeBuild">
127+
</Target>
128+
<Target Name="AfterBuild">
129+
</Target>
130+
-->
131+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
""
2+
{
3+
"FILE_VERSION" = "9237"
4+
"ENLISTMENT_CHOICE" = "NEVER"
5+
"PROJECT_FILE_RELATIVE_PATH" = ""
6+
"NUMBER_OF_EXCLUDED_FILES" = "0"
7+
"ORIGINAL_PROJECT_FILE_PATH" = ""
8+
"NUMBER_OF_NESTED_PROJECTS" = "0"
9+
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10+
}

Antlr3.Runtime.Visualizer/BaseTreeVisualizerForm.Designer.cs

+99
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*
2+
* [The "BSD license"]
3+
* Copyright (c) 2011 Terence Parr
4+
* All rights reserved.
5+
*
6+
* Conversion to C#:
7+
* Copyright (c) 2011 Sam Harwell, Tunnel Vision Laboratories, LLC
8+
* All rights reserved.
9+
*
10+
* Redistribution and use in source and binary forms, with or without
11+
* modification, are permitted provided that the following conditions
12+
* are met:
13+
* 1. Redistributions of source code must retain the above copyright
14+
* notice, this list of conditions and the following disclaimer.
15+
* 2. Redistributions in binary form must reproduce the above copyright
16+
* notice, this list of conditions and the following disclaimer in the
17+
* documentation and/or other materials provided with the distribution.
18+
* 3. The name of the author may not be used to endorse or promote products
19+
* derived from this software without specific prior written permission.
20+
*
21+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23+
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24+
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26+
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30+
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+
*/
32+
33+
namespace Antlr3.Runtime.Visualizer
34+
{
35+
using ArgumentNullException = System.ArgumentNullException;
36+
using EventArgs = System.EventArgs;
37+
using Form = System.Windows.Forms.Form;
38+
using ITokenStream = Antlr.Runtime.ITokenStream;
39+
using ITreeAdaptor = Antlr.Runtime.Tree.ITreeAdaptor;
40+
41+
public partial class BaseTreeVisualizerForm : Form
42+
{
43+
public BaseTreeVisualizerForm(ITreeAdaptor adaptor, object tree)
44+
: this(adaptor, tree, null, null)
45+
{
46+
}
47+
48+
public BaseTreeVisualizerForm(ITreeAdaptor adaptor, object tree, ITokenStream tokenStream)
49+
: this(adaptor, tree, tokenStream, null)
50+
{
51+
}
52+
53+
public BaseTreeVisualizerForm(ITreeAdaptor adaptor, object tree, string sourceText)
54+
: this(adaptor, tree, null, sourceText)
55+
{
56+
}
57+
58+
public BaseTreeVisualizerForm(ITreeAdaptor adaptor, object tree, ITokenStream tokenStream, string sourceText)
59+
{
60+
if (adaptor == null)
61+
throw new ArgumentNullException("adaptor");
62+
if (tree == null)
63+
throw new ArgumentNullException("tree");
64+
65+
InitializeComponent();
66+
67+
TreeVisualizerViewModel viewModel = new TreeVisualizerViewModel(adaptor, tree, tokenStream, sourceText);
68+
((BaseTreeVisualizerViewControl)elementHost1.Child).ViewModel = viewModel;
69+
}
70+
71+
private void closeToolStripMenuItem_Click(object sender, EventArgs e)
72+
{
73+
Close();
74+
}
75+
}
76+
}

0 commit comments

Comments
 (0)