Skip to content

Commit 512067e

Browse files
VladD2VladD2
authored andcommitted
Added Test DSL
1 parent b95822a commit 512067e

File tree

19 files changed

+473
-12
lines changed

19 files changed

+473
-12
lines changed

Grammars/CSharp/CSharp.Grammar/CSharp.Grammar.nproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@
145145
<Folder Include="CSharp\CS5" />
146146
<Folder Include="CSharp\CS6" />
147147
<Folder Include="CSharp\CS7" />
148-
<Folder Include="NewFolder1\" />
149148
<Folder Include="Preprocessor\" />
150149
<Folder Include="Properties\" />
151150
</ItemGroup>

Grammars/CSharp/CSharp.Grammar/CSharp/AST/ExprExtensions.n

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,6 @@ namespace DotNet
4343
}
4444
}
4545

46-
public GetParameterType(this parameterScope : TableScope, parameterIndex : int) : TypeSymbol
47-
{
48-
def parm = parameterScope
49-
.Symbols
50-
.SelectMany(s => s)
51-
.OfType.[FormalParameterSymbol]()
52-
.FirstOrDefault(s => s.Index == parameterIndex :> (uint));
53-
54-
parm.Type
55-
}
56-
5746
public IsBinaryOpCompatible(this expr : BinaryExpr, left : TypeSymbol, right : TypeSymbol, context : DependentPropertyEvalContext) : bool
5847
{
5948
if (left.IsNumeric(context) && right.IsNumeric(context)) true

Grammars/DSLs/TDL/Ast.nitra

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
namespace Tdl
2+
{
3+
}

Grammars/DSLs/TDL/Grammar.nitra

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
namespace Tdl
2+
{
3+
syntax module Grammar2
4+
{
5+
using Nitra.Core;
6+
using CSharp.CsIdentifiers;
7+
using CSharp.Literals;
8+
using CSharp.TokenNames;
9+
10+
alias QualifiedName = QualifiedIdentifier;
11+
12+
[StartRule]
13+
syntax CompilationUnit = NamespaceMemberDeclaration*;
14+
15+
syntax StringLiteral
16+
{
17+
| RegularStringLiteral;
18+
| VerbatimStringLiteral;
19+
}
20+
21+
syntax NamespaceMemberDeclaration
22+
{
23+
| Alias = "using" sm Name sm "=" sm QualifiedName ";" nl;
24+
| Open = "using" sm QualifiedName ";" nl;
25+
| Platform = "platform" sm Name ";" nl;
26+
| PlatformSet = "platform" sm Name sm "=" Platforms=(Reference; "," sm)+ ";" nl;
27+
| Product = "product" sm Name nl ProductBody;
28+
}
29+
30+
syntax ProductBody = outline_begin_before "{" inl ProductPropertyDeclaration* d "}" nl outline_end_before;
31+
32+
syntax ProductPropertyDeclaration
33+
{
34+
| AutotestBinariesExcludedFilesMasks = Name sm "=" sm StringLiteral ";" nl;
35+
}
36+
}
37+
}

Grammars/DSLs/TDL/Language.nitra

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
language TdlLang : DotNetLang
2+
{
3+
span class StringEx { ForegroundColor=Maroon; }
4+
5+
extension = .tdl;
6+
7+
company = NitraTeam;
8+
description = Nitra driven Tdl plugin for Visual Studio;
9+
authors = Vlad Chistyakov;
10+
copyright = NitraTeam;
11+
12+
syntax module Tdl.Grammar2 start rule CompilationUnit;
13+
}

Grammars/DSLs/TDL/Tdl.nproj

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
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>{82c32d2d-8e24-4975-b606-b2c7be54c340}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>Tdl</RootNamespace>
12+
<AssemblyName>Tdl</AssemblyName>
13+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
14+
<FileAlignment>512</FileAlignment>
15+
<NoStdLib>true</NoStdLib>
16+
<NemerleVersion>Net-4.0</NemerleVersion>
17+
<NemerleBinPathRoot Condition=" '$(NemerleBinPathRoot)' == '' ">$(ProgramFiles)\Nemerle</NemerleBinPathRoot>
18+
<Nemerle Condition=" '$(Nemerle)' == '' ">$(NemerleBinPathRoot)\$(NemerleVersion)</Nemerle>
19+
<Name>Tdl</Name>
20+
<DocumentationFile />
21+
<SignAssembly>True</SignAssembly>
22+
<AssemblyOriginatorKeyFile>..\..\..\Common\Nitra.snk</AssemblyOriginatorKeyFile>
23+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\</SolutionDir>
24+
<RestorePackages>true</RestorePackages>
25+
<!--CustomArguments>-debugger</CustomArguments-->
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
28+
<DebugSymbols>true</DebugSymbols>
29+
<Optimize>false</Optimize>
30+
<OutputPath>..\..\Bin\Debug\</OutputPath>
31+
<DefineConstants>DEBUG;TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
<RunDebugger>false</RunDebugger>
35+
</PropertyGroup>
36+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
37+
<DebugSymbols>false</DebugSymbols>
38+
<Optimize>true</Optimize>
39+
<OutputPath>..\..\Bin\Release\</OutputPath>
40+
<DefineConstants>TRACE</DefineConstants>
41+
<ErrorReport>prompt</ErrorReport>
42+
<WarningLevel>4</WarningLevel>
43+
<DocumentationFile>bin\Release\Tdl.xml</DocumentationFile>
44+
</PropertyGroup>
45+
<ItemGroup>
46+
<Reference Include="mscorlib" />
47+
<Reference Include="System" />
48+
<Reference Include="System.Core">
49+
<RequiredTargetFramework>3.5</RequiredTargetFramework>
50+
</Reference>
51+
<Reference Include="System.Xml" />
52+
<Reference Include="Nemerle">
53+
<SpecificVersion>False</SpecificVersion>
54+
<HintPath>$(Nemerle)\Nemerle.dll</HintPath>
55+
<Private>True</Private>
56+
</Reference>
57+
<Reference Include="Nemerle.Peg">
58+
<HintPath>$(Nemerle)\Nemerle.Peg.dll</HintPath>
59+
<SpecificVersion>False</SpecificVersion>
60+
<Private>True</Private>
61+
</Reference>
62+
<MacroReference Include="Nemerle.Peg.Macros">
63+
<HintPath>$(Nemerle)\Nemerle.Peg.Macros.dll</HintPath>
64+
</MacroReference>
65+
</ItemGroup>
66+
<ItemGroup>
67+
<MacroProjectReference Include="..\..\..\Nitra\Nitra.Compiler\Nitra.Compiler.nproj">
68+
<Name>Nitra.Compiler</Name>
69+
<Project>{a8aaca46-ccc8-429f-b626-4cfc77f3a21a}</Project>
70+
<Private>False</Private>
71+
</MacroProjectReference>
72+
<ProjectReference Include="..\..\..\DotNet.BackEnd.CCI\DotNet.BackEnd.CCI.nproj">
73+
<Name>DotNet.BackEnd.CCI</Name>
74+
<Project>{9bc9b613-47f1-443c-8205-ac3cfabe7db9}</Project>
75+
<Private>True</Private>
76+
</ProjectReference>
77+
<ProjectReference Include="..\..\..\Nitra\DotNetLang\DotNetLang.nproj">
78+
<Name>DotNetLang</Name>
79+
<Project>{d3c87d75-e119-4d30-a8be-dc28014bb653}</Project>
80+
<Private>True</Private>
81+
</ProjectReference>
82+
<ProjectReference Include="..\..\..\Nitra\Nitra.Runtime\Nitra.Runtime.nproj">
83+
<Name>Nitra.Runtime</Name>
84+
<Project>{9db13eb2-28e3-432b-8c8f-0e39ef5bcc38}</Project>
85+
<Private>True</Private>
86+
</ProjectReference>
87+
<ProjectReference Include="..\..\..\System.Collections.Immutable.Light\System.Collections.Immutable.Light.csproj">
88+
<Name>System.Collections.Immutable.Light</Name>
89+
<Project>{46f78a78-93ff-4e51-b221-8e5fffe8806d}</Project>
90+
<Private>True</Private>
91+
</ProjectReference>
92+
<ProjectReference Include="..\..\CSharp\CSharp.Grammar\CSharp.Grammar.nproj">
93+
<Name>CSharp.Grammar</Name>
94+
<Project>{249928bb-c446-42b3-bff3-ca98dabb9609}</Project>
95+
<Private>True</Private>
96+
</ProjectReference>
97+
</ItemGroup>
98+
<ItemGroup>
99+
<Compile Include="Grammar.nitra">
100+
</Compile>
101+
<Compile Include="Ast.nitra">
102+
</Compile>
103+
<Compile Include="Language.nitra">
104+
</Compile>
105+
</ItemGroup>
106+
<ItemGroup>
107+
<Folder Include="Properties" />
108+
<Folder Include="Properties" />
109+
</ItemGroup>
110+
<Import Project="$(Nemerle)\Nemerle.MSBuild.targets" />
111+
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
112+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
113+
<PropertyGroup>
114+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
115+
</PropertyGroup>
116+
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
117+
</Target>
118+
<!--
119+
To modify your build process, add your task inside one of the targets below and uncomment it.
120+
Other similar extension points exist, see Microsoft.Common.targets.
121+
122+
<Target Name="BeforeBuild">
123+
</Target>
124+
<Target Name="AfterBuild">
125+
</Target>
126+
-->
127+
</Project>

Nitra-Stagt1.sln

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfHint2", "Ide\WpfHint\Wpf
149149
EndProject
150150
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Collections.Immutable.Light", "System.Collections.Immutable.Light\System.Collections.Immutable.Light.csproj", "{46F78A78-93FF-4E51-B221-8E5FFFE8806D}"
151151
EndProject
152+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TDL", "TDL", "{33627B59-C95F-4B55-B764-9546F58D07DB}"
153+
EndProject
154+
Project("{EDCC3B85-0BAD-11DB-BC1A-00112FDE8B61}") = "Tdl", "Grammars\DSLs\TDL\Tdl.nproj", "{82C32D2D-8E24-4975-B606-B2C7BE54C340}"
155+
EndProject
152156
Global
153157
GlobalSection(SolutionConfigurationPlatforms) = preSolution
154158
Debug|Any CPU = Debug|Any CPU
@@ -613,6 +617,18 @@ Global
613617
{46F78A78-93FF-4E51-B221-8E5FFFE8806D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
614618
{46F78A78-93FF-4E51-B221-8E5FFFE8806D}.Release|x86.ActiveCfg = Release|Any CPU
615619
{46F78A78-93FF-4E51-B221-8E5FFFE8806D}.Release|x86.Build.0 = Release|Any CPU
620+
{82C32D2D-8E24-4975-B606-B2C7BE54C340}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
621+
{82C32D2D-8E24-4975-B606-B2C7BE54C340}.Debug|Any CPU.Build.0 = Debug|Any CPU
622+
{82C32D2D-8E24-4975-B606-B2C7BE54C340}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
623+
{82C32D2D-8E24-4975-B606-B2C7BE54C340}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
624+
{82C32D2D-8E24-4975-B606-B2C7BE54C340}.Debug|x86.ActiveCfg = Debug|Any CPU
625+
{82C32D2D-8E24-4975-B606-B2C7BE54C340}.Debug|x86.Build.0 = Debug|Any CPU
626+
{82C32D2D-8E24-4975-B606-B2C7BE54C340}.Release|Any CPU.ActiveCfg = Release|Any CPU
627+
{82C32D2D-8E24-4975-B606-B2C7BE54C340}.Release|Any CPU.Build.0 = Release|Any CPU
628+
{82C32D2D-8E24-4975-B606-B2C7BE54C340}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
629+
{82C32D2D-8E24-4975-B606-B2C7BE54C340}.Release|Mixed Platforms.Build.0 = Release|Any CPU
630+
{82C32D2D-8E24-4975-B606-B2C7BE54C340}.Release|x86.ActiveCfg = Release|Any CPU
631+
{82C32D2D-8E24-4975-B606-B2C7BE54C340}.Release|x86.Build.0 = Release|Any CPU
616632
EndGlobalSection
617633
GlobalSection(SolutionProperties) = preSolution
618634
HideSolutionNode = FALSE
@@ -676,6 +692,8 @@ Global
676692
{24B5A712-B856-4D0A-B367-222CE38C67C6} = {6D240FCF-6798-4564-A378-1E6D30B0C09B}
677693
{7670DE22-B023-4783-BA19-BB2DB50E1762} = {6D240FCF-6798-4564-A378-1E6D30B0C09B}
678694
{46F78A78-93FF-4E51-B221-8E5FFFE8806D} = {622651DB-031F-4575-B69F-BB5F8C6819D6}
695+
{33627B59-C95F-4B55-B764-9546F58D07DB} = {7D5AFEDC-E05B-40CE-B222-107C48EC4187}
696+
{82C32D2D-8E24-4975-B606-B2C7BE54C340} = {33627B59-C95F-4B55-B764-9546F58D07DB}
679697
EndGlobalSection
680698
GlobalSection(ExtensibilityGlobals) = postSolution
681699
SolutionGuid = {AAE3BE84-D911-45BB-BDEE-88ED44B9379D}

Tests/Visualizer/Tdl.nsln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Tdl

Tests/Visualizer/Tdl/config.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-16"?>
2+
<Config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
3+
<ProjectSupport Caption="" TypeFullName="" Path="" />
4+
<Languages>
5+
<Language Name="TdlLang" Path="..\..\..\Grammars\Bin\Debug\Tdl.dll">
6+
<DynamicExtensions />
7+
</Language>
8+
</Languages>
9+
<References>
10+
<Reference>FullName:mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Reference>
11+
<Reference>FullName:System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Reference>
12+
<Reference>FullName:System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Reference>
13+
</References>
14+
</Config>

Tests/Visualizer/Tdl/test-0000/test-0000/test-0000.gold

Whitespace-only changes.

0 commit comments

Comments
 (0)