Yeoman generator for the default project structure

See https://yeoman.io.
This commit is contained in:
Alex Polozov 2017-01-13 18:48:49 -08:00
Коммит 7c8643d6de
21 изменённых файлов: 985 добавлений и 0 удалений

11
.editorconfig Normal file
Просмотреть файл

@ -0,0 +1,11 @@
root = true
[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

3
.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1,3 @@
node_modules
coverage
.idea

21
LICENSE Normal file
Просмотреть файл

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2017 Alex Polozov <prose-contact@microsoft.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

23
README.md Normal file
Просмотреть файл

@ -0,0 +1,23 @@
# generator-prose
> Generator for a Microsoft PROSE domain-specific language which is amenable for automatic synthesis.
## Installation
First, install [Yeoman](http://yeoman.io) and `generator-prose` using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)).
```bash
npm install -g yo
npm install -g generator-prose
```
Then generate your new DSL:
```bash
yo prose
```
## License
Generator: MIT © [Microsoft PROSE](https://microsoft.github.io/prose)
PROSE framework: [Free for non-commercial use](https://prose-playground.cloudapp.net/data/SDKLicense.pdf)

142
generators/app/index.js Normal file
Просмотреть файл

@ -0,0 +1,142 @@
'use strict';
var Generator = require('yeoman-generator');
var chalk = require('chalk');
var yosay = require('yosay');
var path = require('path');
module.exports = Generator.extend({
prompting: function () {
// Have Yeoman greet the user.
this.log(yosay(
'Welcome to the ' + chalk.red('generator-prose') + ' generator!'
));
var prompts = [
{
type: 'input',
name: 'name',
message: 'Your grammar name'
},
{
type: 'input',
name: 'semantics',
message: 'The name of the library with operator implementations',
default: 'Semantics',
store: true
},
{
type: 'input',
name: 'learning',
message: 'The name of the library with learning helpers',
default: 'Learning',
store: true
},
{
type: 'input',
name: 'scoreFeature',
message: 'The name of the program feature that is used for ranking',
default: 'Score',
store: true
},
{
type: 'input',
name: 'scoreHolder',
message: 'The class that implements ranking functions',
default: 'RankingScore',
store: true
},
{
type: 'confirm',
name: 'buildGrammar',
message: 'Would you like to build your grammar DLL automatically and reference it in the project?',
store: true
}
];
return this.prompt(prompts).then(function (props) {
this.props = props;
}.bind(this));
},
writing: function () {
this.fs.copyTpl(
this.templatePath('solution/Solution.sln'),
this.destinationPath(path.join(this.props.name, this.props.name + '.sln')),
this.props
);
this.fs.copyTpl(
this.templatePath('solution/app/App.csproj'),
this.destinationPath(path.join(this.props.name, this.props.name, this.props.name + '.csproj')),
this.props
);
this.fs.copyTpl(
this.templatePath('solution/app/Grammar.grammar'),
this.destinationPath(path.join(this.props.name, this.props.name, this.props.name + '.grammar')),
this.props
);
const semanticsNamespace = this.props.name + '.' + this.props.semantics;
this.fs.copyTpl(
this.templatePath('solution/semantics/Semantics.csproj'),
this.destinationPath(path.join(this.props.name, semanticsNamespace, semanticsNamespace + '.csproj')),
this.props
);
const learningNamespace = this.props.name + '.' + this.props.learning;
this.fs.copyTpl(
this.templatePath('solution/learning/Learning.csproj'),
this.destinationPath(path.join(this.props.name, learningNamespace, learningNamespace + '.csproj')),
this.props
);
this.fs.copyTpl(
this.templatePath('solution/learning/RankingScore.cs'),
this.destinationPath(path.join(this.props.name, learningNamespace, this.props.scoreHolder + '.cs')),
this.props
);
this.fs.copyTpl(
this.templatePath('solution/app/Program.cs'),
this.destinationPath(path.join(this.props.name, this.props.name, 'Program.cs')),
this.props
);
this.fs.copyTpl(
this.templatePath('solution/app/Properties/AssemblyInfo.cs'),
this.destinationPath(path.join(this.props.name, this.props.name, 'Properties', 'AssemblyInfo.cs')),
this.props
);
this.fs.copyTpl(
this.templatePath('solution/semantics/Semantics.cs'),
this.destinationPath(path.join(this.props.name, semanticsNamespace, this.props.semantics + '.cs')),
this.props
);
this.fs.copyTpl(
this.templatePath('solution/semantics/Properties/AssemblyInfo.cs'),
this.destinationPath(path.join(this.props.name, semanticsNamespace, 'Properties', 'AssemblyInfo.cs')),
this.props
);
this.fs.copyTpl(
this.templatePath('solution/learning/Witnesses.cs'),
this.destinationPath(path.join(this.props.name, learningNamespace, 'Witnesses.cs')),
this.props
);
this.fs.copyTpl(
this.templatePath('solution/learning/Properties/AssemblyInfo.cs'),
this.destinationPath(path.join(this.props.name, learningNamespace, 'Properties', 'AssemblyInfo.cs')),
this.props
);
this.fs.copyTpl(
this.templatePath('solution/app/packages.config'),
this.destinationPath(path.join(this.props.name, this.props.name, 'packages.config')),
this.props
);
this.fs.copyTpl(
this.templatePath('solution/learning/packages.config'),
this.destinationPath(path.join(this.props.name, learningNamespace, 'packages.config')),
this.props
);
},
install: function () {
//this.installDependencies();
}
});

Просмотреть файл

@ -0,0 +1,29 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "<%= name %>", "<%= name %>\<%= name %>.csproj", "{EFBD1A76-0A93-4CE8-8579-A0E6C078E341}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "<%= name %>.<%= semantics %>", "<%= name %>.<%= semantics %>\<%= name %>.<%= semantics %>.csproj", "{600FE72C-744A-4D82-B0BC-C0F310AB6155}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "<%= name %>.<%= learning %>", "<%= name %>.<%= learning %>\<%= name %>.<%= learning %>.csproj", "{313D3DED-2469-43D2-83E1-E9FE53C2625C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EFBD1A76-0A93-4CE8-8579-A0E6C078E341}.Debug|x86.ActiveCfg = Debug|x86
{EFBD1A76-0A93-4CE8-8579-A0E6C078E341}.Debug|x86.Build.0 = Debug|x86
{EFBD1A76-0A93-4CE8-8579-A0E6C078E341}.Release|x86.ActiveCfg = Release|x86
{EFBD1A76-0A93-4CE8-8579-A0E6C078E341}.Release|x86.Build.0 = Release|x86
{600FE72C-744A-4D82-B0BC-C0F310AB6155}.Debug|x86.ActiveCfg = Debug|Any CPU
{600FE72C-744A-4D82-B0BC-C0F310AB6155}.Debug|x86.Build.0 = Debug|Any CPU
{600FE72C-744A-4D82-B0BC-C0F310AB6155}.Release|x86.ActiveCfg = Release|Any CPU
{600FE72C-744A-4D82-B0BC-C0F310AB6155}.Release|x86.Build.0 = Release|Any CPU
{313D3DED-2469-43D2-83E1-E9FE53C2625C}.Debug|x86.ActiveCfg = Debug|Any CPU
{313D3DED-2469-43D2-83E1-E9FE53C2625C}.Debug|x86.Build.0 = Debug|Any CPU
{313D3DED-2469-43D2-83E1-E9FE53C2625C}.Release|x86.ActiveCfg = Release|Any CPU
{313D3DED-2469-43D2-83E1-E9FE53C2625C}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,225 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{EFBD1A76-0A93-4CE8-8579-A0E6C078E341}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace><%= name %></RootNamespace>
<AssemblyName><%= name %></AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ExternalConsole>true</ExternalConsole>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ExternalConsole>true</ExternalConsole>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="Antlr4.Runtime">
<HintPath>..\packages\Antlr4.Runtime.4.5.3\lib\net45\Antlr4.Runtime.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System.Collections.Immutable">
<HintPath>..\packages\System.Collections.Immutable.1.2.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
</Reference>
<Reference Include="System.Interactive">
<HintPath>..\packages\System.Interactive.3.0.0\lib\net45\System.Interactive.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Reflection.Metadata">
<HintPath>..\packages\System.Reflection.Metadata.1.3.0\lib\portable-net45+win8\System.Reflection.Metadata.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CodeAnalysis">
<HintPath>..\packages\Microsoft.CodeAnalysis.Common.1.3.0\lib\net45\Microsoft.CodeAnalysis.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CodeAnalysis.CSharp">
<HintPath>..\packages\Microsoft.CodeAnalysis.CSharp.1.3.0\lib\net45\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Compiler">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Compiler.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Compound.Extraction.Field">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Compound.Extraction.Field.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Compound.Split">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Compound.Split.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Conditionals">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Conditionals.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Conditionals.Language">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Conditionals.Language.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Conditionals.Learning">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Conditionals.Learning.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Conditionals.Semantics">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Conditionals.Semantics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.CoreFxLab">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.CoreFxLab.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Extraction.Json">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Extraction.Json.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Extraction.Json.Language">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Extraction.Json.Language.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Extraction.Json.Learning">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Extraction.Json.Learning.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Extraction.Json.Semantics">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Extraction.Json.Semantics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Extraction.Json.Translation.Python">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Extraction.Json.Translation.Python.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Extraction.Text">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Extraction.Text.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Extraction.Text.Language">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Extraction.Text.Language.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Extraction.Text.Learning">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Extraction.Text.Learning.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Extraction.Text.Semantics">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Extraction.Text.Semantics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Learning">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Learning.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Matching.Text">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Matching.Text.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Matching.Text.Language">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Matching.Text.Language.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Matching.Text.Learning">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Matching.Text.Learning.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Matching.Text.Semantics">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Matching.Text.Semantics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Matching.Text.Translation.Python">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Matching.Text.Translation.Python.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Paraphrasing">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Paraphrasing.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Split.File">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Split.File.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Split.File.Language">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Split.File.Language.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Split.File.Learning">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Split.File.Learning.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Split.File.Semantics">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Split.File.Semantics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Split.Text">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Split.Text.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Split.Text.Language">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Split.Text.Language.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Split.Text.Learning">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Split.Text.Learning.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Split.Text.Semantics">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Split.Text.Semantics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Split.Text.Translation.Python">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Split.Text.Translation.Python.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Transformation.Json">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Transformation.Json.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Transformation.Json.Language">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Transformation.Json.Language.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Transformation.Json.Learning">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Transformation.Json.Learning.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Transformation.Json.Semantics">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Transformation.Json.Semantics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Transformation.Text">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Transformation.Text.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Transformation.Text.Language">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Transformation.Text.Language.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Transformation.Text.Semantics">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Transformation.Text.Semantics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Transformation.Text.Translation.Python">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Transformation.Text.Translation.Python.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Translation">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Translation.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Translation.Python">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Translation.Python.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Translation.R">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Translation.R.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Utils">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Utils.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Wrangling">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Wrangling.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Wrangling.Json">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Wrangling.Json.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Wrangling.Translation.Python">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Wrangling.Translation.Python.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="<%= name %>.grammar">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\<%= name %>.<%= semantics %>\<%= name %>.<%= semantics %>.csproj">
<Project>{600FE72C-744A-4D82-B0BC-C0F310AB6155}</Project>
<Name><%= name %>.<%= semantics %></Name>
</ProjectReference>
<ProjectReference Include="..\<%= name %>.<%= learning %>\<%= name %>.<%= learning %>.csproj">
<Project>{313D3DED-2469-43D2-83E1-E9FE53C2625C}</Project>
<Name><%= name %>.<%= learning %></Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

Просмотреть файл

@ -0,0 +1,14 @@
#reference 'file:<%= name %>.<%= semantics %>.dll';
#reference 'file:<%= name %>.<%= learning %>.dll';
using <%= name %>;
using <%= name %>.<%= semantics %>;
using <%= name %>.<%= learning %>;
using semantics <%= name %>.<%= semantics %>.<%= semantics %>;
using learners <%= name %>.<%= learning %>.Witnesses;
language <%= name %>;
@complete feature double <%= scoreFeature %> = <%= scoreHolder %>;
// Your grammar rules here

Просмотреть файл

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.ProgramSynthesis;
using Microsoft.ProgramSynthesis.AST;
using Microsoft.ProgramSynthesis.Compiler;
using Microsoft.ProgramSynthesis.Learning;
using Microsoft.ProgramSynthesis.Learning.Logging;
using Microsoft.ProgramSynthesis.Learning.Strategies;
using Microsoft.ProgramSynthesis.Specifications;
using <%= name %>.<%= learning %>;
namespace <%= name %>
{
class Program
{
public static void Main(string[] args)
{
}
}
}

Просмотреть файл

@ -0,0 +1,26 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("<%= name %>")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("${AuthorCopyright}")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

Просмотреть файл

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Antlr4.Runtime" version="4.5.3" targetFramework="net45" />
<package id="Microsoft.CodeAnalysis.Analyzers" version="1.1.0" targetFramework="net45" />
<package id="Microsoft.CodeAnalysis.Common" version="1.3.0" targetFramework="net45" />
<package id="Microsoft.CodeAnalysis.CSharp" version="1.3.0" targetFramework="net45" />
<package id="Microsoft.ProgramSynthesis" version="0.9.0" targetFramework="net45" />
<package id="Microsoft.ProgramSynthesis.Compiler" version="0.9.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net45" />
<package id="System.Collections.Immutable" version="1.2.0" targetFramework="net45" />
<package id="System.Interactive" version="3.0.0" targetFramework="net45" />
<package id="System.Reflection.Metadata" version="1.3.0" targetFramework="net45" />
</packages>

Просмотреть файл

@ -0,0 +1,210 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{313D3DED-2469-43D2-83E1-E9FE53C2625C}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace><%= name %>.<%= learning %></RootNamespace>
<AssemblyName><%= name %>.<%= learning %></AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="Antlr4.Runtime">
<HintPath>..\packages\Antlr4.Runtime.4.5.3\lib\net45\Antlr4.Runtime.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System.Collections.Immutable">
<HintPath>..\packages\System.Collections.Immutable.1.2.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
</Reference>
<Reference Include="System.Interactive">
<HintPath>..\packages\System.Interactive.3.0.0\lib\net45\System.Interactive.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Reflection.Metadata">
<HintPath>..\packages\System.Reflection.Metadata.1.3.0\lib\portable-net45+win8\System.Reflection.Metadata.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CodeAnalysis">
<HintPath>..\packages\Microsoft.CodeAnalysis.Common.1.3.0\lib\net45\Microsoft.CodeAnalysis.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CodeAnalysis.CSharp">
<HintPath>..\packages\Microsoft.CodeAnalysis.CSharp.1.3.0\lib\net45\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Compiler">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Compiler.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Compound.Extraction.Field">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Compound.Extraction.Field.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Compound.Split">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Compound.Split.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Conditionals">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Conditionals.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Conditionals.Language">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Conditionals.Language.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Conditionals.Learning">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Conditionals.Learning.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Conditionals.Semantics">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Conditionals.Semantics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.CoreFxLab">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.CoreFxLab.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Extraction.Json">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Extraction.Json.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Extraction.Json.Language">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Extraction.Json.Language.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Extraction.Json.Learning">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Extraction.Json.Learning.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Extraction.Json.Semantics">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Extraction.Json.Semantics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Extraction.Json.Translation.Python">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Extraction.Json.Translation.Python.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Extraction.Text">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Extraction.Text.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Extraction.Text.Language">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Extraction.Text.Language.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Extraction.Text.Learning">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Extraction.Text.Learning.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Extraction.Text.Semantics">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Extraction.Text.Semantics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Learning">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Learning.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Matching.Text">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Matching.Text.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Matching.Text.Language">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Matching.Text.Language.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Matching.Text.Learning">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Matching.Text.Learning.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Matching.Text.Semantics">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Matching.Text.Semantics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Matching.Text.Translation.Python">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Matching.Text.Translation.Python.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Paraphrasing">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Paraphrasing.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Split.File">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Split.File.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Split.File.Language">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Split.File.Language.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Split.File.Learning">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Split.File.Learning.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Split.File.Semantics">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Split.File.Semantics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Split.Text">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Split.Text.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Split.Text.Language">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Split.Text.Language.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Split.Text.Learning">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Split.Text.Learning.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Split.Text.Semantics">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Split.Text.Semantics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Split.Text.Translation.Python">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Split.Text.Translation.Python.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Transformation.Json">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Transformation.Json.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Transformation.Json.Language">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Transformation.Json.Language.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Transformation.Json.Learning">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Transformation.Json.Learning.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Transformation.Json.Semantics">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Transformation.Json.Semantics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Transformation.Text">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Transformation.Text.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Transformation.Text.Language">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Transformation.Text.Language.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Transformation.Text.Semantics">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Transformation.Text.Semantics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Transformation.Text.Translation.Python">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Transformation.Text.Translation.Python.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Translation">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Translation.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Translation.Python">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Translation.Python.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Translation.R">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Translation.R.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Utils">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Utils.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Wrangling">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Wrangling.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Wrangling.Json">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Wrangling.Json.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProgramSynthesis.Wrangling.Translation.Python">
<HintPath>..\packages\Microsoft.ProgramSynthesis.0.9.0\lib\net45\Microsoft.ProgramSynthesis.Wrangling.Translation.Python.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Witnesses.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="<%= scoreHolder %>.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

Просмотреть файл

@ -0,0 +1,26 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("<%= name %>.<%= learning %>")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("${AuthorCopyright}")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

Просмотреть файл

@ -0,0 +1,15 @@
using System;
using Microsoft.ProgramSynthesis;
using Microsoft.ProgramSynthesis.AST;
namespace <%= name %>.<%= learning %>
{
public class <%= scoreHolder %> : Feature<double>
{
public <%= scoreHolder %>(Grammar grammar) : base(grammar, "<%= scoreFeature %>") {}
protected override double GetFeatureValueForVariable(VariableNode variable) => 0;
// Your ranking functions here
}
}

Просмотреть файл

@ -0,0 +1,16 @@
using System;
using Microsoft.ProgramSynthesis;
using Microsoft.ProgramSynthesis.Rules;
using Microsoft.ProgramSynthesis.Learning;
using Microsoft.ProgramSynthesis.Specifications;
using System.Collections.Generic;
namespace <%= name %>.<%= learning %>
{
public class Witnesses : DomainLearningLogic
{
public Witnesses(Grammar grammar) : base(grammar) {}
// Your witness functions here
}
}

Просмотреть файл

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Antlr4.Runtime" version="4.5.3" targetFramework="net45" />
<package id="Microsoft.CodeAnalysis.Analyzers" version="1.1.0" targetFramework="net45" />
<package id="Microsoft.CodeAnalysis.Common" version="1.3.0" targetFramework="net45" />
<package id="Microsoft.CodeAnalysis.CSharp" version="1.3.0" targetFramework="net45" />
<package id="Microsoft.ProgramSynthesis" version="0.9.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net45" />
<package id="System.Collections.Immutable" version="1.2.0" targetFramework="net45" />
<package id="System.Interactive" version="3.0.0" targetFramework="net45" />
<package id="System.Reflection.Metadata" version="1.3.0" targetFramework="net45" />
</packages>

Просмотреть файл

@ -0,0 +1,26 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("<%= name %>.<%= semantics %>")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("${AuthorCopyright}")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

Просмотреть файл

@ -0,0 +1,8 @@
using System;
namespace <%= name %>.<%= semantics %>
{
public static class <%= semantics %>
{
// Your semantics implementations here
}
}

Просмотреть файл

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{600FE72C-744A-4D82-B0BC-C0F310AB6155}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace><%= name %>.<%= semantics %></RootNamespace>
<AssemblyName><%= name %>.<%= semantics %></AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Semantics.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

52
gulpfile.js Normal file
Просмотреть файл

@ -0,0 +1,52 @@
'use strict';
var path = require('path');
var gulp = require('gulp');
var eslint = require('gulp-eslint');
var excludeGitignore = require('gulp-exclude-gitignore');
var mocha = require('gulp-mocha');
var istanbul = require('gulp-istanbul');
var nsp = require('gulp-nsp');
var plumber = require('gulp-plumber');
gulp.task('static', function () {
return gulp.src('**/*.js')
.pipe(excludeGitignore())
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('nsp', function (cb) {
nsp({package: path.resolve('package.json')}, cb);
});
gulp.task('pre-test', function () {
return gulp.src('generators/**/*.js')
.pipe(excludeGitignore())
.pipe(istanbul({
includeUntested: true
}))
.pipe(istanbul.hookRequire());
});
gulp.task('test', ['pre-test'], function (cb) {
var mochaErr;
gulp.src('test/**/*.js')
.pipe(plumber())
.pipe(mocha({reporter: 'spec'}))
.on('error', function (err) {
mochaErr = err;
})
.pipe(istanbul.writeReports())
.on('end', function () {
cb(mochaErr);
});
});
gulp.task('watch', function () {
gulp.watch(['generators/**/*.js', 'test/**'], ['test']);
});
gulp.task('prepublish', ['nsp']);
gulp.task('default', ['static', 'test']);

55
package.json Normal file
Просмотреть файл

@ -0,0 +1,55 @@
{
"name": "generator-prose",
"version": "0.1.0",
"description": "Generator for a Microsoft PROSE domain-specific language which is amenable for automatic synthesis.",
"homepage": "https://microsoft.github.io/prose",
"author": {
"name": "Microsoft PROSE",
"email": "prose-contact@microsoft.com",
"url": "https://microsoft.github.io/prose"
},
"files": [
"generators"
],
"main": "generators/index.js",
"keywords": [
"yeoman-generator",
"prose",
"synthesis",
"flashfill",
"domain-specific language",
"dsl",
"grammar"
],
"dependencies": {
"yeoman-generator": "^1.0.0",
"chalk": "^1.1.3",
"yosay": "^1.2.1"
},
"devDependencies": {
"yeoman-test": "^1.6.0",
"yeoman-assert": "^2.2.1",
"eslint": "^3.1.1",
"eslint-config-xo-space": "^0.15.0",
"gulp": "^3.9.0",
"gulp-eslint": "^3.0.1",
"gulp-exclude-gitignore": "^1.0.0",
"gulp-line-ending-corrector": "^1.0.1",
"gulp-istanbul": "^1.0.0",
"gulp-mocha": "^3.0.1",
"gulp-plumber": "^1.0.0",
"gulp-nsp": "^2.1.0"
},
"eslintConfig": {
"extends": "xo-space",
"env": {
"mocha": true
}
},
"repository": "https://msdata.visualstudio.com/DefaultCollection/_git/PROSE",
"scripts": {
"prepublish": "gulp prepublish",
"test": "gulp"
},
"license": "MIT"
}