locked
executing code instead of generating code RRS feed

  • Question

  • DSL Tools are purposed for generating code. But what if I want to execute code? Is there some extensibility mechanism with DSL Tools to provide scripting or such?

    My idea is to create VS solutions and projects based on a DSL.

    Benjamin

    Friday, May 7, 2010 12:31 PM

Answers

  • Preprocessed text templates might be the answer.  You use TextTemplatingFilePreprocessor in the custom tool field of the text template, instead of TextTemplatingFileprocessor.

    This generates code that you can then call from your application.


    - Alan -MSFT
    Friday, May 7, 2010 5:49 PM
  • Hello Benjamin.

    Having a model element, in a DSL, you can access the Store, with is a IServiceProvider, and hence, access anything in Visual Studio, in particular DTE. And then, with DTE, you access the project model, the solution model etc ... against which you code to create VS solutions, projects, files etc ....

    Does it help?

     

     


    Jean-Marc
    Monday, May 10, 2010 5:49 AM

All replies

  • Preprocessed text templates might be the answer.  You use TextTemplatingFilePreprocessor in the custom tool field of the text template, instead of TextTemplatingFileprocessor.

    This generates code that you can then call from your application.


    - Alan -MSFT
    Friday, May 7, 2010 5:49 PM
  • Hello Benjamin.

    Having a model element, in a DSL, you can access the Store, with is a IServiceProvider, and hence, access anything in Visual Studio, in particular DTE. And then, with DTE, you access the project model, the solution model etc ... against which you code to create VS solutions, projects, files etc ....

    Does it help?

     

     


    Jean-Marc
    Monday, May 10, 2010 5:49 AM