Is there anything in .NET that allows me to define a grammar and generate a programming language?

I have a course in which the proffesor has asked us to create a DSL for a our final project. He presented us in the first courses xText with Eclipse. This being a new course, I am still a bit fuzzy on what Domain Specific Languages means.

This is my current understanding: a domain specific language is a language that is created for specific problems in software development. Examples of DSL’s are PHP, SQL, JavaScript and on the opposite are languages like Java , C# , C++ , Ruby etc.

Please feel free to correct me if I am wrong.

What I would like to know: is there is any tool for .NET/Visual Studio that is similar to Xtext, that allows me to define a grammar and be allowed to generate a programming language based on that with an activity diagram?

2

The easiest way to go is a fluent interface. This requires no tools at all, and gives you great IntelliSense support, but you still have to write things in a .NET-kinda way, such as

 Mix.Paint(Color.Green).With.Paint(Color.Red);

Alternatively, you can write beautiful DSLs in Boo. There is an entire book on that subject.

1

You can try ANTLR
(or ANother Tool for Language Recognition) a parser generator that is among others available for dotnet. In the community you can find definitions for sql, c# and many other languages.

According to google there is also ide support:

  • ANTLRWorks: The ANTLR GUI Development Environment
  • Eclipse plugin

1

Your first question – what is a domain specific language… because this is too big to fit in a comment.

A domain specific language is a language that is designed to work within a particular problem domain. For example, within the Unreal engine (used for first person shooters), there is a domain specific language called UnrealScript that allows one to modify the behavior of the Unreal engine. This language is designed for solving general problems but rather is constrained to its specific domain. Redcode (for corewars) would be another domain specific language. The language within Context Free Art is specific to its domain.

The idea is that with a domain specific language, one could create a DSL that closely maps the problem at hand. At this point, it is easier to program in the DLS than it is to program in a general language even with the added libraries to handle the problem domain.


As for your second question – the tools in C#… I don’t know C# and thus don’t know the tools that well. That said, back when I was taking a compiler class in college two of the tools that were used (and I have since used) are lex and yacc. Over at Stack Overflow… Lex/Yacc for C#?

There is a Visualization and Modeling SDK for Visual Studio which supports Text Templating (T4 templates) and Domain-Specific Languages.

http://msdn.microsoft.com/en-us/library/dd820703.aspx

This site may be interesting for you: http://nemerle.org . It’s language for .net platform with rich metaprogramming features. More recently, the project is under the wing of the JetBrains: http://blogs.jetbrains.com/dotnet/2012/06/jetbrains-and-nemerle/ .

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật