diff --git a/generators/app/index.js b/generators/app/index.js index 7bc5695..6d91070 100644 --- a/generators/app/index.js +++ b/generators/app/index.js @@ -134,6 +134,12 @@ module.exports = Generator.extend({ this.destinationPath(path.join(this.props.name, learningNamespace, 'packages.config')), this.props ); + if (this.props.buildGrammar) { + this.fs.copy( + this.templatePath('solution/app/BuildGrammar.targets'), + this.destinationPath(path.join(this.props.name, this.props.name, 'BuildGrammar.targets')) + ); + } }, install: function () { diff --git a/generators/app/templates/solution/app/App.csproj b/generators/app/templates/solution/app/App.csproj index 5cd3ca2..6b8f3fa 100644 --- a/generators/app/templates/solution/app/App.csproj +++ b/generators/app/templates/solution/app/App.csproj @@ -2,7 +2,7 @@ Debug - x86 + AnyCPU {EFBD1A76-0A93-4CE8-8579-A0E6C078E341} Exe <%= name %> @@ -10,7 +10,7 @@ v4.5 true - + true full false @@ -21,7 +21,7 @@ true x86 - + true bin\Release prompt @@ -207,9 +207,10 @@ - + + PreserveNewest - + @@ -222,4 +223,24 @@ + <% if (buildGrammar) { %> + + + false + + + false + + + + + False + $(OutputPath)\<%= name %>.Language.dll + + + + + + + <% } %> diff --git a/generators/app/templates/solution/app/BuildGrammar.targets b/generators/app/templates/solution/app/BuildGrammar.targets new file mode 100644 index 0000000..1fa5568 --- /dev/null +++ b/generators/app/templates/solution/app/BuildGrammar.targets @@ -0,0 +1,40 @@ + + + + + + + + + + + @(GrammarDefinition -> '%(FullPath)') + @(GrammarDefinition -> '%(Filename)') + "@(DslCompiler -> '%(FullPath)')" + mono "@(DslCompiler -> '%(FullPath)')" + + + + + + + + + + + + + + + + $(DslCompiler) -p "@(AssemblyPathsFixedSlash)" -o "@(OutputGrammar)" -v verbose -- "$(InputGrammar)" + + + + + + + + diff --git a/generators/app/templates/solution/app/Grammar.grammar b/generators/app/templates/solution/app/Grammar.grammar index 42f7960..3bd2619 100644 --- a/generators/app/templates/solution/app/Grammar.grammar +++ b/generators/app/templates/solution/app/Grammar.grammar @@ -10,5 +10,6 @@ language <%= name %>; @complete feature double <%= scoreFeature %> = <%= scoreHolder %>; -// Your grammar rules here - +// Your grammar rules here. For example: +@start string P := x; +@input string x; diff --git a/generators/app/templates/solution/semantics/Semantics.csproj b/generators/app/templates/solution/semantics/Semantics.csproj index 31f42d5..4ae87e9 100644 --- a/generators/app/templates/solution/semantics/Semantics.csproj +++ b/generators/app/templates/solution/semantics/Semantics.csproj @@ -30,8 +30,8 @@ - + - \ No newline at end of file +